Open luisfmelo opened 5 years ago
There is no way to have a schema-less model in djongo.
Hello,You can set the enforce_schema propertie to True in the database settings Le 8 juin 2019 21:20, Luís Melo notifications@github.com a écrit :One line description of the issue I want to have shcema-less models. Python script So, my Blog model s defined as:
class Blog(models.Model): name = models.CharField(max_length=100) tagline = models.TextField()
objects = models.DjongoManager()
And I want to create a Blog instance with an extra field named author: blog = Blog( name='Hello MongoDB!', tagline='Just wanted to drop a note from Django. Cya!', author='mongodb' )
But when I try, I see: Blog() got an unexpected keyword argument 'author'
—You are receiving this because you are subscribed to this thread.Reply to this email directly, view it on GitHub, or mute the thread.
One line description of the issue
I want to have shcema-less models.
Python script
So, my Blog model s defined as:
class Blog(models.Model): name = models.CharField(max_length=100) tagline = models.TextField() objects = models.DjongoManager()
And I want to create a Blog instance with an extra field named author:
blog = Blog( name='Hello MongoDB!', tagline='Just wanted to drop a note from Django. Cya!', author='mongodb' )
But when I try, I see: Blog() got an unexpected keyword argument 'author'
Try:
blog = Blog.objects.mongo_insert_one({'name': 'Hello MongoDB!', 'tagline': 'Just wanted to drop a note from Django. Cya!', 'author': 'mongodb'})
It tunnels directly through pymongo
module and inserts a schema less document.
One line description of the issue
I want to have shcema-less models.
Python script
So, my Blog model s defined as:
And I want to create a Blog instance with an extra field named author:
But when I try, I see: Blog() got an unexpected keyword argument 'author'