> Consider a weblog app with an Entry model and a Category model:
>
> * An Entry can be either "live" or "draft".
> * There's a many-to-many relation between Entry and Category.

[snip (paraphrased) altering the default manager breaks admin, but it's
necessary to change how related fields do their lookups]

> It'd be awfully nice not to end up in those sorts of "no-win" situations...

Would it make any sense to allow relations to specify the manager they
should use? For instance:

  class Category(models.Model):
      # ...
      entries = ManyToManyField(Entry, manager='live_entries')

Or rework relations to allow relations to other *managers* instead of
other *models*:

  class Category(models.Model):
      # ...
      all_entries = ManyToManyField(Entry.objects)
      entries = ManyToManyField(Entry.live_entries)

SQLAlchemy does something similar to the 2nd example, in that relations
are related to mappers not mapped classes.

JP


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers
-~----------~----~----~----~------~----~------~--~---

Reply via email to