#24194: Oracle Backend Oprations
----------------------------------------------+--------------------
Reporter: kl4us | Owner: nobody
Type: Bug | Status: new
Component: Database layer (models, ORM) | Version: 1.7
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------------------+--------------------
My Object have a filed named timestamp:
{{{
timestamp = models.DateTimeField(auto_now_add=True)
}}}
When I use a function like:
{{{
from django.db import connection
extract_hour = connection.ops.datetime_trunc_sql('hh24','timestamp', None)
# None because USE_TZ = False
startdate = datetime.datetime.now() - datetime.timedelta(days=1)
MyObject.objects.filter(timestamp__gt=startdate).extra({'hour':extract_hour}).values("hour",
"status").annotate(Count('pk')).order_by('hour')
}}}
the result error is:
'''DatabaseError: ORA-00907: missing right parenthesis'''
I'm using django 1.7.3 and python 2.7.
--
Ticket URL: <https://code.djangoproject.com/ticket/24194>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/048.49dc87a295be7c57e37e0c9db326f73c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.