#16889: Extra method containing %... ----------------------+------------------------------- Reporter: Stephane | Owner: nobody Type: Bug | Status: new Milestone: | Component: Uncategorized Version: 1.3 | Severity: Normal Keywords: | Triage Stage: Unreviewed Has patch: 0 | Easy pickings: 0 UI/UX: 0 | ----------------------+------------------------------- I would like to use the MySQL function DATE_FORMAT in Django 1.3.1.
This syntax is the most logical, but does not work: {{{Upload.objects.extra(select={'year': "DATE_FORMAT(`date_uploaded`, '%Y')"})}}} But this works: {{{Upload.objects.extra(select={'year': "%s"}, select_params=["DATE_FORMAT(`date_uploaded`, '%Y')"])}}} Is this a normal situation? Best regards, Stéphane -- Ticket URL: <https://code.djangoproject.com/ticket/16889> 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 post to this group, send email to django-updates@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.