On Nov 10, 3:02 pm, Zeynel <azeyn...@gmail.com> wrote: > Thanks. I will try what you suggested. But I am almost there with the > admin, the only thing is I need to change the date format so that it > takes only the year. Now DateField requires month, day and year. I > tried this > > year_graduated = models.DateField('Year graduated', input_formats= > ['%Y']) > > as in > > class Lawyer(models.Model): > first = models.CharField(max_length=20) > initial = models.CharField(blank=True, max_length=2) > last = models.CharField(max_length=20) > year_graduated = models.DateField('Year graduated', input_formats= > ['%Y']) > school = models.CharField(max_length=200) > school = models.ForeignKey(School) > def __unicode__(self): > return self.first > > but it doesn't work. Some googling shows that I may be confusing > "form" and "models"http://osdir.com/ml/DjangoUsers/2009-03/msg02593.html > > In that case how can I fix the DateField so that it takes only the > date? Because I only need "Year Graduated" not month or day. > > Thanks again.
If it only takes a year, it's not a date field. So just use a string or an integer field, possibly with a list of choices for the range of years you want. -- 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---