Package madrona :: Package features :: Module models :: Class Feature
[hide private]

Class Feature

source code

django.contrib.gis.db.models.Model --+
                                     |
                                    Feature

Model used for representing user-generated features

====================== ============================================== Attribute Description ====================== ============================================== ``user`` Creator

``name`` Name of the object

``date_created`` When it was created

``date_modified`` When it was last updated. ====================== ==============================================

Nested Classes [hide private]
  Meta
Instance Methods [hide private]
 
__unicode__(self) source code
 
__repr__(self) source code
 
save(self, rerun=True, form=None, *args, **kwargs) source code
 
get_absolute_url(self) source code
 
options(self) source code
 
hash(self)
For caching.
source code
 
uid(self)
Unique identifier for this feature.
source code
 
kml_safe(self)
A safety valve for kmlapp...
source code
 
add_to_collection(self, collection)
Add feature to specified FeatureCollection
source code
 
remove_from_collection(self)
Remove feature from FeatureCollection
source code
 
share_with(self, groups, append=False)
Share this feature with the specified group/groups.
source code
 
is_viewable(self, user)
Is this feauture viewable by the specified user? Either needs to own it or have it shared with them.
source code
 
copy(self, user=None)
Returns a copy of this feature, setting the user to the specified owner.
source code
Class Methods [hide private]
 
get_options(klass)
Returns model class Options object
source code
 
css(klass)
Specifies the CSS for representing features in kmltree, specifically the icon Works one of two ways: 1.
source code
 
model_uid(klass)
class method providing the uid for the model class.
source code
Class Variables [hide private]
  user = models.ForeignKey(User, related_name= "%(app_label)s_%(...
  name = models.CharField(verbose_name= "Name", max_length= "255")
  date_created = models.DateTimeField(auto_now_add= True, verbos...
  date_modified = models.DateTimeField(auto_now= True, verbose_n...
  sharing_groups = models.ManyToManyField(Group, editable= False...
  content_type = models.ForeignKey(ContentType, blank= True, nul...
  object_id = models.PositiveIntegerField(blank= True, null= True)
  collection = generic.GenericForeignKey('content_type', 'object...
  objects = ShareableGeoManager()
Method Details [hide private]

get_absolute_url(self)

source code 
Decorators:
  • @models.permalink

css(klass)
Class Method

source code 

Specifies the CSS for representing features in kmltree, specifically the icon
Works one of two ways:
1. Use the icon_url Option and this default css() classmethod 
2. Override the css() classmethod for more complex cases

options(self)

source code 
Decorators:
  • @property

hash(self)

source code 

For caching. This string represents a hash of all attributes that may influence reporting results. i.e. if this property changes, reports for the feature get rerun.

Decorators:
  • @property

uid(self)

source code 

Unique identifier for this feature.

Decorators:
  • @property

kml_safe(self)

source code 

A safety valve for kmlapp... If one feature's .kml property fails, it won't bring down the entire request. This property is never to be overridden!

Decorators:
  • @property

share_with(self, groups, append=False)

source code 

Share this feature with the specified group/groups. Owner must be a member of the group/groups. Group must have 'can_share' permissions else an Exception is raised

is_viewable(self, user)

source code 

Is this feauture viewable by the specified user? Either needs to own it or have it shared with them. returns : Viewable(boolean), HttpResponse

copy(self, user=None)

source code 

Returns a copy of this feature, setting the user to the specified owner. Copies many-to-many relations


Class Variable Details [hide private]

user

Value:
models.ForeignKey(User, related_name= "%(app_label)s_%(class)s_related\
")

date_created

Value:
models.DateTimeField(auto_now_add= True, verbose_name= "Date Created")

date_modified

Value:
models.DateTimeField(auto_now= True, verbose_name= "Date Modified")

sharing_groups

Value:
models.ManyToManyField(Group, editable= False, blank= True, null= True\
, verbose_name= "Share with the following groups", related_name= "%(ap\
p_label)s_%(class)s_related")

content_type

Value:
models.ForeignKey(ContentType, blank= True, null= True, related_name= \
"%(app_label)s_%(class)s_related")

collection

Value:
generic.GenericForeignKey('content_type', 'object_id')