Package madrona :: Package layers :: Module models :: Class PrivateKml
[hide private]

Class PrivateKml

source code

django.db.models.Model --+
                         |
                        PrivateKml


For presenting restricted-access KML datasets that don't belong to a particular user
These can be either:
 * multi-file kml trees on disk (ie superoverlays)
 * single kml/kmz files 

Note that this is NOT a Feature so it doesn't have any of the sharing API, wont show in myshapes, etc

Admin must upload data to server and place in settings.PRIVATE_KML_ROOT

VERY IMPORTANT SECURITY CONSIDERATIONS...
 * PRIVATE_KML_ROOT should not be web accessible!
 * Each PrivateKml should have it's own subdirectory in PRIVATE_KML_ROOT!
   THIS IS IMPORTANT; Every file in and below the base kml's directory path is accessible 
   if the user has proper permissions on the base kml.

Sharing and permissions must be implemented one-off in the views using the
sharing_groups many-to-many field. 

Instance Methods [hide private]
 
__unicode__(self) source code
Class Variables [hide private]
  priority = models.FloatField(help_text= "Floating point. Highe...
  name = models.CharField(verbose_name= "Name", max_length= "255...
  sharing_groups = models.ManyToManyField(Group, blank= True, nu...
  base_kml = models.FilePathField(path= settings.PRIVATE_KML_ROO...
Class Variable Details [hide private]

priority

Value:
models.FloatField(help_text= "Floating point. Higher number = appears \
higher up on the KML tree.", default= 0.0)

name

Value:
models.CharField(verbose_name= "Name", max_length= "255", unique= True\
)

sharing_groups

Value:
models.ManyToManyField(Group, blank= True, null= True, verbose_name= "\
Share layer with the following groups")

base_kml

Value:
models.FilePathField(path= settings.PRIVATE_KML_ROOT, match= "\.km.$",\
 recursive= True, max_length= 255, help_text= """
        Path to KML file.
        If a superoverlay tree, use relative paths.  
        The user making the request only needs permissions for the bas\
e kml. 
        IMPORTANT: Every file in and below the base kml's directory pa\
th is accessible 
...