#28987: Migration changing ManyToManyField target to 'self' doesn't work correctly ---------------------------------+------------------------------------- Reporter: MSleepyPanda | Owner: SShayashi Type: Bug | Status: assigned Component: Migrations | Version: 2.0 Severity: Normal | Resolution: Keywords: ManyToManyField | Triage Stage: Accepted Has patch: 0 | Needs documentation: 0 Needs tests: 1 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 ---------------------------------+-------------------------------------
Comment (by MSleepyPanda): Replying to [comment:3 SShayashi]: > Can I check out what you want? You can use 'self' instead of 'Foo' like this : > {{{ > class Foo(models.Model): > bar = models.ManyToManyField('self', blank=True) > }}} > > You meant that we should use 'Foo' rather than 'self', right? Exactly, though i wasn't aware that `self` would work in that context. I think i like naming the type directly more, since `self` could be easily confused with the `self` argument of class methods. -- Ticket URL: <https://code.djangoproject.com/ticket/28987#comment:4> Django <https://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 unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/070.49a3638a8868083d4dfabf1112acc42f%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.