Not sure on the Django side, but I know that most forum software uses a
separate table for threads, having the posts refer back to the thread_id.
The first post, would obviously be the topic of the thread.

On Wed, Dec 16, 2009 at 9:31 AM, Stewart <stewart.mathe...@gmail.com> wrote:

> Disclaimer: This is my first Django adventure, please be gentle.
>
> I am currently working on a model that has a foreign key pointing to
> itself. This foreign key is not mandatory. Think of a post in a forum.
> The post will have a number of replies. The post itself will not have
> a foreign key however each reply to the post will have a foreign key
> of the initial post. So far so good, I have managed to set up the
> model correctly.
>
> I am having a little trouble with the form. I am not sure of the best
> way to lay it out for Django. I was initially thinking that I could
> pre-populate an integer field with the widget type set to hidden. So
> for example if I am viewing posts/34 and I click on reply the foreign
> key field will be hidden and auto populated to 34. When the form gets
> submitted the record gets created with the correct foreign key.
>
> Am my approaching this in the correct way? Is there a correct "Django"
> way to do this that I have missed?
>
> Thanks in advance for any help.
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>
>

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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.


Reply via email to