On Jan 22, 1:20 am, Malcolm Tredinnick <malc...@pointy-stick.com> wrote: > > How is it wrong that when you want a custom form you have to actually > write some code? Django cannot read your mind. It cannot possibly > accommodate every single use-case of every person on the planet out of > the box. It's designed to be extensible for precisely that reason. > > "I have to write some code" is not a bad thing. Django is a library for > programmers.
I understand. But you know, every developer has own opinion. Maybe in this case it's a bad taste of mine. And I agree that django is a very cute, well designed and powerful library. Since I came from C++ world I call django "Qt for web development" :) > > I think it would be much better to specifybothM2M fields with the > > same table name. > > Well, have lots of fun implementing your own field type to do this, if > it's what you want. > > Django's ManyToManyField is, and always will be, specified on exactly on > model. That describes the data and the programmatic API. Trying to hack > that to modify the presentation of a form is still attacking the wrong > end of the problem. Sorry, but I can disagree a bit. I've written what can be done to make it work in a way I've described here: http://groups.google.com/group/django-developers/t/6a91f3523a69c2b And it is a kind of ManyToManyField.through, isn't it? If we return to the beginning of discussion: class User(models.Model): groups = models.ManyToManyField('Group', related_name='groups', db_table=u'USERS_TO_GROUPS') class Group(models.Model): users = models.ManyToManyField(User, related_name='users', db_table=u'USERS_TO_GROUPS') I don't feel it abnormal. Yes, it can be my fault and also I work with DB and django only about one month, so please forgive my arguing. This code works fine with django, but with the only exception: syncdb tries to generate 2 tables. It would be nice to specify something like "create_table=False" in the second M2M, and it will be very like "through" option. It's my humble opinion. --~--~---------~--~----~------------~-------~--~----~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---