Comments (3)
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.5admin.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.7settings.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.
from django-pyodbc.
So this feature is not usable with sqlserver?
from django-pyodbc.
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.
from django-pyodbc.
Related Issues (20)
- aggregate_select() removed in Django 1.10 HOT 2
- OpenEdge support not working in master. Some basic fixes here
- django.core.exceptions.ImproperlyConfigured: Django 1.11 is not supported. HOT 4
- as_sql() got an unexpected keyword argument 'subquery' HOT 5
- Please update for Django 1.11.1 HOT 5
- Conversion failed when converting date and/or time from character string. HOT 2
- pyodbc.DataError: Conversion failed when converting da te and/or time from character string HOT 1
- SchemaEditor error HOT 1
- unixODBC config files HOT 1
- Using for dbf files HOT 1
- Django 2.0 Alpha inspectdb command fails
- django-pyodbc query with OFFSET+LIMIT issue
- Active maintainer needed HOT 9
- No default encoding (2.0.0a1) HOT 3
- Error: SchemaEditorClass HOT 1
- Different schemas in models.py HOT 1
- django odbc connection to production SQL server 2014 from windows machine HOT 1
- Help in setting up connection with load balancer HOT 1
- Sql server 2019 connection string issue from django project HOT 1
- Database error conection using django-pyodbc to connect to SQL Server 2019 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-pyodbc.