Re: DateTimeField always returns None

2014-07-08 Thread William Granli
Changing the name of 'date' did not fix the issue. I have ended up changing the database field from DATETIME to TEXTFIELD. Not a good fix, but since there seems to be no clear solution to this I went ahead. It works at least. I have tried the Q-based queries too, by the way. (And other ways o

Re: DateTimeField always returns None

2014-07-06 Thread Russell Keith-Magee
Date isn't *disallowed* as a field name: http://dev.mysql.com/doc/refman/5.5/en/reserved-words.html#table-reserved-words-new-5.5 As long as it's quoted, it's an allowed name. However, it's *really* not recommended. This isn't for database related reasons - it's the Python side that is problemat

Re: DateTimeField always returns None

2014-07-05 Thread Dean
I think there is a restriction in using 'date' in MySQL as a field name as it's some sort of inbuilt function. On Friday, July 4, 2014 5:01:15 PM UTC+8, William Granli wrote: > > I am trying to create a queryset for getting the values of a DateTimeField > which is DATETIME in the DB. > > The cl

Re: DateTimeField always returns None

2014-07-04 Thread Tom Evans
On Fri, Jul 4, 2014 at 10:01 AM, William Granli wrote: > I am trying to create a queryset for getting the values of a DateTimeField > which is DATETIME in the DB. > > The class in models.py: > > class ChangeMetrics(models.Model): > id = models.IntegerField(primary_key=True) > file_id = mod

Re: DateTimeField always returns None

2014-07-04 Thread trustedbox
Are you sure you're using the same DB ? Test it by adding new record and instantly retrieve it. пятница, 4 июля 2014 г., 12:01:15 UTC+3 пользователь William Granli написал: > > I am trying to create a queryset for getting the values of a DateTimeField > which is DATETIME in the DB. > > The class

DateTimeField always returns None

2014-07-04 Thread William Granli
I am trying to create a queryset for getting the values of a DateTimeField which is DATETIME in the DB. The class in models.py: class ChangeMetrics(models.Model): id = models.IntegerField(primary_key=True) file_id = models.ForeignKey(File, db_column = 'file_id') version_id = models