# Path: angkot/geo/models.py
# class Province(models.Model):
#     name = models.CharField(max_length=100)
#     code = models.CharField(max_length=5)
# 
#     order = models.IntegerField(default=0)
# 
#     # Internal
#     enabled = models.BooleanField(default=False)
#     updated = models.DateTimeField(default=timezone.now)
#     created = models.DateTimeField(default=timezone.now)
# 
#     def __str__(self):
#         return self.name
# 
#     def save(self):
#         self.updated = timezone.now()
#         super(Province, self).save()
# 
#     class Meta:
#         ordering = ('pk',)
# 
# class City(models.Model):
#     name = models.CharField(max_length=100)
#     province = models.ForeignKey(Province)
# 
#     # Internal
#     enabled = models.BooleanField(default=False)
#     updated = models.DateTimeField(default=timezone.now)
#     created = models.DateTimeField(default=timezone.now)
# 
#     def __str__(self):
#         return '{}, {}'.format(self.name, self.province)
# 
#     def save(self):
#         self.updated = timezone.now()
#         super(City, self).save()
# 
#     class Meta:
#         ordering = ('province', 'name',)
#         verbose_name_plural = 'cities'


from django.contrib.gis import admin
from angkot.geo.models import Province, City


class ProvinceAdmin(admin.ModelAdmin):
    list_display = ('name', 'code', 'order', 'pk', 'enabled')

class CityAdmin(admin.ModelAdmin):
    list_display = ('name', 'province', 'pk', 'enabled')


# Path: angkot/geo/models.py
# class Province(models.Model):
#     name = models.CharField(max_length=100)
#     code = models.CharField(max_length=5)
# 
#     order = models.IntegerField(default=0)
# 
#     # Internal
#     enabled = models.BooleanField(default=False)
#     updated = models.DateTimeField(default=timezone.now)
#     created = models.DateTimeField(default=timezone.now)
# 
#     def __str__(self):
#         return self.name
# 
#     def save(self):
#         self.updated = timezone.now()
#         super(Province, self).save()
# 
#     class Meta:
#         ordering = ('pk',)
# 
# class City(models.Model):
#     name = models.CharField(max_length=100)
#     province = models.ForeignKey(Province)
# 
#     # Internal
#     enabled = models.BooleanField(default=False)
#     updated = models.DateTimeField(default=timezone.now)
#     created = models.DateTimeField(default=timezone.now)
# 
#     def __str__(self):
#         return '{}, {}'.format(self.name, self.province)
# 
#     def save(self):
#         self.updated = timezone.now()
#         super(City, self).save()
# 
#     class Meta:
#         ordering = ('province', 'name',)
#         verbose_name_plural = 'cities'


# Path: angkot/geo/admin.py
from django.contrib.gis import admin
from angkot.geo.models import Province, City



class ProvinceAdmin(admin.ModelAdmin):
    list_display = ('name', 'code', 'order', 'pk', 'enabled')

class CityAdmin(admin.ModelAdmin):
    list_display = ('name', 'province', 'pk', 'enabled')


admin.site.register(Province, ProvinceAdmin)