Call SQL function within Model

8 views
Skip to first unread message

Naoko Reeves

unread,
Jun 27, 2011, 6:53:39 PM6/27/11
to django...@googlegroups.com
Dear Experts,
I am using postgresql and have field type bytea.
This is an encrypted field
I normally decrypt value with sql function.
I would like to use this function to return value from Django model.
Is this possible? If so could you guide me how could I accomplish this?

Thank you very much for your time in advance.
Naoko

Martin J. Laubach

unread,
Jun 28, 2011, 5:40:52 AM6/28/11
to django...@googlegroups.com
  You probably want to use something like

    https://docs.djangoproject.com/en/1.3/ref/models/querysets/#extra

  to add custom sql expressions to your querysets.

        mjl

Reply all
Reply to author
Forward
0 new messages