Allow user to pass mongo models file name instead of assuming models.py
See original GitHub issuein mongonaut/mixins.py Line #87
self.models_name = self.kwargs.get('models_name', 'models')
I have mongo models in mongomodels.py and SQL models in models.py. so this is not working for me because it try to find mongomodels in models.py
I changed this line and replaced models with mongomodels
self.models_name = self.kwargs.get('models_name', 'mongomodels')
Now I’m able to open page. earlier i was getting the error AttributeError: ‘module’ object has no attribute ‘<MyMongoModel>’.
So I was wondering if there is any way to directly provide mongo models file name in settings or somewhere else.
Issue Analytics
- State:
- Created 7 years ago
- Comments:11 (2 by maintainers)
Top Results From Across the Web
Why does mongoose always add an s to the end of my ...
What mongoose do is that, When no collection argument is passed, Mongoose produces a collection name by pluralizing the model name. If you...
Read more >linkedin-skill-assessments-quizzes/mongodb-quiz.md at main
Assuming you have customers collection with a firstName and lastName field, which is the correct MongoDB shell command to create an index on...
Read more >Configuration File Options — MongoDB Manual
Allows users to specify a shell or terminal command as the external source for configuration file options or the full configuration file.
Read more >How to use Django with MongoDB by adding just one line of ...
To use MongoDB as your backend database in your Django project, just add this one line into your settings.py file:
Read more >Model Meta options - Django documentation
The name of the database table to use for the model: ... contains characters that aren't allowed in Python variable names – notably,...
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 Free
Top 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
I have done some work on the tests in my fork. I have almost all the tests working now. I have also fixed a RuntimeError that exists in the code. Hopefully soon I will be able to make a merge request
Seeing a major release happen for this library would be awesome! @devinbarry, when you are ready, let us know and we’ll merge it in. Then myself or another Jazzband member will put it up on PyPI.
😄