Hmm, I can't fathom it. I would opt for a single simple query that returns a little more than you need and post-process it in python. This would be more maintainable than a hairy ORM query, I'd say; but if you have vast numbers of results that may not be appropriate.
Alternatively, and presuming you can't add and keep up to date an 'is_current' (or whatever) column in the database to make the status of a given State explicit, you could construct a database view which computes this flag instead, backed by a different model with Options.managed = False. That's the view from my armchair, anyway! Steven. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.