Admin¶
Admin for property package.
ParcelAdmin ¶
Bases: ModelAdmin
Admin page for Parcel model.
run_patch_parcel_source ¶
Admin action to patch source in parcels.
Source code in django_project/property/admin.py
ParcelTypeAdmin ¶
Bases: ModelAdmin
Admin page for ParcelType model.
PropertyAdmin ¶
Bases: ModelAdmin
Admin page for Property model.
generate_spatial_filters_for_properties ¶
Admin action to generate spatial filter data for selected properties.
Source code in django_project/property/admin.py
run_check_overlaps ¶
Admin action to check for overlapping properties.
Source code in django_project/property/admin.py
run_patch_property_centroid ¶
Admin action to patch property without centroid.
Source code in django_project/property/admin.py
run_patch_property_province ¶
Admin action to patch province in properties.
Source code in django_project/property/admin.py
PropertyOverlapsAdmin ¶
Bases: ModelAdmin
Admin page for PropertyOverlaps model.
resolve_overlaps ¶
Admin action to manually resolve the overlap record.
Source code in django_project/property/admin.py
PropertyTypeAdmin ¶
Bases: ModelAdmin
Admin page for PropertyType model.
ProvinceAdmin ¶
Bases: ModelAdmin
Admin page for Province model.
Factories¶
ParcelFactory ¶
Bases: DjangoModelFactory
Factory for Parcel.
ParcelTypeFactory ¶
Bases: DjangoModelFactory
Factory for ParcelType.
PropertyFactory ¶
Bases: DjangoModelFactory
Property factory.
PropertyTypeFactory ¶
Bases: DjangoModelFactory
Factory for PropertyType model.
ProvinceFactory ¶
Bases: DjangoModelFactory
Factory for Province.
Models¶
Test Case¶
ParcelTestCase ¶
ParcelTypeTestCase ¶
Bases: TestCase
Parcel type test case
test_create_parcel_type ¶
test_delete_parcel_type ¶
test_unique_parcel_type_name_constraint ¶
Test unique parcel type name constraint.
Source code in django_project/property/tests/test_property_models.py
test_update_parcel_type ¶
Test update parcel type.
Source code in django_project/property/tests/test_property_models.py
PropertyTestCase ¶
Bases: TestCase
Property test case.
test_create_property ¶
Test creating property
Source code in django_project/property/tests/test_property_models.py
test_delete_property ¶
test_update_property ¶
Test update property.
Source code in django_project/property/tests/test_property_models.py
PropertyTypeTest ¶
Bases: TestCase
Propert type test case
test_create_property_type ¶
Test creating a new property type
Source code in django_project/property/tests/test_property_models.py
test_delete_property_type ¶
test_property_type_unique_name_constraint ¶
Test property type unique name constraint
Source code in django_project/property/tests/test_property_models.py
test_update_property_type ¶
Test updating a property type
Source code in django_project/property/tests/test_property_models.py
ProvinceTestCase ¶
Bases: TestCase
Province test case
test_create_province ¶
Test create a province.
Source code in django_project/property/tests/test_property_models.py
test_delete_province ¶
test_unique_province_name_constraint ¶
Test unique province name constraint.
Source code in django_project/property/tests/test_property_models.py
test_update_province ¶
Test update a province.
Tasks¶
Spatial Data¶
columns_and_srid ¶
Retrieve all column names along with their SRID (if applicable) for a given table in the database schema "layer".
Parameters:
Name | Type | Description | Default |
---|---|---|---|
table_name |
AnyStr
|
Table name for which column information is required. |
required |
Returns:
Type | Description |
---|---|
Tuple[List[ColumnInfo], AnyStr]
|
Tuple[list[ColumnInfo], str]: A tuple containing two elements: 1. A list of ColumnInfo objects detailing each column. 2. A string representing the SRID of a geometry column, if present; returns an empty string if no geometry column is found. |
Source code in django_project/property/spatial_data.py
extract_spatial_data_from_property_and_layer ¶
Intersect a target property with a given context layer to extract spatial data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
target_property |
Property
|
The property object that needs to be intersected. |
required |
context_layer |
ContextLayer
|
The layer that provides contextual spatial data. |
required |
Returns:
Type | Description |
---|---|
Dict
|
The spatial data extracted from the intersection of the target property and context layer. Returns an empty dictionary if no spatial data is found. |
Source code in django_project/property/spatial_data.py
get_distinct_srids ¶
Retrieve distinct SRIDs from the specified table's geometry column.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
table_name |
str
|
Name of the table to check. |
required |
Returns:
Type | Description |
---|---|
List
|
A list of distinct SRIDs. |
Source code in django_project/property/spatial_data.py
save_spatial_values_from_property_layers ¶
Extract spatial data from the given property for all context layers and save the extracted values to SpatialDataModel.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
target_property |
Property
|
The property object to be extracted |
required |