ds99 wrote:
> Hi,
> I am using django with postgres as backend. Some of the fields in the
> table are of type "bytea"(bytearray). Which django fields should I use
> while defining a model for such tables?
> 
> for eg: To access "boolean" we use BooleanField while modelling. I
> want to know how to access "bytea" type using django.
> 

Unfortunately django doesn't presently support postgres' bytea out of
box.  There is a patch in the tracker, though I don't know if it works
with recent django:
http://code.djangoproject.com/ticket/2417

One workaround for storing chunks of binary data is base64 encoding into
a text field, but that doesn't help you if you're trying to wrap an
existing postgresql database that happens to use bytea, and is not
exactly a high-performance solution (the better data integrity over fs
and ease of manipulation* might be worth it for you though, and
postgresql  text (and bytea) fields work without problem to quite large
sizes (1GB))

* The "X-SendFile" API can allow you to use django-level code to
determine permissioning for filesystem files served through the
webserver though.










--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to