Why do you want to split it across two models?
On Nov 5, 9:25 am, bruno desthuilliers <bruno.desthuilli...@gmail.com>
wrote:
> Hi all
>
> I have this pattern:
>
> class ModelOne(models):
> content_type = models.ForeignKey(ContentType)
>
> class ModelTwo(models):
> model_one = models.ForeignKey(ModelOne)
> object_id = models.PositiveIntegerField()
>
> And I'd like to have a 'content_object' GenericForeignKey (or anything
> with a close enough behaviour) in ModelTwo. From a quick glance at the
> implementation of GenericForeignKey, it looks that 1/ it won't just
> work OOTB (the code looks for the 'content_type' field in the host
> model class) , and 2/ the implementation is not exactly a piece of
> cake. Not that I would not be able to write a working solution, but
> it's surely complex and tricky enough to make me first check if
> someone else solved the problem before !-)
>
> So the question, obviously, is "did anyone here had the same use case,
> and if yes how did you solve it" ? FWIW, I googled for
> GenericForeignKey on this group and found one post about the same use
> case, but with no answer at
> all:http://groups.google.com/group/django-users/browse_frm/thread/469a0a0...
>
> TIA for any hint
> Bruno.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---