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

table_class and fields #657

Closed
bronte2k7 opened this issue Apr 26, 2021 · 2 comments
Closed

table_class and fields #657

bronte2k7 opened this issue Apr 26, 2021 · 2 comments

Comments

@bronte2k7
Copy link

class Account(Table):
    email = Field('email', type='string', unique=True)
    password = Field('password', type='password')

db.define_table('account', table_class=Account)
db.account.fields() # return ['id']

Class table is only needed for their own methods?
Or am I doing something wrong?

@valq7711
Copy link
Contributor

Yes, it is so, you can't define fields by this way, but you can try this magic:
https://github.com/valq7711/voodoodal

@bronte2k7
Copy link
Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants