Giter Club home page Giter Club logo

Comments (8)

last-partizan avatar last-partizan commented on June 12, 2024

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.

mwjackson avatar mwjackson commented on June 12, 2024

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.

last-partizan avatar last-partizan commented on June 12, 2024

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.

mwjackson avatar mwjackson commented on June 12, 2024

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.

mwjackson avatar mwjackson commented on June 12, 2024

Did you investigate writing your own django db backend (similar to nonrel/mongodb-engine) that just maps to mongoengine queries?

from django-mongoengine.

last-partizan avatar last-partizan commented on June 12, 2024

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.

mwjackson avatar mwjackson commented on June 12, 2024

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.

last-partizan avatar last-partizan commented on June 12, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.