Comments (8)
What i learned: someone who decided to rewrite django.auth was crazy, django updated - everything broken (almost) and maybe monkey-patching was better idea.
Right now i try to monkey-patch everything with minimal rewriting. And your approach might be different depends on what apps you want yo use.
from django-mongoengine.
Well, we have a bunch of apps that we use such as django-allauth, django-organizations, user_sessions. I guess its not realistic to submit PR's to all of those libraries with mongoengine support, so the only alternative is to monkey patch them (or django's model system).
You said you were monkey patching everything, do you have any code that I could use as a starting point?
from django-mongoengine.
Basically i import django module, and then replace something not working with a fix using this: https://github.com/MongoEngine/django-mongoengine/search?utf8=%E2%9C%93&q=get_patched_django_module
But if don't think it's good idea to patch every app. Maybe you should take a look at django-mongodb-engine and django-nonrel.
from django-mongoengine.
We're currently using django-nonrel, which is no longer maintained (django 1.6 is the last release), hence why I'm looking at django-mongoengine.
I'll take a look at your code and see if there is a nice seam somewhere.
from django-mongoengine.
Did you investigate writing your own django db backend (similar to nonrel/mongodb-engine) that just maps to mongoengine queries?
from django-mongoengine.
I was thinking about it, that's bad idea - mongodb is different from relational databases, so not every query has a match. Probably - it will work for some simple cases, but can not ever transparent replace db layer for app written for relational db.
from django-mongoengine.
That's absolutely true. In practice this is how django-nonrel does it (plus ListField & DictField), and it seems to work quite well as long as long as you can do without the parts that don't match such as some aggregations and south etc
I looked at the monkey patching route and its not really workable (and not generally a nice idea for client apps as you suggested) so I don't know where to go now. Our options are
a) help with django-mongoengine and figure out some solution to integrating client applications, probably via a db backend.
b) fork nonrel and try to bring it up to date with django 1.9
Thoughts? Are you interested in a)?
from django-mongoengine.
db backend way requires heavy django patching. becouse if it does not, there would be only django-mongodb-engine
Maybe you can try to replace some modules with mongo-supported ones? like, sessions from this project.
I'm interested in everything that includes making django_mongoengine better, but i don't have much time to do it myself. So patches and pull-requests are welcome.
from django-mongoengine.
Related Issues (20)
- How does the Permission are automatically made in auth module? HOT 1
- get_deleted_objects needs to be changed for admin view HOT 1
- Appconfig models is empty OrderedDict HOT 4
- Too slow with >1K documents! HOT 2
- unable to createsuperuser HOT 1
- Sub query using mongoengine
- fixes for django:3.1 import FieldDoesNotExist
- FieldDoesNotExist import Exception HOT 1
- there are many RemovedInDjango40Warning warnings HOT 2
- something wrong with django_mongoengine/forms/document_options.py HOT 4
- mongo-admin from django_mongoengine not supporting FieldList. Throwing ValidationError for list HOT 3
- Cannot import EMPTY_CHANGELIST_VALUE in django VERSION = (3, 0, 8, 'final', 0) HOT 2
- Is this package still maintained? HOT 1
- Admin pagination seems to be off by one. HOT 2
- Do not recommend djongo in the readme. HOT 1
- Is this project alive? HOT 4
- UI issue HOT 2
- Using list in a "not_contains" query HOT 1
- ModuleNotFoundError: No module named 'typing_extensions' HOT 3
- '_thread._local' object has no attribute 'no_dereferencing_class' for simple querryset HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-mongoengine.