On Oct 28, 10:47 am, Daniel Austria <[EMAIL PROTECTED]> wrote: > Hello, > > i got a huge problem. I have got an Idea class and an ideacomment > class. You can guess what these classes are used for. What i do is the > following: > > - the ideacomment class has an foreignkey > - this foreignkey is marked as edit_inline > - when i edit an idea instance in the admin i can also add some > comments in the same html page > - BUT: the comments are not saved .... ?????? > > Strange... what should i try / debugg or look at ..... > > Dan > > ps. i did not write any views or else... the code below is the whole > code i have .... > > -------------- CODE------------------------- <snip> > class IdeaComment(models.Model): > Header = models.CharField('Header', maxlength=500, core=True) > Text = models.TextField('Description', core=True) > IsParticipant = models.ForeignKey(Participant, core=True) > LastModified = models.DateTimeField('Last Modified', core=True, > auto_now = True) > IsIdea = models.ForeignKey(Idea, edit_inline=models.STACKED, > min_num_in_admin=6, num_extra_on_change=6) > > def __unicode__(self): > return self.Header > def __str__(self): > return self.__unicode__()
As Erik has pointed out, this is code for an old version of Django, so I'm not entirely sure about this. But if I had to guess, I would say that the problem is that LastModified has core=True. The old admin would only save an inline element if all 'core' fields were filled in. But since LastModified has auto_now_add, it doesn't appear in the admin - so it may well be that that's stopping it from saving. Try removing either core=True or auto_now_add=True from LastModified and see if that works. -- DR. --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---