Self Reference Issues with PyAMF 0.4.2 and Django

View: New views
2 Messages — Rating Filter:   Alert me  

Self Reference Issues with PyAMF 0.4.2 and Django

by Mayeul Rousselet-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I encounter the following issue :
In Django, I have a File model which reference itself :

class File(models.Model):
     ...
     parent = models.ForeignKey('self',null=True,blank=True)
     ....

I try to send two File instance to Flex with the relationnships:
parent = File(name="Parent")
child = File(name="Child",parent=parent)

When I retrieve my File objects in Flex, the self references are wrong:
child.parent has a different memory address (therefore is a different object) than parent

Any idea?

thank you very much

Mayeul

_______________________________________________
PyAMF users mailing list - users@...
http://lists.pyamf.org/mailman/listinfo/users

Re: Self Reference Issues with PyAMF 0.4.2 and Django

by lists-144 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Mayeul,

could you create a ticket for this? You'll need to register for an account first at http://pyamf.org/register

Including a test flex/django app would be very useful.

Cheers,

Thijs

On 19 May 2009, at 23:30, Mayeul Rousselet wrote:

Hi,

I encounter the following issue :
In Django, I have a File model which reference itself :

class File(models.Model):
     ...
     parent = models.ForeignKey('self',null=True,blank=True)
     ....

I try to send two File instance to Flex with the relationnships:
parent = File(name="Parent")
child = File(name="Child",parent=parent)

When I retrieve my File objects in Flex, the self references are wrong:
child.parent has a different memory address (therefore is a different object) than parent

Any idea?

thank you very much

Mayeul
_______________________________________________
PyAMF users mailing list - users@...
http://lists.pyamf.org/mailman/listinfo/users



_______________________________________________
PyAMF users mailing list - users@...
http://lists.pyamf.org/mailman/listinfo/users

PGP.sig (201 bytes) Download Attachment