Re: Need help getting this snippet to work in Django 1.2...

2011-06-13 Thread Micky Hulse
On Mon, Jun 13, 2011 at 9:44 AM, Micky Hulse wrote: > Ooh, great tip! That looks very useful and possibly a little more > simple/straight-forward than using a form field. Too easy! https://gist.github.com/1023327 Thanks for the help Martin and Alex, I really appreciate it! :) Have an awesome d

Re: Need help getting this snippet to work in Django 1.2...

2011-06-13 Thread Micky Hulse
Hi Alex! Thanks for the reply, I really appreciate it. :) On Sun, Jun 12, 2011 at 9:01 PM, Alex Kamedov wrote: > It'll be better to use validators with IntegerField > In this case you can specify allowed year range. Ooh, great tip! That looks very useful and possibly a little more simple/straigh

Re: Need help getting this snippet to work in Django 1.2...

2011-06-12 Thread Alex Kamedov
It'll be better to use validators with IntegerField https://docs.djangoproject.com/en/1.3/ref/models/fields/#validators https://docs.djangoproject.com/en/1.3/ref/validators/ In this case you can specify allowed year range. On Sat, Jun 11, 2011 at 9:25 AM, mhulse wrote: > Hi Martin! Thanks so m

Re: Need help getting this snippet to work in Django 1.2...

2011-06-10 Thread mhulse
Hi Martin! Thanks so much for the help, I really appreciate it. :) > The snippet is a form field, not a model field. Well, that would explain things! Lol. When I read this in the instructions: "Usage eg: yob = BirthYearField(label="What year were you born?")" I thought that was a model field.

Re: Need help getting this snippet to work in Django 1.2...

2011-06-10 Thread Martin
I think this is not how it works. The snippet is a form field, not a model field. Basically I think you should use an IntegerField (you just want to store a year, right?). Then somehow you need to override the widget or so and make sure that in the admin that form will be used for that IntegerField

Need help getting this snippet to work in Django 1.2...

2011-06-10 Thread mhulse
I feel like this should be simple... I would like to replace this model field: date = models.DateField(_(u'Year'), unique=True) ...with this snippet: http://djangosnippets.org/snippets/508/ I have spent the last couple hours banging my head on my keyboard... During the course of my tests, at