On 8/12/06, James Bennett <[EMAIL PROTECTED]> wrote: > A little validation in the save() method for Price (or maybe even a > custom validator) to ensure that only one "active" price exists for a > given Material at any time, and you're good to go; given an instance > of Material, say in a variable 'm', you can then do > 'm.current_price.price' to get the currently effective price for the > material, and 'm.price_set.all()' to get the historical list of all > prices (or 'm.price_set.filter(active=False)' to get only the previous > prices).
And I realized about five seconds later that I called a field 'is_active' in one place, and 'active' everywhere else; fix that, and you're good to go :) -- "May the forces of evil become confused on the way to your house." -- George Carlin --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~----------~----~----~----~------~----~------~--~---

