Hi, I read all the tutorials and i know the Django basics as well. I think you misunderstood what i asked.
Dont get confused with the 'user' class i mentioned below with "User class which would be better extended using a User Profile" . Just to give an example i used the name 'user'. Let me rephrase the question. class People (models.Model): person_name = models.CharField(max_length=150) class comments (models.Model): comment = models.CharField(max_length=1000) root_comment = models.ForeignKey('self', null=True, blank=True, related_name="children") People_id = models.ForeignKey(People) class comment_feedback (models.Model): feedback_People_id = models.ForeignKey(People) comment_id = models.ForeignKey(comments) feedback_type_id = models.CharField(max_length=20, choices=FEEDBACK_CHOICES) class Meta: unique_together = [("feedback_People_id", "info_id")] We are trying build a html page that will do the following. Once a user logs in, he can write a new comment (that would result in an insert into comments table) Alternatively he can do one of the following: select a comment of some other peoples and give his feedback (that would result in an insert into comment_feedback table) select a comment and write his own comment with a feedback on the original comment (that would result in an insert into comments table with root_comment as the original comment and an insert into comment_feedback table for the original comment) We tried doing this inlineformset_factory and nested formsets. However we are quite confused on how to proceed with this. Also the comment_feedback table has 2 foreign keys. How do we handle this at the form and template level? Regards ~Nirmal On Tuesday, August 21, 2012 1:57:05 PM UTC-7, Nirmal Sharma wrote: > > > --This is the model definition > > FEEDBACK_CHOICES = ( > (1, 'FOR'), > (-1, 'AGAINST'), > (0, 'NEUTRAL'), > ) > > > class user (models.Model): > user_name = models.CharField(max_length=150) > > > class comments (models.Model): > comment = models.CharField(max_length=1000) > root_comment = models.ForeignKey('self', null=True, blank=True, > related_name="children") > user_id = models.ForeignKey(user) > > > class comment_feedback (models.Model): > feedback_user_id = models.ForeignKey(user) > comment_id = models.ForeignKey(comments) > feedback_type_id = models.CharField(max_length=20, > choices=FEEDBACK_CHOICES) > class Meta: > unique_together = [("feedback_user_id", "info_id")] > > > > We are trying build a html page that will do the following. > Once a user logs in, he can write a new comment (that would result in an > insert into comments table) > Alternatively he can do one of the following: > select a comment of some other user and give his feedback (that would > result in an insert into comment_feedback table) > select a comment and write his own comment with a feedback on the > original comment (that would result in an insert into comments table with > root_comment as the original comment and an insert into comment_feedback > table for the original comment) > > We tried doing this inlineformset_factory and nested formsets. However we > are quite confused on how to proceed with this. Also the comment_feedback > table has 2 foreign keys. > How do we handle this at the form and template level? > > Regards > ~Nirmal > -- 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/-/DMy4tCQfv7cJ. 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.