Saturday, August 16, 2014

Re: Should I use generic foreign key, and how?

I think there really are two ways to do it, as you say.

Either use a GenericForeignKey(), or have multiple ForeignKey(null=True, blank=True), each one pointing to a different model. I personally use the multiple foreign keys approach, but this is the case that GenericForeignKey was designed for.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/988b283a-bf12-430c-a6bd-542eac0106fc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment