We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
when I'm using the date_hierarchy option to filter the change_list admin page for a model, the db-backend raises a NotImplementedError.
Request Method: GET Request URL: http://:/admin/// Django Version: 1.6 Exception Type: NotImplementedError Exception Location: //lib/python2.7/site-packages/django/db/backends/init.py in datetime_extract_sql, line 755 Python Executable: /usr/bin/python Python Version: 2.7.5
admin.py: class MyModelAdmin(admin.ModelAdmin): list_display = [ "", "", "date" ] list_filter = [ "date" ] date_hierarchy = "date" ordering = [ "-date" ]
admin.site.register(MyModel, MyModelAdmin)
Environment: Django==1.6 django-pyodbc==0.2.5 pyodbc==3.0.7
settings.py: DATABASES = { 'default': { 'ENGINE': 'django_pyodbc', 'USER': '<django_user>', 'PASSWORD': '', 'NAME': '<django_test>', 'OPTIONS': { 'dsn': '', 'encoding': 'utf-8', 'autocommit': True, } } }
When removing the line "date_hierarchy = "date"" everything works as expected.
The text was updated successfully, but these errors were encountered:
Its related to the fact that dates are not converted to datetime.date, but remain unicode.
On 05.11.2014 16:33, Gordon Schultz wrote:
Hi, when I'm using the date_hierarchy option to filter the change_list admin page for a model, the db-backend raises a NotImplementedError. Request Method: GET Request URL: http://:/admin/// Django Version: 1.6 Exception Type: NotImplementedError Exception Location: //lib/python2.7/site-packages/django/db/backends/init.py in datetime_extract_sql, line 755 Python Executable: /usr/bin/python Python Version: 2.7.5 admin.py: class MyModelAdmin(admin.ModelAdmin): list_display = [ "", "", "date" ] list_filter = [ "date" ] date_hierarchy = "date" ordering = [ "-date" ] admin.site.register(MyModel, MyModelAdmin) Environment: Django==1.6 django-pyodbc==0.2.5 pyodbc==3.0.7 settings.py: DATABASES = { 'default': { 'ENGINE': 'django_pyodbc', 'USER': '', 'PASSWORD': '', 'NAME': '', 'OPTIONS': { 'dsn': '', 'encoding': 'utf-8', 'autocommit': True, } } } When removing the line "date_hierarchy = "date"" everything works as expected. — Reply to this email directly or view it on GitHub #73.
settings.py: DATABASES = { 'default': { 'ENGINE': 'django_pyodbc', 'USER': '', 'PASSWORD': '', 'NAME': '', 'OPTIONS': { 'dsn': '', 'encoding': 'utf-8', 'autocommit': True, } } }
— Reply to this email directly or view it on GitHub #73.
Sorry, something went wrong.
So this feature is not usable with sqlserver?
No. I have been going arounf the problem so far by using haks like:
def extraInitForPeriod(*args, **kwargs): obj = kwargs.get('instance') if obj and obj.start_date: if isinstance(obj.start_date, basestring): obj.start_date = datetime.strptime( obj.start_date, '%Y-%m-%d').date()
But for date_herarchy a proper fix would be needed.
No branches or pull requests
Hi,
when I'm using the date_hierarchy option to filter the change_list admin page for a model, the db-backend raises a NotImplementedError.
Request Method: GET
Request URL: http://:/admin///
Django Version: 1.6
Exception Type: NotImplementedError
Exception Location: //lib/python2.7/site-packages/django/db/backends/init.py in datetime_extract_sql, line 755
Python Executable: /usr/bin/python
Python Version: 2.7.5
admin.py:
class MyModelAdmin(admin.ModelAdmin):
list_display = [ "", "", "date" ]
list_filter = [ "date" ]
date_hierarchy = "date"
ordering = [ "-date" ]
admin.site.register(MyModel, MyModelAdmin)
Environment:
Django==1.6
django-pyodbc==0.2.5
pyodbc==3.0.7
settings.py:
DATABASES = {
'default': {
'ENGINE': 'django_pyodbc',
'USER': '<django_user>',
'PASSWORD': '',
'NAME': '<django_test>',
'OPTIONS': {
'dsn': '',
'encoding': 'utf-8',
'autocommit': True,
}
}
}
When removing the line "date_hierarchy = "date"" everything works as expected.
The text was updated successfully, but these errors were encountered: