Opened 8 years ago

Closed 8 years ago

#7860 closed (duplicate)

db backends supports usecs feature in get_db_prep_lookup

Reported by: wei guangjing Owned by: nobody
Component: Database layer (models, ORM) Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

The supports usecs feature not use in DateTimeField get_db_prep_lookp, so Datetime lookup will fail use MS SQL Server backend.
For example:

s = Session.objects.get(
                session_key = self.session_key,
                expire_date__gt=datetime.datetime.now()
            )

Attachments (1)

fix_supports_usecs.diff (2.4 KB) - added by wei guangjing 8 years ago.
fix supports usecs in DatetimeField, DateField, TimeField in get_db_prep_lookup

Download all attachments as: .zip

Change History (6)

Changed 8 years ago by wei guangjing

Attachment: fix_supports_usecs.diff added

fix supports usecs in DatetimeField, DateField, TimeField in get_db_prep_lookup

comment:1 Changed 8 years ago by Adam Vandenberg

There is no built-in SQL Server backend (anymore); if you could log a bug with a repro case against the specific backend (django-pyodbc, django-mssql, etc.) that would be greatly appreciated (by the maintainers of those projects.)

comment:2 Changed 8 years ago by Alex Gaynor

I believe wgj is referring to an external backend.

comment:3 Changed 8 years ago by Ramiro Morales

This would be solved in a more clean and generic way by #7560 that is targeted at the 1.0 beta.

(The addition of the supports_usecs feature was part of #7420 that was partially applied in [7643], the intent was coincidentally facilitate the creation of an external MS SQL Server backend. But the feature wouldn't be needed anymore once #7560 lands.)

comment:4 Changed 8 years ago by Adam Vandenberg

Very much +1 for #7560 (as I maintain the django-mssql backend...)

comment:5 Changed 8 years ago by Malcolm Tredinnick

Resolution: duplicate
Status: newclosed

Yes, #7560 is the way we're going. I'm going to close this one as a "duplicate" of that (since there's not a "better solved by..." resolution).

Note: See TracTickets for help on using tickets.
Back to Top