Giter Site home page Giter Site logo

Comments (7)

garrypolley avatar garrypolley commented on June 11, 2024

Thanks for the suggestion @foxx

Have you looked into making https://github.com/MongoEngine/django-mongoengine/tree/master better support Django + Mongo?

from django-mongoengine.

foxx avatar foxx commented on June 11, 2024

I'd had a look a few months ago, but wasn't keen on the approach used, and ended up making my own lightweight version as linked.

For example, handling setup/teardown of unittest data is done inside MongoTestCase, but this isn't the best way of doing things. It requires the user to inherit their unit test directly from that class, which is an unclean pattern. It would be slightly better if it worked as a mix-in, which would most likely need to contain some nasty MRO magic, but even then it still wouldn't be a great approach, for much the same reasons.

This also requires you to use MONGODB_DATABASES rather than just specifying the database inside DATABASES with a mongoengine engine string, which again feels unclean.

Both of these features could probably be merged without too much problem, although it would require a lot of testing as monkey patching could cause some weird edge cases. These changes would, naturally, be backwards incompatible for most people too.

I'm not sure if it would break the other elements such as forms/admin, I personally have no use for them as all my use cases for Mongo involve multi layer documents. The forms abstraction for Django is just not designed well for deep document resources, even with the support of EmbeddedFormField (in my own opinion), but this is a design fault with Django, not django-mongoengine.

from django-mongoengine.

argoyal avatar argoyal commented on June 11, 2024

@foxx : We can use https://github.com/hspandher/django-test-addons which provides the setup and teardown functionality after run of each test case.

I also have concern here, How are we running the test cases here? I am trying to use pytest, will it be usable?

from django-mongoengine.

qwiglydee avatar qwiglydee commented on June 11, 2024

So far, @foxx killed his repository.
Is the functionality merged into this project?

from django-mongoengine.

foxx avatar foxx commented on June 11, 2024

I have since stopped using Django, as I now consider it broken by design. The repo itself was killed because of backwards incompatible changes after the last Django release. I can dig out the code from archive if needed, but it's probably better to do it again from scratch.

from django-mongoengine.

qwiglydee avatar qwiglydee commented on June 11, 2024

@foxx your blog post "42 awesome tools for programmers" does not mention django in section "Things to avoid". Wouldn't you write something about why django is broken and what do you use instead?

from django-mongoengine.

foxx avatar foxx commented on June 11, 2024

@qwiglydee I've got something coming out soon that tackles this very topic, stay tuned :)

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.