Пример #1
0
 def reload(self):
     # Update object's computed values (reload from database)
     if self.pk and self.visible:
         fromdb = self.__class__.objects.get(pk=self.pk)
         self.geom = fromdb.geom
         AltimetryMixin.reload(self, fromdb)
         TimeStampedModelMixin.reload(self, fromdb)
     return self
Пример #2
0
 def reload(self, fromdb=None):
     # Update object's computed values (reload from database)
     if self.pk and self.visible:
         fromdb = self.__class__.objects.get(pk=self.pk)
         self.geom = fromdb.geom
         AltimetryMixin.reload(self, fromdb)
         TimeStampedModelMixin.reload(self, fromdb)
     return self
Пример #3
0
 def reload(self):
     if self.pk:
         fromdb = self.__class__.objects.get(pk=self.pk)
         self.area = fromdb.area
         AltimetryMixin.reload(self, fromdb)
         TimeStampedModelMixin.reload(self, fromdb)
         NoDeleteMixin.reload(self, fromdb)
         if self.topology:
             self.topology.reload()
     return self
Пример #4
0
 def reload(self):
     if self.pk:
         fromdb = self.__class__.objects.get(pk=self.pk)
         self.area = fromdb.area
         AltimetryMixin.reload(self, fromdb)
         TimeStampedModelMixin.reload(self, fromdb)
         NoDeleteMixin.reload(self, fromdb)
         if self.topology:
             self.topology.reload()
     return self
Пример #5
0
 def reload(self, fromdb=None):
     """
     Reload into instance all computed attributes in triggers.
     """
     if self.pk:
         # Update computed values
         fromdb = self.__class__.objects.get(pk=self.pk)
         self.geom = fromdb.geom
         # /!\ offset may be set by a trigger OR in
         # the django code, reload() will override
         # any unsaved value
         self.offset = fromdb.offset
         AltimetryMixin.reload(self, fromdb)
         TimeStampedModelMixin.reload(self, fromdb)
         NoDeleteMixin.reload(self, fromdb)
     return self