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.0.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.0-py3-none-any.whl (21.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_chile_cities-1.0.0.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.0.tar.gz
Algorithm Hash digest
SHA256 5b0160ad33e440e34a5554c78feb1eddef671ad9559ea3fd5c7e8e2f1c3eff90
MD5 b894d8bd68414b9e9368bc1246fb06b4
BLAKE2b-256 52c24067ad59eef173ca8e1379f907b30b703b436c67fa0180227effb2703219

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_chile_cities-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0a0d7f7c2ebc023ffdbf5b61a05bfe922f1e0e30dca84da481e2605806596625
MD5 e75a2a0c98b1a79678c48a8f6e5f97bf
BLAKE2b-256 a1a6fea177e26abe10dfc076de9336d50f546f8afaad2bbe3ec3b9e3f1f0a504

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