Home | Trees | Indices | Help |
---|
|
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|
|||
logger = get_logger()
|
|
Return the specified instance by uid for editing. If a target_klass is provided, uid will be checked for consistency. If the request has no logged-in user, a 401 Response will be returned. If the item is not found, a 404 Response will be returned. If the user is not authorized to edit the item (not the owner or a staff user), a 403 Not Authorized Response will be returned. usage: instance = get_object_for_editing(request, 'mlpa_mpa_12', target_klass=Mpa) if isinstance(instance, HttpResponse): return instance |
Return the specified instance by uid for viewing. If a target_klass is provided, uid will be checked for consistency. If the request has no authenticated user, a 401 Response will be returned. If the item is not found, a 404 Response will be returned. If the user is not authorized to view the item (not the owner or part of a group the item is shared with), a 403 Not Authorized Response will be returned. usage: instance = get_object_for_viewing(request, 'mlpa_mpa_12', target_klass=Mpa) if isinstance(instance, HttpResponse): return instance |
Handles all requests to views setup via features.register using Link objects. Assuming a valid request, this generic view will call the view specified by the link including an instance or instances argument containing the relavent Feature(s). If the incoming request is invalid, any one of the following errors may be returned: 401: login required 403: user does not have permission (not admin user or doesn't own object to be edited) 404: feature(s) could not be found 400: requested for feature classes not supported by this view 5xx: server error |
When calling, provide the request object, reference to the resource class, and the primary key of the object to delete. Possible response codes: 200: delete operation successful 401: login required 403: user does not have permission (not admin user or doesn't own object) 404: resource for deletion could not be found 5xx: server error |
When calling, provide the request object and a ModelForm class POST: Create a new instance from filled out ModelForm 201: Created. Response body includes representation of resource 400: Validation error. Response body includes form. Form should be displayed back to the user for correction. 401: Not logged in. 5xx: Server error. |
Serves a form for creating new objects GET only |
When calling, provide the request object, a model class, and the primary key of the instance to be updated. POST: Update instance. possible response codes: 200: OK. Object updated and in response body. 400: Form validation error. Present form back to user. 401: Not logged in. 403: Forbidden. User is not staff or does not own object. 404: Instance for uid not found. 5xx: Server error. |
Provides a resource for a django model that can be utilized by the madrona.features client module. Implements actions for the following http actions: POST: Update an object DELETE: Delete it GET: Provide a page representing the model. For MPAs, this is the MPA attributes screen. The madrona client will display this page in the sidebar whenever the object is brought into focus. To implement GET, this view needs to be passed a view function that returns an HttpResponse or a template can be specified that will be passed the instance and an optional extra_context Uses madrona.features.views.update and madrona.feature.views.delete |
Generic view that can be used to copy any feature classes. Supports requests referencing multiple instances. To copy, this view will call the copy() method with the request's user as it's sole argument. The Feature base class has a generic copy method, but developers can override it. A poorly implemented copy method that does not return the copied instance will raise an exception here. This view returns a space-delimited list of the Feature uid's for selection in the user-interface after this operation via the X-Madrona-Select response header. |
Generic view for KML representation of feature classes. Can be overridden in options but this provided a default. |
Generic view for showing the sharing form for an object POST: Update the sharing status of an object GET: Provide an html form for selecting groups to which the feature will be shared. |
|
|
Will return an appropriately structured response that the client can interpret to carry out the following actions: select Accepts a list of features. Tells the client to select these features in the user interface after an editing operation show Accepts a single feature. Client will show that feature's attribute window in the sidebar untoggle Accepts a list of features. Useful for toggling the visibility of original features that are being copied so there are not multiple overlapping copies on the map parent Gives a hint to the client that the edited feature falls within a particular FeatureCollection. Without this hint the client may not in all cases be able to perform select and show behaviors. These behaviors are intended to be specified to the client using X-Madrona- style headers in the response. Unfortunately, we have to post some forms via an iframe in order to upload files. This makes it impossible to get the response headers on the client end. This function therefor currently also returns all headers in a json structure in the response body. |
Generic view for GeoJSON representation of feature classes. Can be overridden but this is provided a default. To override, feature class needs a geojson object that returns a geojson feature string (no trailing comma):: { "type": "Feature", "geometry": {"type": "Point", "coordinates": [102.0, 0.5]}, "properties": {"prop0": "value0"} } GeoJSON Feature collections *cannot* be nested within other feature collections http://lists.geojson.org/pipermail/geojson-geojson.org/2008-October/000464.html Thus collections can be treated using one of the following strategies: ``flat``: (DEFAULT) The collection is "flattened" to contain all the features in a single featurecollection (lossy) ``nest_feature_set``: the collection is represented as an empty geometry with a special feature_set property; a list of UIDs to fetch (requires a client with knowledge of this convention) Pass by URL GET parameter like ?strategy=nest_feature_set |
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Tue Oct 30 11:31:01 2012 | http://epydoc.sourceforge.net |