Re: An idea for Q filter objects

2016-03-30 Thread Stephen J. Butler
I guess you could! I'm not as familiar with the Transforms API, but it looks like it would work too. On Wed, Mar 30, 2016 at 6:17 PM, Shai Berger wrote: > On Tuesday 29 March 2016 05:07:14 Stephen J. Butler wrote: > > Why not do this in the database? Create a view with an extra column that > is

Re: An idea for Q filter objects

2016-03-30 Thread Shai Berger
On Tuesday 29 March 2016 05:07:14 Stephen J. Butler wrote: > Why not do this in the database? Create a view with an extra column that is > called "field_dttxt" that is to_char(field, 'Mon DD, '). Then add this > as a field to Django and let it use the normal Q lookups. > Why would you need to

Re: An idea for Q filter objects

2016-03-28 Thread Stephen J. Butler
Why not do this in the database? Create a view with an extra column that is called "field_dttxt" that is to_char(field, 'Mon DD, '). Then add this as a field to Django and let it use the normal Q lookups. On Mon, Mar 28, 2016 at 5:13 PM, Michael E wrote: > I don't know if this is possible, b

Re: An idea for Q filter objects

2016-03-28 Thread Tim Graham
I think the issue would be fixed by tackling the ticket, "Get rid of field.get_db_prep_lookup()" [0]. If I understand correctly, the exception is coming from DateField.get_db_prep_value() which is trying to do the conversion to a datetime. [0] https://code.djangoproject.com/ticket/22936 On Mon

An idea for Q filter objects

2016-03-28 Thread Michael E
I don't know if this is possible, but I think it would highly useful if it were. Basically, I want to filter a DateField as though it were a string (see the StackOverflow post to understand why) I