#9475: add(), create(), etc. should be supported by intermedite ManyToMany model with extra attributes if extra fields can be calculated ------------------------------------------+--------------------------------- Reporter: [EMAIL PROTECTED] | Owner: nobody Status: new | Milestone: Component: Database layer (models, ORM) | Version: 1.0 Keywords: | Stage: Unreviewed Has_patch: 0 | ------------------------------------------+--------------------------------- Intermedite ManyToMany model with extra attributes should support add(), create(), etc. when the extra fields have default values or are calculated.
For example, for the following models: {{{ class Person(models.Model): name = models.CharField(max_length=128) class Group(models.Model): name = models.CharField(max_length=128) members = models.ManyToManyField(Person, through='Membership') class Membership(models.Model): person = models.ForeignKey(Person) group = models.ForeignKey(Group) added = models.DateField(auto_now_add=True) }}} This should be possible: {{{ Group.members.add(Person.objects.create(name='Joe')) }}} Similarly, if the attributes are calculated in the custom save() method or if they have a default value, those methods should be supported. Maybe, simply removing the extra checks will do. So is it is the values are not sufficient, a db error will be raised anyway. -- Ticket URL: <http://code.djangoproject.com/ticket/9475> Django <http://code.djangoproject.com/> The Web framework for perfectionists with deadlines. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@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-updates?hl=en -~----------~----~----~----~------~----~------~--~---