diff options
| author | Karen Tracey <kmtracey@gmail.com> | 2009-02-08 05:08:06 +0000 |
|---|---|---|
| committer | Karen Tracey <kmtracey@gmail.com> | 2009-02-08 05:08:06 +0000 |
| commit | addd3df3bd39730cd82c52d9726c9b7dbf1bdb8f (patch) | |
| tree | e648cbb129dfd103af1d278aaafc0a7007ce95ea /django/db/backends/sqlite3/base.py | |
| parent | 0326574d0ecf2eeded92d66855822dd2e602297f (diff) | |
Fixed #7672 -- Added a 'week_day' lookup type. Many thanks to Ross Poulton for the proposal and implementation on all built-in database backends..
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9818 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/db/backends/sqlite3/base.py')
| -rw-r--r-- | django/db/backends/sqlite3/base.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/django/db/backends/sqlite3/base.py b/django/db/backends/sqlite3/base.py index 071d421b58..ba0ef16b61 100644 --- a/django/db/backends/sqlite3/base.py +++ b/django/db/backends/sqlite3/base.py @@ -207,7 +207,10 @@ def _sqlite_extract(lookup_type, dt): dt = util.typecast_timestamp(dt) except (ValueError, TypeError): return None - return unicode(getattr(dt, lookup_type)) + if lookup_type == 'week_day': + return unicode((dt.isoweekday() % 7) + 1) + else: + return unicode(getattr(dt, lookup_type)) def _sqlite_date_trunc(lookup_type, dt): try: |
