Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

try update __odm_fields__ from a second parent class ... #57

Closed
Barceloch opened this issue Nov 26, 2020 · 1 comment
Closed

try update __odm_fields__ from a second parent class ... #57

Barceloch opened this issue Nov 26, 2020 · 1 comment
Labels
question Further information is requested

Comments

@Barceloch
Copy link

Barceloch commented Nov 26, 2020

waiting model inherance... :)

@Barceloch Barceloch changed the title TypeErro extending odmantic model ... how set custom __collection__ from odmantic model? ... Nov 27, 2020
@Barceloch Barceloch changed the title how set custom __collection__ from odmantic model? ... how set custom __collection__ name from odmantic model? ... Nov 27, 2020
@Barceloch Barceloch changed the title how set custom __collection__ name from odmantic model? ... BAD ;) Nov 27, 2020
@Barceloch Barceloch changed the title BAD ;) FIX! ;) Nov 27, 2020
@Barceloch Barceloch changed the title FIX! ;) TypeError customizing the collection name Nov 27, 2020
@Barceloch Barceloch reopened this Nov 27, 2020
@Barceloch Barceloch changed the title TypeError customizing the collection name customizing the collection name Nov 28, 2020
@Barceloch Barceloch changed the title customizing the collection name how customize odmantic Model for my project models? Nov 28, 2020
@art049
Copy link
Owner

art049 commented Nov 30, 2020

Actually model inheritance is not supported yet.
It should work like this though:

from odmantic import Model

class ContactModel(baseModel):
    class Config:
        collection = "__Contacts"    # <---------------*it this will be a dynamic custom name  for all my models*

    fullname: str
    phone: str
    email: str  

@art049 art049 added the question Further information is requested label Nov 30, 2020
@Barceloch Barceloch changed the title how customize odmantic Model for my project models? try update __odm_fields__ from a second parent class ... Nov 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants