I'd go with form validation -- you shouldn't allow a Purchase to be added
to a transaction if a Purchase with a conflicting status is already in
there, nor should a Purchase be able to be modified if it's in a
transaction with another Purchase.

Then you never have to check whether a transaction is valid. The models
pasted don't give the complete picture of the relationship, but garbage in,
garbage out, so just don't allow them to exist in the first place.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAOzwKwEOBTjZmAwwK_a7jTD1jyW0%2BVmeuSEVgdcQCNG7ts37Rw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to