-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Different creation behavior #65
Comments
Hi @imaia, This behaviour is expected. In the first example, your object is only in memory and has no database record for it, so The main idea of
|
In the second example, inside the signals, the instance is considered also not dirty. Should this happen? I use dirty-fields to update auto-generated fields that may be manually overwritten. |
Can you please be more precise ? Can you also describe your use case a bit more ? With some code examples ? Note that |
In the example below, I show a use case. My actual use case is with an hashcode, that is updated only if certain fields are altered:
|
Thanks for this example ! I will have a look and come back to you soon. |
These 2 situations are strictly equivalent:
The difference is in Model initialisation. |
Hey @imaia ! I have worked on it and added a more consistent behavior for model instances not yet saved in the database. I will release this change in a major version release (probably |
Wonderful! I'll take a look as soon as I can. |
Add consistent behavior for initial model state (before being saved in the database). Fix #65, but add some backward compatibility. This change will be released in version `1.0`.
If I do this:
I believe both examples should behave like the first example.
The text was updated successfully, but these errors were encountered: