Opened 7 years ago

Closed 7 years ago

#7860 closed (duplicate)

db backends supports usecs feature in get_db_prep_lookup

Reported by: wgj 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 wgj 7 years ago.
fix supports usecs in DatetimeField, DateField, TimeField in get_db_prep_lookup

Download all attachments as: .zip

Change History (6)

Changed 7 years ago by wgj

fix supports usecs in DatetimeField, DateField, TimeField in get_db_prep_lookup

comment:1 Changed 7 years ago by adamv

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

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 7 years ago by Alex

I believe wgj is referring to an external backend.

comment:3 Changed 7 years ago by ramiro

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 7 years ago by adamv

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

comment:5 Changed 7 years ago by mtredinnick

  • Resolution set to duplicate
  • Status changed from new to closed

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