> > You can extract this information from the _meta attribute on a model. > This isn't documented (yet), but it's on the TODO list for things to > document before 1.0. > thanks, i will check out this _meta attribute.
it seems to me that ManyToManyField is not a field, it is a table. so if we did not have this field we could still implement this kind of relationship by introducing a model with two foreign keys (using my original example): class Assoc(models.Model): a = models.ForeignKey('A') b = models.ForeignKey('B') but this would result in A and B types not having the helper accessor methods returning the corresponding sets from the relation. but this can be solved by introducing a new method that takes a pair of models (let us call it Pair): class Assoc(models.Model): ab = models.Pair(A, B) this could do just the same as ManyToManyField and create the accessor methods that return association sets on A and B. having a separate model for the associations table will allow us to count associatons easily. whereas right now, unless i have missed something, we can only count associations that belong to a particular object. unless we use explicit sql code as shown above. also, i think QuerySets need a (lazy) join method that would return a new QuerySet. to be efficient the ORM needs to be as close as possible to the database query language. i think. konstantin --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@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-users?hl=en -~----------~----~----~----~------~----~------~--~---