TralahM / django-firebase-orm

Django ORM for the NoSQL object model database, firebase
GNU General Public License v3.0
23 stars 6 forks source link

django-firebase-orm 0.6.1 test #7

Open MrAch26 opened 3 years ago

MrAch26 commented 3 years ago

Hi I am trying to use the package but not quite sure that I am using it well... I have configured FIREBASE_ORM_CERTIFICATE and FIREBASE_ORM_BUCKET_NAME correctly but when I'm trying to use it in models and then python manage.py makemigrations nothing happened.... Do I need to use Firebase.ORM.models instead of django.db.models ? Or simply create another models.py ? Do I need to create the collections in firestore before creating it ? Do I need to change something with the database settings ? I hope what I am saying make sense I believe I am still a beginner in Django Thanks a lot in advance for the help Best Daniel

issue-label-bot[bot] commented 3 years ago

Issue-Label Bot is automatically applying the label question to this issue, with a confidence of 0.75. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

TralahM commented 3 years ago

You need to inherit from firebase_orm.models

TralahM commented 3 years ago

Calling save on the object should create it in firestore

python manage.py makemigrations does nothing... database migrations are only relevant for sql databases

MrAch26 commented 3 years ago

Ok this is my model :

class Customer(models.Model):
    name = models.TextField()
    type_customer = models.TextField(db_column='type')

    class Meta:
        db_table = 'medications'

and the object i created is `Customer(name='daniel')

when i do a.save() i get this error -->

Screen Shot 2020-12-17 at 11 14 42