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

What happens if the field id is not actually named id but uid or something else #19

Open
lbdremy opened this issue Mar 2, 2012 · 1 comment

Comments

@lbdremy
Copy link

lbdremy commented Mar 2, 2012

Hello Xavier, thanks for sharing this.

I wonder if the field id is not actually named id but uid or something else, does the lib works as expected?
Because I expected when saving a new record that the save() method looks for if the record was already present in the database and in this case make a UPDATE query and not an INSERT query. The thing is in my case it's happening I get an error because joli tries to insert a row already existing and I wonder if that's because my field id as for name uid.

Could you give me an example showing how should users update a row in the database with convenient method like save.

Thanks for your help and time.

@OwenMelbz
Copy link

It wont work from what I've found, I've actually modified the joli core so it alloys when defining your model to set model.primary_key so everywhere then uses that. I recommend this for you if its a requirement!

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

2 participants