Hi,
I ended up creating a custom field (
https://github.com/clearspark/django-monthfield).
I used a lot of your input, thank you all.
Cheers,
Matthys
On Mon, May 4, 2015 at 7:09 PM, Tim Chase
wrote:
> On 2015-05-03 14:35, Matthys wrote:
> > I posted the question also on stackoverflow:
> >
>
On 2015-05-03 14:35, Matthys 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
Hi Erik,
Thanks for your reply.
I'm aware of the problems with timedelta(months=2), since the length of a
month is not fixed, a length of time specified in months is ambiguous.
Though months do have an internally consistent algebra as you point out and
people often refer to time-periods in month
> Den 04/05/2015 kl. 14.21 skrev Erik Cederstrand :
>
> class Month(models.Model):
>year = models.IntegerField()
>month = models.PositiveSmallIntegerField()
>
>def add_months(self, n):
>assert n >= 0
>dy, dm = divmod(self.month + n, 12)
>self.year += dy
>
> Den 04/05/2015 kl. 13.26 skrev Matthys Kroon :
>
> I'm specifically looking at only situations where the year and month alone
> are significant.
>
> The downside I see with using a DateField and forcing the day to the first of
> the month, with custom widget etc. is that somebody looking at
Hi,
I'm specifically looking at only situations where the year and month alone
are significant.
The downside I see with using a DateField and forcing the day to the first
of the month, with custom widget etc. is that somebody looking at the
database may not realize that something unusual is going
On 4/05/2015 12:31 PM, Tom Lockhart wrote:
Surely that would destroy data which wouldn’t be desirable.
I’m not sure how that follows.
If you are adjusting a date from whatever it actually is to the first of
the month you lose the actual date.
Although the question does not state
it exp
On May 3, 2015, at 7:17 PM, Mike Dewhirst wrote:
> On 4/05/2015 11:41 AM, Tom Lockhart wrote:
>> On May 3, 2015, at 2:35 PM, Matthys wrote:
>>
>>> I posted the question also on stackoverflow:
>>>
>>> http://stackoverflow.com/questions/30017229/how-to-represent-month-as-field-on-django-model
>>
On 4/05/2015 11:41 AM, Tom Lockhart wrote:
On May 3, 2015, at 2:35 PM, Matthys 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 sp
On May 3, 2015, at 2:35 PM, Matthys 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 specif
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.
--
You received this message because you are su
11 matches
Mail list logo