Can you declare a ReferenceField with type of the class itself?

362 views
Skip to first unread message

Wangxy

unread,
Apr 8, 2013, 11:21:34 PM4/8/13
to mongoeng...@googlegroups.com
The code below shows what I'm trying to do.

class Member(Document):
    followers = ListField(ReferenceField(Member))


Ross Lawley

unread,
Apr 10, 2013, 7:07:05 AM4/10/13
to mongoeng...@googlegroups.com
Hi,


class Member(Document):
    followers = ListField(ReferenceField('self'))

Ross




--
You received this message because you are subscribed to the Google Groups "MongoEngine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongoengine-us...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Arthur Wang

unread,
Apr 10, 2013, 7:10:22 AM4/10/13
to mongoeng...@googlegroups.com
That's it! Thanks Ross!
You received this message because you are subscribed to a topic in the Google Groups "MongoEngine Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mongoengine-users/kCIYp7PUdFA/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to mongoengine-us...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 


--
Arthur Wang
Reply all
Reply to author
Forward
0 new messages