[marinemap] push by sfletche - this should be the last m2m save tweak... on 2011-10-06 21:45 GMT

0 views
Skip to first unread message

mari...@googlecode.com

unread,
Oct 6, 2011, 5:46:02 PM10/6/11
to marinema...@googlegroups.com
Revision: ec539c2c9334
Author: sfle...@gmail.com
Date: Thu Oct 6 14:47:22 2011
Log: this should be the last m2m save tweak...
http://code.google.com/p/marinemap/source/detail?r=ec539c2c9334

Modified:
/lingcod/analysistools/models.py
/lingcod/features/models.py

=======================================
--- /lingcod/analysistools/models.py Wed Oct 5 15:29:46 2011
+++ /lingcod/analysistools/models.py Thu Oct 6 14:47:22 2011
@@ -130,8 +130,9 @@
keyword argument error during call to super.save
Note on rerun: When set to false no output fields will be cleared and
the run method will not be called
Note on form: This is passed from feature.views update and create
methods. In the case of m2m fields this needs to
- be called after super.save. Since it also needs to be called before
self.run, it needs to be called here in this
- save method rather than its previous location in feature views update
and create (after save has completed)
+ be called after super.save. Since it also needs to be called before
self.run, it will be passed from here (in kwargs)
+ to the superclass (Feature) save method.
+ (rather than its previous location in feature views update and create
(after save has completed))
'''
def save(self, rerun=True, *args, **kwargs):
if rerun:
=======================================
--- /lingcod/features/models.py Wed Oct 5 15:29:46 2011
+++ /lingcod/features/models.py Thu Oct 6 14:47:22 2011
@@ -65,9 +65,9 @@
superfluous here.)
'''
def save(self, rerun=True, form=None, *args, **kwargs):
+ super(Feature, self).save(*args, **kwargs) # Call the "real"
save() method
if form is not None:
form.save_m2m()
- super(Feature, self).save(*args, **kwargs) # Call the "real"
save() method

@models.permalink
def get_absolute_url(self):

Reply all
Reply to author
Forward
0 new messages