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

Something to include in the documentation. #31

Closed
rlam3 opened this issue Feb 6, 2015 · 0 comments
Closed

Something to include in the documentation. #31

rlam3 opened this issue Feb 6, 2015 · 0 comments
Labels

Comments

@rlam3
Copy link
Contributor

rlam3 commented Feb 6, 2015

Primary column name from the table must match the attribute name of the object model. Otherwise they will run into the following primary key error. Is this correct?

Column name of table: userid
User object attribute for primary key: id

class User(db.Model):
id = Column('userid'...

def _after_flush(app, changes):
...
primary_field = values[0][1].pure_whoosh.primary_key_name 

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This line will see user.userid. When adding/saving objects into the database an attribute error will occur for whoosh.

Is there a way to specify the primary key or should migrate our tables to:

class User(db.Model):
id = Column('id'...

Thanks :)

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

No branches or pull requests

2 participants