Skip to main content

Una librería Django para manejar regiones, provincias y ciudades en Chile.

Project description

Chile Cities

Chile Cities is a Django app to load cities and regions of Chile.

Detailed documentation is in the docs directory.

Quick Start

  1. Add chile-cities to your INSTALLED_APPS setting like this:

    INSTALLED_APPS = [
        ...,
        "django_chile_cities",
    ]
    
  2. Run the following command to create the chile-cities models:

    python manage.py migrate
    
  3. Load the seed data by running:

    python manage.py load_chile_cities
    

Usage

  1. Import django_chile_cities models in your project:

    from django_chile_cities.models import Region, Province, City
    
    class MyTable(models.Model):
        ...
        city = models.ForeignKey(City, on_delete=models.PROTECT)
    
  2. Access to province and region trough city instance:

    my_table_instance.city.province.region
    

And that's it, simple, but needed in multiple projects.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_chile_cities-1.0.1.tar.gz (18.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_chile_cities-1.0.1-py3-none-any.whl (21.2 kB view details)

Uploaded Python 3

File details

Details for the file django_chile_cities-1.0.1.tar.gz.

File metadata

  • Download URL: django_chile_cities-1.0.1.tar.gz
  • Upload date:
  • Size: 18.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.3

File hashes

Hashes for django_chile_cities-1.0.1.tar.gz
Algorithm Hash digest
SHA256 e740aabb4db2fd275348599e8a7f1ab7bbcafdf54fac77335c5495e713d0495b
MD5 95b63733556207ee6e9e6692b569189f
BLAKE2b-256 9c46e31b90be7fdb5a3bc8b2cc62adf2b7442e3866f03b7e0183eaf6270ca935

See more details on using hashes here.

File details

Details for the file django_chile_cities-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for django_chile_cities-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d3eb06b6b63d89f04e9246108a99581a8ea92a9df6da8fe1c1b687d2d09d6d98
MD5 a48e5250368876dc24b7c527af25a575
BLAKE2b-256 d6fb41370e001118165aa41a7de624f68a768c400fe3a808d40443d3aa7f8571

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page