#2316: GenericRelation and get_or_create do not work together ----------------------------------------+----------------------------------- Reporter: Rudolph | Owner: adrian Status: reopened | Milestone: 1.3 Component: Contrib apps | Version: 1.2 Resolution: | Keywords: GenericRelation Triage Stage: Accepted | Has patch: 0 Needs documentation: 0 | Needs tests: 0 Patch needs improvement: 0 | ----------------------------------------+----------------------------------- Changes (by lukeplant):
* has_patch: 1 => 0 Comment: The attached patch does not address the original problem, as can be seen if you change this line in the added test: {{{ #!python fatty = TaggedItem.objects.create(content_object=bacon, tag="fatty") }}} to: {{{ #!python fatty = TaggedItem.objects.get_or_create(content_object=bacon, tag="fatty") }}} The patch fixes a related problem, which is probably worthy of fixing on its own, although the original bug title would cover both cases. The original bug would probably require patching core, or we might want to wait until core has support for virtual/composite fields and `GenericRelations` could be re-worked to use that support. So, the most recent patch needs to be put into a new ticket if it is to be included on its own. So I'm marking *this* ticket as having no patch. Sorry for the ticket-churn, but it's needed to keep things sane. Thanks. -- Ticket URL: <http://code.djangoproject.com/ticket/2316#comment:13> 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 django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.