One advantage of the Python literal over pickles: in a pinch, you can 
use ad-hoc SQL queries to find stuff in Python literals, ugly as it is.  
With pickles, the data is completely opaque until unpickled.  I'm not 
saying you'd use WHERE python_literal LIKE '%image_type%' in production 
code, but when you're digging in the database forensically, it can be 
useful.

OTOH, pickling will be more compact, and safer, depending on how you 
reconstitute it...

--Ned.
http://nedbatchelder.com

Eric Abrahamsen wrote:
> On Oct 18, 2008, at 4:38 AM, timc3 wrote:
>
>   
>> Thanks for the help. Yeah, my terminology is quite often wrong, to
>> much context switching with other things.
>>
>> Unfortunately I am never sure what will go in to that field, just data
>> that's sourced from various types of media, and populated from another
>> system. I do know that it will almost always probably be in that
>> format though.
>>     
>
> Depending on what you're expecting to store, and how you're expecting  
> to use it, you can also pickle python objects and store them in the  
> database. From your example, it looks like you could associate a  
> dictionary of metadata with each model instance, pickle that  
> dictionary, and store the result in the database field. One more  
> option...
>
> E
>
>   
>> So I am going to try your method, I have thought to fix it properly I
>> should use a datatype within PostgreSQL that supports what I am trying
>> to do, but alas Django doesn't support it and neither does the other
>> application.
>>
>>     
>
>
> >
>
>
>   

-- 
Ned Batchelder, http://nedbatchelder.com


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to