[cig-commits] r14565 - cs/portal/trunk/northridge/SeismoWebPortal

leif at geodynamics.org leif at geodynamics.org
Wed Apr 1 19:30:26 PDT 2009


Author: leif
Date: 2009-04-01 19:30:25 -0700 (Wed, 01 Apr 2009)
New Revision: 14565

Modified:
   cs/portal/trunk/northridge/SeismoWebPortal/mezzanine.py
   cs/portal/trunk/northridge/SeismoWebPortal/models.py
Log:
Fixed bug where 3D models couldn't be renamed.  Turned 3D models into
ImmutableObjects.

The portal does not behave reasonably in the scenario where a linked
model (a 3D model referenced by URL) is changed behind the portal's
back.  (From a UI standpoint, I'm not even certain what the correct
behavior would be.)  In theory, the portal could check the HTTP
headers (ETag, Last-Modified, Content-Length); currently, it does not
do so.  Instead, it assumes that the model never changes.  Therefore,
the user must submit a new URL to use an updated model (which is at
least consistent with the workflow when uploading models).


Modified: cs/portal/trunk/northridge/SeismoWebPortal/mezzanine.py
===================================================================
--- cs/portal/trunk/northridge/SeismoWebPortal/mezzanine.py	2009-04-02 01:14:06 UTC (rev 14564)
+++ cs/portal/trunk/northridge/SeismoWebPortal/mezzanine.py	2009-04-02 02:30:25 UTC (rev 14565)
@@ -815,7 +815,10 @@
 
     def changeManipulator(self, user):
         object = self.obj
-        return self.Model.ChangeManipulator(getattr(object, object._meta.pk.attname), follow = dict(pathname = False))
+        return self.Model.ChangeManipulator(getattr(object, object._meta.pk.attname),
+                                            follow = dict(pathname = False,
+                                                          description = False,
+                                                          url = False))
 
     def downloadAsTarGz(self, request):
         from shutil import copyfileobj

Modified: cs/portal/trunk/northridge/SeismoWebPortal/models.py
===================================================================
--- cs/portal/trunk/northridge/SeismoWebPortal/models.py	2009-04-02 01:14:06 UTC (rev 14564)
+++ cs/portal/trunk/northridge/SeismoWebPortal/models.py	2009-04-02 02:30:25 UTC (rev 14565)
@@ -431,7 +431,7 @@
     nproc = property(lambda self: self.nchunks * self.nproc_xi * self.nproc_eta)
 
 
-class Specfem3DGlobeModel(Model, EditableObject):
+class Specfem3DGlobeModel(Model, ImmutableObject):
 
     name = models.CharField(maxlength=100)
     pathname = models.FileField(upload_to="SeismoWebPortal/models/3D", blank=True)



More information about the CIG-COMMITS mailing list