Re: pickling and unpickling a model field

2007-12-16 Thread [EMAIL PROTECTED]
Fixed, to get the code see http://www.djangosnippets.org/snippets/513/ Enjoy! On Dec 13, 9:04 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > OK, you're spot on there. That'll teach me to evan glance at my own > code before posting my cries for help! (And thanks for the tip about > get_inte

Re: pickling and unpickling a model field

2007-12-13 Thread [EMAIL PROTECTED]
OK, you're spot on there. That'll teach me to evan glance at my own code before posting my cries for help! (And thanks for the tip about get_internal_type) Anyway, now I think I have what is needed, but now I get the following traceback:- Traceback (most recent call last): File "", line 1, in

Re: pickling and unpickling a model field

2007-12-13 Thread Marty Alchin
On Dec 13, 2007 3:11 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Heh, I just picked this up, too! I got the field working almost > straight away after your kind help (all apart from queries, which I > haven't fixed yet as I've been traveling up until this evening) Glad to hear you're makin

Re: pickling and unpickling a model field

2007-12-13 Thread [EMAIL PROTECTED]
Oh, I also tried using __setattr__ and __getattribute__ to solve this, but the problem is that Django's ORM will just (unintentionally) call __getattribute__ when generating the SQL, thereby unpickling the object again, which will of course raise a SQL error and defeat the entire purpose. To see

Re: pickling and unpickling a model field

2007-12-13 Thread [EMAIL PROTECTED]
Heh, I just picked this up, too! I got the field working almost straight away after your kind help (all apart from queries, which I haven't fixed yet as I've been traveling up until this evening) Anyway, what I have is http://dpaste.com/27955/ which seems to work fine, all apart from the issue I

Re: pickling and unpickling a model field

2007-12-13 Thread Marty Alchin
Ken, There was someone else working on this recently as well, so you might take a look at the conversation,[1] the beginnings of the code,[2] and probably contact the author directly to see if you two can't share ideas. It'd be a shame to duplicate effort. It'd be a great candidate for a snippet.

pickling and unpickling a model field

2007-12-13 Thread Ken
Does anyone have an example on how to sub-class a model field so that setattr pickles the field and getattr unpickles it? I want to shuffle a query back and forth between the app and the rendered pages. I could urlencode the query but the URL could get potentially rather long so I thought I'd sh