On 4/05/2015 11:41 AM, Tom Lockhart wrote:
On May 3, 2015, at 2:35 PM, Matthys <matth...@gmail.com> wrote:
I posted the question also on stackoverflow:
http://stackoverflow.com/questions/30017229/how-to-represent-month-as-field-on-django-model
The question is for situations where a model instance relates to a specific
month, but not to a specific day.
I would use a date field and, perhaps, clean the data to force the day to be
the first day of the month. Then you can do date/time arithmetic using standard
features.
Surely that would destroy data which wouldn't be desirable.
I would probably add a month (character or integer) field to the model
and extract and update that month field every time the instance is saved.
hth
- Tom
--
You received this message because you are subscribed to the Google Groups "Django
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/5546D6D1.8040304%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.