Commits

Mikhail Korobov  committed 286569e

Индекс на поле Адрес

  • Participants
  • Parent commits 12c1ec1

Comments (0)

Files changed (3)

File yandex_maps/migrations/0001_initial.py

         # Adding model 'MapAndAddress'
         db.create_table('yandex_maps_mapandaddress', (
             ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
-            ('address', self.gf('django.db.models.fields.CharField')(max_length=255, blank=True)),
+            ('address', self.gf('django.db.models.fields.CharField')(db_index=True, max_length=255, blank=True)),
             ('longtitude', self.gf('django.db.models.fields.FloatField')(null=True, blank=True)),
             ('latitude', self.gf('django.db.models.fields.FloatField')(null=True, blank=True)),
         ))
     models = {
         'yandex_maps.mapandaddress': {
             'Meta': {'object_name': 'MapAndAddress'},
-            'address': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
+            'address': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}),
             'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
             'latitude': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}),
             'longtitude': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'})

File yandex_maps/models.py

 YANDEX_KEY = getattr(settings, 'YANDEX_MAPS_API_KEY', None)
 
 class MapAndAddress(models.Model):
-    address = models.CharField(u'Адрес', max_length=255, blank=True)
+    address = models.CharField(u'Адрес', max_length=255, blank=True, db_index=True)
     longtitude = models.FloatField(u'Долгота', null=True, blank=True)
     latitude = models.FloatField(u'Широта', null=True, blank=True)
 

File yandex_maps_tests/settings.py

 TEMPLATE_DIRS = (os.path.join(PROJECT_ROOT, 'templates'),)
 
 YANDEX_MAPS_API_KEY = 'sdfkjhg'
-INSTALLED_APPS=('yandex_maps', 'test_app')
+INSTALLED_APPS=(
+    'yandex_maps',
+    'test_app',
+#    'south'
+)