# I have 2 models, say A and B
class A(models.Model):
    pass

class B(models.Model):
    pass

"""
Now my query is which of the following would you choose and why?
"""

class GenericFK(models.Model):

    content_type = models.ForeignKey(ContentType)
    object_id = models.PositiveIntegerField()
    content_object = generic.GenericForeignKey('content_type', 'object_id')
#-- vs --

class MultipleFK(models.Model):
    a = models.ForeignKey(A, null=True)
    b = models.ForeignKey(B, null=True)


Thank you.


-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to