Skip to main content

Administrative Category

The Administrative Category module is a way to categorize administrative divisions based on their type and hierarchy. Each administrative division can belong to one or more categories, which might include categories like habitation (e.g rural, urban), land condition (dry, wet). These categories can be used to filter and group data within the API.

Models

class AdministrationTypeCategory(models.Model):
    name = models.CharField(max_length=255)
    parent_category = models.ForeignKey('self',
      null=True,
      blank=True,
      related_name='children',
      on_delete=models.CASCADE)
    description = models.TextField()

class AdministrationCategories(models.Model):
    administration = models.ForeignKey(
      Administration,
      on_delete=models.CASCADE)
    administration_type_category = models.ForeignKey(
      AdministrationTypeCategory,
      on_delete=models.CASCADE)
Administration Type Category

This model represents the type of administrative division type, such as Rural or Urban. It might include fields like name or description. Example:

id
parent_id
name
description
1
null
Habitation
A geographic area in which to live
2
1
Rural
A geographic area that is located outside towns and cities
3
1
Urban A geographic area that is located in cities
Administration Categories

This model represents the administrative categories for a given administrative entity. Example:

id
administration_id
administration_type_category_id
1
42
1