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

calling .update on an object will update every record in the database of that type #10

Open
smtheard opened this issue Nov 18, 2016 · 3 comments

Comments

@smtheard
Copy link

eg.

>>> page = Page.get(id=1)
>>> page.update(name="this is probably not how this should work").execute()
('UPDATE pages SET "name" = %s', [u'this is probably not how this should work'])
1110
>>> Page.ALL.count()
('SELECT Count(*) FROM pages AS p1', [])
1110L
@keredson
Copy link
Owner

I think you're calling the class method there, not the instance method.

@smtheard
Copy link
Author

@keredson I think that's what happening too but it was pretty unexpected, seems like an instance method should be there (or maybe throw an exception so it doesn't call the model function?)

@keredson
Copy link
Owner

Yeah I agree with that.

On Nov 18, 2016 6:40 PM, "Stefan Theard" notifications@github.com wrote:

@keredson https://github.com/keredson I think that's what happening too
but it was pretty unexpected, seems like an instance method should be there
(or maybe throw an exception so it doesn't call the model function?)


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#10 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AB9GgSvXy7nLcEQEqWJ-4DlDLYQdB5rPks5q_kVfgaJpZM4K278a
.

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