octabytes / FireO

Google Cloud Firestore modern and simplest convenient ORM package in Python. FireO is specifically designed for the Google's Firestore
https://fireo.octabyte.io
Apache License 2.0
247 stars 29 forks source link

Fireo models reference each other #130

Closed R4Ajeti closed 2 years ago

R4Ajeti commented 2 years ago

Hi, How can i do this in fireo?

class Game(models.Model):

Other fields...

on = models.ForeignKey('Member', blank = True)

class Member(models.Model):

Other fields...

game = models.ForeignKey(Game)

thank you

AxeemHaider commented 2 years ago

There is no field with the name of ForeignKey but ReferenceField You can reference other documents using this field. But referencing each other document is bit difficult you can do it with out create the first document. How you can reference a document which is not exist. Might be it is possible if you already know the id of the document.