Welcome to Dana’s documentation!¶
Community¶
The Community module
-
class
app.models.community.Community(**kwargs)[source]¶ -
classmethod
add_comunity(community)[source]¶ Add a given Community to the database. If there is a conflict, the existing object in the database is overwritten.
-
classmethod
get_all_communities()[source]¶ Query the database and return a list of all Communities with their id, name and boundaries in GeoJSON format.
-
classmethod
Community Resource¶
The Community Resource module
-
class
app.models.community_resource.CommunityResource(**kwargs)[source]¶ -
classmethod
add_community_resource(resource)[source]¶ Add a given CommunityResource to the database. If there is a conflict, the existing object in the database is overwritten.
-
classmethod
edit_community_resource(community_resource_id, new_name, new_lat, new_long, new_contact_name, new_email, new_phone_number, new_address, new_website, new_image_uri)[source]¶ Update and return the existing CommunityResource with the given id.
-
classmethod
get_community_resource_by_charity_number(charity_number)[source]¶ Return the CommunityResource with the given charity number.
-
classmethod
get_community_resource_by_id(community_resource_id)[source]¶ Return a GeoJSON representation of the CommunityResource with the given id.
-
classmethod
get_resources_by_radius(longitude, latitude, radius)[source]¶ Given coordinates and a radius, return a list of CommunityResources within the given radius around the given coordinates in GeoJSON format.
-
classmethod
get_resources_in_shape(polygon_string)[source]¶ Given a polygon, return a list of CommunityResources within the given polygon in GeoJSON format.
-
classmethod