Tuesday, March 21, 2017

Django admin custom filter: ProgrammingError: more than one row returned by a subquery used as an expression

Hi, I'm trying this custom filter query for django admin

return queryset.extra(select = {'val': "select id from web_quote WHERE character_length(quote_text) < 30"})

and I got something like this:

Programming error: more than one row returned by a subquery used as an expression

Basically I'm trying to filter quote_text column which length of the string less than 30...

Any ideas?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/ea29c677-f6aa-4a62-94fe-261dbadf9f33%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment