On Mon, Jul 11, 2011 at 21:02, stan <stanislas.gue...@gmail.com> wrote:
>>
>> > class Book(models.Model):
>> >    title = models.CharField(max_length=120)
>> >    date_published = models.DateField()
>>
>> Big tip - if you *actually* need a date_published field, use a string :)
>
> Sorry, but I don't get it.
>
> You mean a CharField, right ?

Yah, sorry. I actually needed to write a "Books" app for some
translation data entry that needed doing at my local Uni - and Char
was plain easier for search and sort than Date - and very few books
have the month/day details - think about what you actually need the
date_published field for: search and sort and that's about it. You do
not need to do any maths with it. Use the Char.

cheers
L.


-- 
Schweigt stille, plaudert nicht (Be still, stop chattering) (aka The
Coffee Cantata) (BWV 211) is a secular cantatawritten by Johann
Sebastian Bach between 1732 and 1734. In a satirical commentary, the
cantata tells of an addiction to coffee, a pressing social problem in
eighteenth century Leipzig, where this work was premiered. (via
http://bestofwikipedia.tumblr.com/ )

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to