Re: How are you storing binary data in db

2008-03-28 Thread Ned Batchelder
Where we store pickles in the database, we use a TextField, then compress and base64-encode the data: class BlobbyRecord(models.Model): blob = modelsTextField() ... bin = pickle.dumps(my_data, 0) blobby = BlobbyRecord(blob=zlib.compress(bin).encode('base64'))

Re: How are you storing binary data in db

2008-03-28 Thread shabda
Yes I was looking for snippets and recipes, not storing them in DB. There are some instances when storing things in DB is just too convinient comaring to storing them on files. For example I get some JSON from a external web service call. I want to cache it in the system, so I want to just pickle

Re: How are you storing binary data in db

2008-03-27 Thread Rishabh Manocha
I think he meant recipes in that are there any recipes to accomplish this (storing binary data to the DB). Unless I'm getting this completely wrong, he was not talking about cooking recipes :). I would be interested in a solution for this too. There are cases where apps running as the apache/web

Re: How are you storing binary data in db

2008-03-27 Thread Dan Ellis
On Mar 27, 9:05 pm, Mike H <[EMAIL PROTECTED]> wrote: > Reading large > chunks of file data from a db just wastes db resources A recipe is unlikely to be a large chunk of file data. Pictures of food, sure, don't store those in the DB. Storing the text in the DB also means you can make use of

Re: How are you storing binary data in db

2008-03-27 Thread Mike H
On 27 Mar 2008, at 19:31, shabda wrote: > > Considering that BlobField is not supported, what are you using to > store binary data. Recipes, snippets .. In all cases, whether it's a binary file uploaded by the user or a binary file generated by the application, I store it in a file on disk

Re: How are you storing binary data in db

2008-03-27 Thread Dan Ellis
On Mar 27, 7:31 pm, shabda <[EMAIL PROTECTED]> wrote: > Considering that BlobField is not supported, what are you using to > store binary data. Recipes, snippets .. But these aren't binary data; they're text, so why not use a TextField? --~--~-~--~~~---~--~~ You

How are you storing binary data in db

2008-03-27 Thread shabda
Considering that BlobField is not supported, what are you using to store binary data. Recipes, snippets .. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to