On 7/30/06, Neilen Marais <[EMAIL PROTECTED] > wrote:

This should be completely compatible with ordinary use of m2m
relations. It would be problematic if either Tag or Image had any
fields in common with ImageTagInfo, but that would presumably be
checked at model creation type.

One could object that this is a bit "magic" or implicit or even
ambiguous. On some days I might even be inclined to agree ;)  All in
all it seems quite workable to me though.

I can't speak for others, but for me, this ambiguity is a big problem. While the ambiguity could be avoided with some extra validation to ensure that field names don't overlap, the 'related_name' field (and the consequent potential for model collisions) causes enough difficulty with newcomers without adding additional ambiguity in m2m field definitions.

Another option I can think of is to add extra fields to the related
models, eg.

Image.objects.filter(tags__name='the truth',
                     imagetaginfo__extra_tag_info='suspect')

I'm not sure this is much better - same ambiguity, just a different model being affected.

For me, a good syntax would stand out as obvious - 'oh - that's a field tied to the relation', rather than 'is that a model field or a relation field... I don't know... check models.py...". I don't know what the right syntax is - but what you have proposed isn't it. Any other suggestions?

Yours,
Russ Magee %-)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Django developers" 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-developers
-~----------~----~----~----~------~----~------~--~---

Reply via email to