Comments (4)
I've forked this project and released django-mongoengine-forms on PyPI. I've stripped out a lot of the legacy stuff and it should be compatible with Django 1.9.
If you find any issues I'd be very happy to hear them.
from django-mongodbforms.
nice @thomwiggers ! I was implementing the 1.9 compats but I'm gonna try to use your fork. We've developed a few useful features and fixes on our side, I might to a PR on your repo :)
from django-mongodbforms.
Following patch fixes a missing attribute new_objects error with django 1.8.8; I wrong put this into django-mongoadmin issues :( mea maxima culpa
diff --git a/mongodbforms/documents.py b/mongodbforms/documents.py
index 0a432a8..0397c2d 100644
--- a/mongodbforms/documents.py
+++ b/mongodbforms/documents.py
....... see below for structure version :(
saved.append(obj)
from django-mongodbforms.
sorry that looks awful; I'm not a git person obviously :(, but maybe an old git :)
diff --git a/mongodbforms/documents.py b/mongodbforms/documents.py
index 0a432a8..0397c2d 100644
--- a/mongodbforms/documents.py
+++ b/mongodbforms/documents.py
@@ -703,9 +703,16 @@ class BaseDocumentFormSet(BaseFormSet):
Saves model instances for every form, adding and changing instances
as necessary, and returns the list of instances.
"""
+
saved = []
+ self.new_objects = []
+ self.changed_objects = []
+ self.deleted_objects = []
+
for form in self.forms:
- if not form.has_changed() and form not in self.initial_forms:
+ changed = form.has_changed()
+ new = form not in self.initial_forms
+ if not changed and new:
continue
obj = self.save_object(form)
if form.cleaned_data.get("DELETE", False):
@@ -715,6 +722,11 @@ class BaseDocumentFormSet(BaseFormSet):
# if it has no delete method it is an embedded object. We
# just don't add to the list and it's gone. Cool huh?
continue
+ self.deleted_objects.append(obj)
+ elif new:
+ self.new_objects.append(obj)
+ elif changed:
+ self.changed_objects.append(obj)
if commit:
obj.save()
saved.append(obj)```
from django-mongodbforms.
Related Issues (20)
- Error when trying to create form from Custom User Model HOT 1
- Problem with MapWidget
- DocumentForm metaclass creates connection too early HOT 1
- Documents _post_clean() does not handle None to EMPTY_VALUES conversion gracefully HOT 1
- DocumentForm save error: object has no attribute 'cleaned_data'
- UnboundLocalError in documents.py at line 919
- instance doesn't create an edit form HOT 1
- Changing labels and help text
- Django 1.7 support HOT 4
- DocumentFormSet modification leads to NotUniqueError HOT 1
- "if we didn't get an instance, instantiate a new one"
- type object 'ListWidget' has no attribute 'attrs' HOT 1
- AttributeError: 'object' object has no attribute '__getitem__'
- Localization for DocumentForm
- URL Homepage gives error 500 HOT 1
- New release HOT 2
- ListWidget with more capabilities: add/remove/modification HOT 1
- verbose_name_plural can't define in document meta
- ImportError: cannot import name get_declared_fields HOT 1
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-mongodbforms.