question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow user to pass mongo models file name instead of assuming models.py

See original GitHub issue

in 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:open
  • Created 7 years ago
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
devinbarrycommented, May 2, 2017

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

1reaction
pydannycommented, Mar 24, 2017

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.

😄

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found