Browse Source

Change APIKey.key to use a CharField instead of a TextField

Thomas Ross 4 years ago
parent
commit
2d6bfd8ec2
2 changed files with 21 additions and 1 deletions
  1. 20
    0
      api/migrations/0002_auto_20170406_2220.py
  2. 1
    1
      api/models.py

+ 20
- 0
api/migrations/0002_auto_20170406_2220.py View File

@@ -0,0 +1,20 @@
1
+# -*- coding: utf-8 -*-
2
+# Generated by Django 1.10.6 on 2017-04-06 22:20
3
+from __future__ import unicode_literals
4
+
5
+from django.db import migrations, models
6
+
7
+
8
+class Migration(migrations.Migration):
9
+
10
+    dependencies = [
11
+        ('api', '0001_initial'),
12
+    ]
13
+
14
+    operations = [
15
+        migrations.AlterField(
16
+            model_name='apikey',
17
+            name='key',
18
+            field=models.CharField(max_length=50, primary_key=True, serialize=False, unique=True),
19
+        ),
20
+    ]

+ 1
- 1
api/models.py View File

@@ -4,7 +4,7 @@ from django.conf import settings
4 4
 
5 5
 
6 6
 class APIKey(models.Model):
7
-    key = models.TextField(max_length=50, unique=True, primary_key=True)
7
+    key = models.CharField(max_length=50, unique=True, primary_key=True)
8 8
 
9 9
     user = models.ForeignKey(settings.AUTH_USER_MODEL,
10 10
                              on_delete=models.CASCADE)