Self referencing model
See original GitHub issueHello and thx for your lib,
I’d like to self-reference a model, but I’m not sure how to do it as I’m quite new to Python, what I do is:
class Player(Document):
created_on = DateTimeField(default=datetime.now, db_field='d')
name = StringField(required=True, db_field='n')
Player.friends = ListField(ReferenceField(Player))
But I get an AttributeError: 'NoneType' object has no attribute '_type'
in python3.6/site-packages/graphene_mongo/converter.py
Am I doing it wrong or is it not possible?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:5
Top Results From Across the Web
Self-reference - Wikipedia
Self -reference occurs in natural or formal languages when a sentence, idea or formula refers to itself. The reference may be expressed either ......
Read more >Self-Reference - Stanford Encyclopedia of Philosophy
In the context of language, self-reference is used to denote a statement that refers to itself or its own referent. The most famous...
Read more >4. How to include a self-referencing ForeignKey in a model
Self -referencing foreign keys are used to model nested relationships or recursive relationships. They work similar to how One to Many relationships. But...
Read more >Django Models self reference - python - Stack Overflow
I need to build a Django Model in which it refers to itself (a list of the same Model type within each instance...
Read more >Different scenarios with Excel self referencing IF statements
Self referencing IF statements allow you to present the results of multiple scenarios regardless of the individual scenario being run in the model....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@mehdiym: It’s a good point!
Graphene-Mongo does not support list of self-reference yet, and I am working on it now. Hope I can get back to you soon.
Wow, you did it fast, thank you very much. I’ll try that soon (it’s a personal project on my spare time, for now anyway)