> Can someone point me to the problem? > > class Base(models.Model): > User = models.CharField(maxlength=200) > Notes = models.CharField(maxlength=200) # free text > > def _first_date(self): > """ Return the first date """ > if self.segment_set.count() > 0 > return(self.segment_set.order_by('create_date') > [0].create_date) > first_date = property(_first_date) > > class Segment(models.Model): > base = models.ForeignKey(Base) > create_date = models.DateTimeField(auto_now_add=True) > update_date = models.DateTimeField(auto_now=True) > Notes = models.CharField(maxlength=200) # free tex > > ################# > D:\Sites\mysite>python manage.py syncdb > Error: Couldn't install apps, because there were errors in one or more > models: > mysite.traveler: invalid syntax (models.py, line 8)
If you did a copy&paste of your actual code, line #8 ("def _first_date(self):") seems to have an extra space worth of indentation from the User/Notes lines. Python would flag this as bogus, which in turn would likely trigger an error in validation. -tim --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---