Sunday, May 3, 2015

Re: How to represent a calendar month as a field in django models

On May 3, 2015, at 2:35 PM, Matthys <matthysk@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.

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+unsubscribe@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/870AC9B8-093F-47B6-8906-F76EB2453791%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment