--
Steven

On Wed, Oct 12, 2011 at 8:07 AM, Anssi Kääriäinen
<anssi.kaariai...@thl.fi>wrote:

>
> Model.save() should return models.UPDATED or models.INSERTED. That is
> more helpful than the 1/0 return value. For example you might want to
> do different things if the model was inserted or updated in
> application code. Or if loading data from a file, you might want to
> know how many objects already existed in the DB and how many were
> inserted. Of course if you could cheaply get models.UNCHANGED, that
> would make the feature perfect...
>

If you're ensuring a set of data from some other source, what's the use of
knowing what was new? Are there other concrete cases where this might be
useful?


>
> I agree that model.save() should never return 0/None/models.NOACTION,
> that should be an exception instead of a return value. After .save()
> the model should exists in the database. If the object for some reason
> isn't persisted, it is worth an exception instead of easy to miss
> return value.
>

Possibly, but an exception cannot be added until the programmer is passing a
precondition and can reasonable expect the condition of nothing being saved.
That's definitely not on this ticket.


>
>  - Anssi Kääriäinen
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers" group.
> To post to this group, send email to django-developers@googlegroups.com.
> To unsubscribe from this group, send email to
> django-developers+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-developers?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to