1 from django.db import models
2 from django.contrib.gis.db import models
3
4
6 """Returns the currently active data layer (determined by the active attribute).
7 """
9 return self.get(active=True)
10
12 """Abstract Model in which an inheriting subclass can be used for storing a data layer used by a Manipulator
13
14 ====================== ==============================================
15 Attribute Description
16 ====================== ==============================================
17 ``creation_date`` When the layer was created. Is not changed on
18 updates.
19
20 ``active`` Whether this layer represents the current
21 data layer. If set to true and and another
22 layer is active, that old layer will be
23 deactivated.
24 ====================== ==============================================
25 """
26 creation_date = models.DateTimeField(auto_now=True)
27
28 active = models.BooleanField(default=True, help_text="""
29 Checking here indicates that this layer list should be the one used in
30 the application. Copies of other layer lists are retained in the
31 system so you can go back to an old version if necessary.
32 """)
33
34 objects = BaseManipulatorGeometryManager()
35
36 - def save(self, *args, **kwargs):
41
44