On Apr 28, 7:02 pm, "Liubomir.Petrov" <liubomir.pet...@gmail.com>
wrote:
> Found it. It was my mistake using an custom class for grouping the
> data into the session.
> solved after adding this to the class definition:
>         def __getstate__(self):
>                 return [self.var1, self.var2]
>         def __setstate__(self, state):
>                 self.var1 = state[0]
>                 self.var2 = state[1]
>
> On Apr 28, 5:04 pm, "Liubomir.Petrov" <liubomir.pet...@gmail.com>
> wrote:
>
> > Note: I didnt tested with django.core.serializers, because as it seems
> > they only serialize a result from queryset and i need a simple row
> > like:
>
> > class Root(models.Model):
> >      pass # example only
> > class Child(Models.model):
> >      child = models.ForeignKey(Root)
> > .. So Root is saved in the session but his childs are not. The weird
> > thing is that, when working normally everything is returned right
> > (with child's), but when i load the session with SessionStore(key=etc)
> > they are not.
> > I'd debugged and it seems that the childs are not saved into the
> > django_sessions row.
>
> > Any ideas?
>
> > On Apr 28, 5:01 pm, Lyubomir Petrov <liubomir.pet...@gmail.com> wrote:
>
> > > Trying to store a (non saved - temporary) model (with relations) into
> > > django.contrib.session (backend - db).
> > > Seems that the relations are cleared and returned empty. Any better
> > > ways for doing this ?
>
> > > Best regards,
> > > Lyubomir Petrov
--~--~---------~--~----~------------~-------~--~----~
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