Parcourir la source

TextField → CharField for name and phone number

Jocelyn Delande il y a 9 ans
Parent
commit
485a26a4a5

+ 25 - 0
wifiwithme/apps/contribmap/migrations/0009_auto_20160303_1357.py

@@ -0,0 +1,25 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9.3 on 2016-03-03 13:57
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('contribmap', '0008_remove_contrib_old_date'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='contrib',
+            name='name',
+            field=models.CharField(max_length=30),
+        ),
+        migrations.AlterField(
+            model_name='contrib',
+            name='phone',
+            field=models.CharField(blank=True, default='', max_length=30),
+        ),
+    ]

+ 2 - 2
wifiwithme/apps/contribmap/models.py

@@ -7,7 +7,7 @@ from .fields import CommaSeparatedCharField
 
 class Contrib(models.Model):
     id = models.AutoField(primary_key=True, blank=False, null=False)
-    name = models.TextField()
+    name = models.CharField(max_length=30)
     contrib_type = models.CharField(
         max_length=10, choices=(
             ('connect', 'Me raccorder au réseau expérimental'),
@@ -15,7 +15,7 @@ class Contrib(models.Model):
         ))
     latitude = models.FloatField(blank=True, null=True)
     longitude = models.FloatField(blank=True, null=True)
-    phone = models.TextField(blank=True, null=True)
+    phone = models.CharField(max_length=30, blank=True, default='')
     email = models.EmailField(blank=True)
     access_type = models.CharField(
         max_length=10, blank=True, choices=(