# -*- coding: utf-8 -*- from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext as _ from django.contrib.gis.db import models from django.db.models.query import QuerySet, Q from django.conf import settings from mptt.models import MPTTModel, TreeForeignKey from mptt.managers import TreeManager from munigeo.utils import get_default_srid PROJECTION_SRID = get_default_srid() @python_2_unicode_compatible class AdministrativeDivisionType(models.Model): type = models.CharField(max_length=60, unique=True, db_index=True, help_text=_("Type name of the division (e.g. muni, school_district)")) name = models.CharField(max_length=100, help_text=_("Human-readable name for the division")) ## European Union Nomenclature des Unités Territoriales Statistiques level #nuts_level = models.PositiveSmallIntegerField(null=True, db_index=True) ## European Union Local Administrative Unit level #lau_level = models.PositiveSmallIntegerField(null=True, db_index=True) def __str__(self): return "%s (%s)" % (self.name, self.type) class AdministrativeDivisionQuerySet(QuerySet):
# -*- coding: utf-8 -*- # Generated by Django 1.11.11 on 2018-07-11 06:15 import datetime import django.contrib.gis.db.models.fields from django.db import migrations, models import django.db.models.deletion import mptt.fields from munigeo.utils import get_default_srid DEFAULT_SRID = get_default_srid() class Migration(migrations.Migration): replaces = [('munigeo', '0001_initial'), ('munigeo', '0002_auto_20150608_1607'), ('munigeo', '0003_add_modified_time_to_address_and_street'), ('munigeo', '0004_building')] initial = True dependencies = [] operations = [ migrations.CreateModel( name='Address', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False,
from django.contrib.gis.db import models from django.contrib.postgres.fields import JSONField from django.utils.translation import ugettext_noop as _ from django.apps import apps from munigeo.models import Municipality from munigeo.utils import get_default_srid from services.utils import get_translated, check_valid_concrete_field from .department import Department from .keyword import Keyword from django.db.models import Manager from django.contrib.postgres.fields import HStoreField PROJECTION_SRID = get_default_srid() PROVIDER_TYPES = ( (1, 'SELF_PRODUCED'), (2, 'MUNICIPALITY'), (3, 'ASSOCIATION'), (4, 'PRIVATE_COMPANY'), (5, 'OTHER_PRODUCTION_METHOD'), (6, 'PURCHASED_SERVICE'), (7, 'UNKNOWN_PRODUCTION_METHOD'), (8, 'CONTRACT_SCHOOL'), (9, 'SUPPORTED_OPERATIONS'), (10, 'PAYMENT_COMMITMENT'), (11, 'VOUCHER_SERVICE'), ) ORGANIZER_TYPES = (
# -*- coding: utf-8 -*- # Generated by Django 1.11.11 on 2018-07-11 06:15 from __future__ import unicode_literals import datetime import django.contrib.gis.db.models.fields from django.db import migrations, models import django.db.models.deletion import mptt.fields from munigeo.utils import get_default_srid DEFAULT_SRID = get_default_srid() class Migration(migrations.Migration): replaces = [('munigeo', '0001_initial'), ('munigeo', '0002_auto_20150608_1607'), ('munigeo', '0003_add_modified_time_to_address_and_street'), ('munigeo', '0004_building')] initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Address', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('number', models.CharField(blank=True, help_text='Building number', max_length=6)), ('number_end', models.CharField(blank=True, help_text='Building number end (if range specified)', max_length=6)), ('letter', models.CharField(blank=True, help_text='Building letter if applicable', max_length=2)),