> > > 240:00:00 (alternatively 10d 00:00:00) > > > > Does the timesince filter do what you require? > > If I understand correctly, gilhad wants to specify an interval. > > Possible solutions: use two PositiveIntegerFields to supply days > and/or minutes and use them to construct a datetime.timedelta object. > Or store a DateTimeField and construct the interval in python via > subtracting some given date (1.1.1970 ??) from the stored value - bit > hackish though...
Yes, I worked at it a little and it occures to me, that what I really need are new types of Field The situation is, that in the database are stored INTEGERs, but meaning of this values is SECONDS. So the underlaiyng integers should be presented on output/input as time, but stored numerically. There are 3 kinds of them: LongTimeField ... 1673:30:00 hour was spend by our 10 operators on your project last month (well, each was working around 8 hours/working day), so we charge you with 10$/hour, totally 16.735,-- UptimeField ... 785 d 10:30:15 is the uptime of this server (last restarted more than 2 years ago) TimestampField ... it happend at 2007-03-28 14:50:15 (but it is stored as Unix time - seconds from Epoch) The UptimeField is most close to timesince filter, but in reality it is incompatible too, not mentioning the problems with input .... I will face such data more often now, so I will try to make such xxxxField by myself and somehow incorporate it to Djando model .... If I do it well, I will contribute it back ;-) Is there a way how to extend it externally, or I have to hack /django/db/models/fields/__init__.py directly ? -- Zdravi Gilhad [EMAIL PROTECTED] --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---