Wednesday, January 23, 2013

Re: Relations to unknown models?

Hi galgal,

You might want to take a look at django.contrib.comments (either use it or learn from it) and/or GenericForeignKey.

HTH

Jirka

From: galgal <weglarek.robert@gmail.com>
Sender: django-users@googlegroups.com
Date: Wed, 23 Jan 2013 14:48:55 -0800 (PST)
To: <django-users@googlegroups.com>
ReplyTo: django-users@googlegroups.com
Subject: Relations to unknown models?

Hi.
I'm looking for a solution to make site-wide comments that can be connected with different models via FK.
I want to make 1 global model Comments. I want to make a relation to Articles, Relations and Solutions models. I the future I plan to add additional models. Now, Comments model should allow me to make relations to any of that models via FK. What is important, I need to have 1 and only 1 Comments model, and it won't be abstract model.
On site I want to display stats showing how many comments were added to each model.

Any suggestions?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/AhXGBGXPu_oJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment