De-slugify

This commit is contained in:
Matthew Ryan Dillon 2016-06-15 15:52:18 -07:00
parent 65bc5c16d4
commit 19d97cc79c
16 changed files with 0 additions and 70 deletions

View file

@ -1,5 +1,4 @@
from django.db import migrations, models from django.db import migrations, models
import autoslug.fields
class Migration(migrations.Migration): class Migration(migrations.Migration):
@ -16,7 +15,6 @@ class Migration(migrations.Migration):
('id', models.AutoField(verbose_name='ID', serialize=False, primary_key=True, auto_created=True)), ('id', models.AutoField(verbose_name='ID', serialize=False, primary_key=True, auto_created=True)),
('name', models.CharField(max_length=200)), ('name', models.CharField(max_length=200)),
('sort_order', models.IntegerField(blank=True, null=True)), ('sort_order', models.IntegerField(blank=True, null=True)),
('slug', autoslug.fields.AutoSlugField(populate_from='name', editable=False)),
], ],
options={ options={
'ordering': ['sort_order'], 'ordering': ['sort_order'],
@ -43,7 +41,6 @@ class Migration(migrations.Migration):
('code', models.CharField(blank=True, max_length=10)), ('code', models.CharField(blank=True, max_length=10)),
('collection_method_class', models.CharField(blank=True, max_length=50)), ('collection_method_class', models.CharField(blank=True, max_length=50)),
('sort_order', models.IntegerField(blank=True, null=True)), ('sort_order', models.IntegerField(blank=True, null=True)),
('slug', autoslug.fields.AutoSlugField(populate_from='name', editable=False)),
], ],
options={ options={
'ordering': ['sort_order'], 'ordering': ['sort_order'],
@ -68,7 +65,6 @@ class Migration(migrations.Migration):
('name', models.CharField(max_length=100)), ('name', models.CharField(max_length=100)),
('code', models.CharField(blank=True, max_length=10)), ('code', models.CharField(blank=True, max_length=10)),
('sort_order', models.IntegerField(blank=True, null=True)), ('sort_order', models.IntegerField(blank=True, null=True)),
('slug', autoslug.fields.AutoSlugField(populate_from='name', editable=False)),
], ],
options={ options={
'ordering': ['sort_order'], 'ordering': ['sort_order'],
@ -89,7 +85,6 @@ class Migration(migrations.Migration):
('name', models.CharField(max_length=200)), ('name', models.CharField(max_length=200)),
('description', models.CharField(blank=True, max_length=255)), ('description', models.CharField(blank=True, max_length=255)),
('sort_order', models.IntegerField(blank=True, null=True)), ('sort_order', models.IntegerField(blank=True, null=True)),
('slug', autoslug.fields.AutoSlugField(populate_from='name', editable=False)),
], ],
options={ options={
'ordering': ['sort_order'], 'ordering': ['sort_order'],

View file

@ -1,13 +1,10 @@
from django.db import models from django.db import models
from autoslug import AutoSlugField
class CollectionType(models.Model): class CollectionType(models.Model):
name = models.CharField(max_length=100) name = models.CharField(max_length=100)
code = models.CharField(max_length=10, blank=True) code = models.CharField(max_length=10, blank=True)
sort_order = models.IntegerField(blank=True, null=True) sort_order = models.IntegerField(blank=True, null=True)
slug = AutoSlugField(populate_from='name')
def __str__(self): def __str__(self):
return self.name return self.name
@ -22,7 +19,6 @@ class CollectionMethod(models.Model):
code = models.CharField(max_length=10, blank=True) code = models.CharField(max_length=10, blank=True)
collection_method_class = models.CharField(max_length=50, blank=True) collection_method_class = models.CharField(max_length=50, blank=True)
sort_order = models.IntegerField(blank=True, null=True) sort_order = models.IntegerField(blank=True, null=True)
slug = AutoSlugField(populate_from='name')
def __str__(self): def __str__(self):
return self.name return self.name
@ -36,7 +32,6 @@ class Flaw(models.Model):
name = models.CharField(max_length=200) name = models.CharField(max_length=200)
description = models.CharField(max_length=255, blank=True) description = models.CharField(max_length=255, blank=True)
sort_order = models.IntegerField(blank=True, null=True) sort_order = models.IntegerField(blank=True, null=True)
slug = AutoSlugField(populate_from='name')
def __str__(self): def __str__(self):
return self.name return self.name
@ -48,7 +43,6 @@ class Flaw(models.Model):
class ADFGPermit(models.Model): class ADFGPermit(models.Model):
name = models.CharField(max_length=200) name = models.CharField(max_length=200)
sort_order = models.IntegerField(blank=True, null=True) sort_order = models.IntegerField(blank=True, null=True)
slug = AutoSlugField(populate_from='name')
def __str__(self): def __str__(self):
return self.name return self.name

View file

@ -1,5 +1,4 @@
from django.db import migrations, models from django.db import migrations, models
import autoslug.fields
class Migration(migrations.Migration): class Migration(migrations.Migration):
@ -19,7 +18,6 @@ class Migration(migrations.Migration):
('code', models.CharField(blank=True, max_length=10)), ('code', models.CharField(blank=True, max_length=10)),
('description', models.CharField(blank=True, max_length=255)), ('description', models.CharField(blank=True, max_length=255)),
('sort_order', models.IntegerField(blank=True, null=True)), ('sort_order', models.IntegerField(blank=True, null=True)),
('slug', autoslug.fields.AutoSlugField(populate_from='name', editable=False)),
], ],
options={ options={
'ordering': ['sort_order'], 'ordering': ['sort_order'],
@ -32,7 +30,6 @@ class Migration(migrations.Migration):
('name', models.CharField(max_length=200)), ('name', models.CharField(max_length=200)),
('description', models.CharField(blank=True, max_length=255)), ('description', models.CharField(blank=True, max_length=255)),
('sort_order', models.IntegerField(blank=True, null=True)), ('sort_order', models.IntegerField(blank=True, null=True)),
('slug', autoslug.fields.AutoSlugField(populate_from='name', editable=False)),
], ],
options={ options={
'ordering': ['sort_order'], 'ordering': ['sort_order'],
@ -65,7 +62,6 @@ class Migration(migrations.Migration):
('placement', models.CharField(blank=True, max_length=25)), ('placement', models.CharField(blank=True, max_length=25)),
('description', models.CharField(blank=True, max_length=255)), ('description', models.CharField(blank=True, max_length=255)),
('sort_order', models.IntegerField(blank=True, null=True)), ('sort_order', models.IntegerField(blank=True, null=True)),
('slug', autoslug.fields.AutoSlugField(populate_from='name', editable=False)),
('experiment', models.ForeignKey(to='experiments.Experiment', null=True, blank=True)), ('experiment', models.ForeignKey(to='experiments.Experiment', null=True, blank=True)),
], ],
options={ options={

View file

@ -1,13 +1,10 @@
from django.db import models from django.db import models
from autoslug import AutoSlugField
class Flaw(models.Model): class Flaw(models.Model):
name = models.CharField(max_length=200) name = models.CharField(max_length=200)
description = models.CharField(max_length=255, blank=True) description = models.CharField(max_length=255, blank=True)
sort_order = models.IntegerField(blank=True, null=True) sort_order = models.IntegerField(blank=True, null=True)
slug = AutoSlugField(populate_from='name')
def __str__(self): def __str__(self):
return self.name return self.name
@ -22,7 +19,6 @@ class Experiment(models.Model):
description = models.CharField(max_length=255, blank=True) description = models.CharField(max_length=255, blank=True)
flaw = models.ForeignKey(Flaw, blank=True, null=True, related_name='experiments') flaw = models.ForeignKey(Flaw, blank=True, null=True, related_name='experiments')
sort_order = models.IntegerField(blank=True, null=True) sort_order = models.IntegerField(blank=True, null=True)
slug = AutoSlugField(populate_from='name')
collections = models.ManyToManyField('collections_ccdb.Collection') collections = models.ManyToManyField('collections_ccdb.Collection')
def __str__(self): def __str__(self):
@ -50,7 +46,6 @@ class TreatmentType(models.Model):
placement = models.CharField(max_length=25, blank=True) placement = models.CharField(max_length=25, blank=True)
description = models.CharField(max_length=255, blank=True) description = models.CharField(max_length=255, blank=True)
sort_order = models.IntegerField(blank=True, null=True) sort_order = models.IntegerField(blank=True, null=True)
slug = AutoSlugField(populate_from='name')
display_name = models.CharField(max_length=255, editable=False) display_name = models.CharField(max_length=255, editable=False)
def save(self, *args, **kwargs): def save(self, *args, **kwargs):

View file

@ -1,5 +1,4 @@
from django.db import migrations, models from django.db import migrations, models
import autoslug.fields
class Migration(migrations.Migration): class Migration(migrations.Migration):
@ -16,7 +15,6 @@ class Migration(migrations.Migration):
('municipal_location_type', models.CharField(blank=True, max_length=50)), ('municipal_location_type', models.CharField(blank=True, max_length=50)),
('description', models.CharField(blank=True, max_length=255)), ('description', models.CharField(blank=True, max_length=255)),
('sort_order', models.IntegerField(blank=True, null=True)), ('sort_order', models.IntegerField(blank=True, null=True)),
('slug', autoslug.fields.AutoSlugField(editable=False, populate_from='name')),
], ],
options={ options={
'ordering': ['sort_order'], 'ordering': ['sort_order'],
@ -29,7 +27,6 @@ class Migration(migrations.Migration):
('name', models.CharField(max_length=100)), ('name', models.CharField(max_length=100)),
('code', models.CharField(blank=True, max_length=10)), ('code', models.CharField(blank=True, max_length=10)),
('sort_order', models.IntegerField(blank=True, null=True)), ('sort_order', models.IntegerField(blank=True, null=True)),
('slug', autoslug.fields.AutoSlugField(editable=False, populate_from='name')),
], ],
options={ options={
'ordering': ['sort_order'], 'ordering': ['sort_order'],
@ -43,7 +40,6 @@ class Migration(migrations.Migration):
('code', models.CharField(blank=True, max_length=10)), ('code', models.CharField(blank=True, max_length=10)),
('description', models.CharField(blank=True, max_length=255)), ('description', models.CharField(blank=True, max_length=255)),
('sort_order', models.IntegerField(blank=True, null=True)), ('sort_order', models.IntegerField(blank=True, null=True)),
('slug', autoslug.fields.AutoSlugField(editable=False, populate_from='name')),
('region', models.ForeignKey(to='locations.Region', null=True, blank=True)), ('region', models.ForeignKey(to='locations.Region', null=True, blank=True)),
], ],
options={ options={
@ -78,7 +74,6 @@ class Migration(migrations.Migration):
('collecting_location', models.BooleanField(default=False)), ('collecting_location', models.BooleanField(default=False)),
('description', models.CharField(blank=True, max_length=255)), ('description', models.CharField(blank=True, max_length=255)),
('sort_order', models.IntegerField(blank=True, null=True)), ('sort_order', models.IntegerField(blank=True, null=True)),
('slug', autoslug.fields.AutoSlugField(editable=False, populate_from='name')),
('municipal_location', models.ForeignKey(to='locations.MunicipalLocation', null=True, blank=True)), ('municipal_location', models.ForeignKey(to='locations.MunicipalLocation', null=True, blank=True)),
('site', models.ForeignKey(to='locations.Site', null=True, blank=True)), ('site', models.ForeignKey(to='locations.Site', null=True, blank=True)),
], ],

View file

@ -1,13 +1,10 @@
from django.db import models from django.db import models
from autoslug import AutoSlugField
class Region(models.Model): class Region(models.Model):
name = models.CharField(max_length=100) name = models.CharField(max_length=100)
code = models.CharField(max_length=10, blank=True) code = models.CharField(max_length=10, blank=True)
sort_order = models.IntegerField(blank=True, null=True) sort_order = models.IntegerField(blank=True, null=True)
slug = AutoSlugField(populate_from='name')
def __str__(self): def __str__(self):
return self.name return self.name
@ -23,7 +20,6 @@ class Site(models.Model):
code = models.CharField(max_length=10, blank=True) code = models.CharField(max_length=10, blank=True)
description = models.CharField(max_length=255, blank=True) description = models.CharField(max_length=255, blank=True)
sort_order = models.IntegerField(blank=True, null=True) sort_order = models.IntegerField(blank=True, null=True)
slug = AutoSlugField(populate_from='name')
def __str__(self): def __str__(self):
return self.name return self.name
@ -38,7 +34,6 @@ class MunicipalLocation(models.Model):
municipal_location_type = models.CharField(max_length=50, blank=True) municipal_location_type = models.CharField(max_length=50, blank=True)
description = models.CharField(max_length=255, blank=True) description = models.CharField(max_length=255, blank=True)
sort_order = models.IntegerField(blank=True, null=True) sort_order = models.IntegerField(blank=True, null=True)
slug = AutoSlugField(populate_from='name')
def __str__(self): def __str__(self):
return self.name return self.name
@ -58,7 +53,6 @@ class StudyLocation(models.Model):
collecting_location = models.BooleanField(default=False) collecting_location = models.BooleanField(default=False)
description = models.CharField(max_length=255, blank=True) description = models.CharField(max_length=255, blank=True)
sort_order = models.IntegerField(blank=True, null=True) sort_order = models.IntegerField(blank=True, null=True)
slug = AutoSlugField(populate_from='name')
def __str__(self): def __str__(self):
return self.code return self.code

View file

@ -1,5 +1,4 @@
from django.db import migrations, models from django.db import migrations, models
import autoslug.fields
class Migration(migrations.Migration): class Migration(migrations.Migration):
@ -15,7 +14,6 @@ class Migration(migrations.Migration):
('code', models.CharField(max_length=10, blank=True)), ('code', models.CharField(max_length=10, blank=True)),
('color_number', models.FloatField(blank=True, null=True)), ('color_number', models.FloatField(blank=True, null=True)),
('sort_order', models.IntegerField(blank=True, null=True)), ('sort_order', models.IntegerField(blank=True, null=True)),
('slug', autoslug.fields.AutoSlugField(editable=False, populate_from='name')),
], ],
options={ options={
'ordering': ['sort_order'], 'ordering': ['sort_order'],
@ -30,7 +28,6 @@ class Migration(migrations.Migration):
('application', models.CharField(max_length=50, blank=True)), ('application', models.CharField(max_length=50, blank=True)),
('volume', models.FloatField(blank=True, null=True)), ('volume', models.FloatField(blank=True, null=True)),
('sort_order', models.IntegerField(blank=True, null=True)), ('sort_order', models.IntegerField(blank=True, null=True)),
('slug', autoslug.fields.AutoSlugField(editable=False, populate_from='name')),
('color', models.ForeignKey(blank=True, to='misc.Color', null=True)), ('color', models.ForeignKey(blank=True, to='misc.Color', null=True)),
], ],
options={ options={
@ -46,7 +43,6 @@ class Migration(migrations.Migration):
('material_class', models.CharField(max_length=50, blank=True)), ('material_class', models.CharField(max_length=50, blank=True)),
('description', models.CharField(max_length=255, blank=True)), ('description', models.CharField(max_length=255, blank=True)),
('sort_order', models.IntegerField(blank=True, null=True)), ('sort_order', models.IntegerField(blank=True, null=True)),
('slug', autoslug.fields.AutoSlugField(editable=False, populate_from='name')),
], ],
options={ options={
'ordering': ['sort_order'], 'ordering': ['sort_order'],
@ -61,7 +57,6 @@ class Migration(migrations.Migration):
('measurement_type_class', models.CharField(max_length=50, blank=True)), ('measurement_type_class', models.CharField(max_length=50, blank=True)),
('description', models.CharField(max_length=255, blank=True)), ('description', models.CharField(max_length=255, blank=True)),
('sort_order', models.IntegerField(blank=True, null=True)), ('sort_order', models.IntegerField(blank=True, null=True)),
('slug', autoslug.fields.AutoSlugField(editable=False, populate_from='name')),
], ],
options={ options={
'ordering': ['sort_order'], 'ordering': ['sort_order'],
@ -76,7 +71,6 @@ class Migration(migrations.Migration):
('unit_class', models.CharField(max_length=50, blank=True)), ('unit_class', models.CharField(max_length=50, blank=True)),
('description', models.CharField(max_length=255, blank=True)), ('description', models.CharField(max_length=255, blank=True)),
('sort_order', models.IntegerField(blank=True, null=True)), ('sort_order', models.IntegerField(blank=True, null=True)),
('slug', autoslug.fields.AutoSlugField(editable=False, populate_from='name')),
], ],
options={ options={
'ordering': ['sort_order'], 'ordering': ['sort_order'],

View file

@ -1,7 +1,5 @@
from django.db import models from django.db import models
from autoslug import AutoSlugField
class MeasurementUnit(models.Model): class MeasurementUnit(models.Model):
name = models.CharField(max_length=100) name = models.CharField(max_length=100)
@ -9,7 +7,6 @@ class MeasurementUnit(models.Model):
unit_class = models.CharField(max_length=50, blank=True) unit_class = models.CharField(max_length=50, blank=True)
description = models.CharField(max_length=255, blank=True) description = models.CharField(max_length=255, blank=True)
sort_order = models.IntegerField(blank=True, null=True) sort_order = models.IntegerField(blank=True, null=True)
slug = AutoSlugField(populate_from='name')
def __str__(self): def __str__(self):
return self.code return self.code
@ -28,7 +25,6 @@ class MeasurementType(models.Model):
null=True, null=True,
related_name='measurement_types') related_name='measurement_types')
sort_order = models.IntegerField(blank=True, null=True) sort_order = models.IntegerField(blank=True, null=True)
slug = AutoSlugField(populate_from='name')
def __str__(self): def __str__(self):
return self.name return self.name
@ -43,7 +39,6 @@ class Material(models.Model):
material_class = models.CharField(max_length=50, blank=True) material_class = models.CharField(max_length=50, blank=True)
description = models.CharField(max_length=255, blank=True) description = models.CharField(max_length=255, blank=True)
sort_order = models.IntegerField(blank=True, null=True) sort_order = models.IntegerField(blank=True, null=True)
slug = AutoSlugField(populate_from='name')
def __str__(self): def __str__(self):
return self.name return self.name
@ -58,7 +53,6 @@ class Color(models.Model):
code = models.CharField(max_length=10, blank=True) code = models.CharField(max_length=10, blank=True)
color_number = models.FloatField(blank=True, null=True) color_number = models.FloatField(blank=True, null=True)
sort_order = models.IntegerField(blank=True, null=True) sort_order = models.IntegerField(blank=True, null=True)
slug = AutoSlugField(populate_from='name')
def __str__(self): def __str__(self):
return self.name return self.name
@ -80,7 +74,6 @@ class Container(models.Model):
measurement_unit = models.ForeignKey(MeasurementUnit, blank=True, null=True, measurement_unit = models.ForeignKey(MeasurementUnit, blank=True, null=True,
related_name='containers') related_name='containers')
sort_order = models.IntegerField(blank=True, null=True) sort_order = models.IntegerField(blank=True, null=True)
slug = AutoSlugField(populate_from='name')
def __str__(self): def __str__(self):
return self.name return self.name

View file

@ -1,5 +1,4 @@
from django.db import migrations, models from django.db import migrations, models
import autoslug.fields
class Migration(migrations.Migration): class Migration(migrations.Migration):
@ -15,7 +14,6 @@ class Migration(migrations.Migration):
('name', models.CharField(max_length=200)), ('name', models.CharField(max_length=200)),
('description', models.CharField(max_length=255, blank=True)), ('description', models.CharField(max_length=255, blank=True)),
('sort_order', models.IntegerField(null=True, blank=True)), ('sort_order', models.IntegerField(null=True, blank=True)),
('slug', autoslug.fields.AutoSlugField(populate_from='name', editable=False)),
], ],
options={ options={
'ordering': ['sort_order'], 'ordering': ['sort_order'],
@ -43,7 +41,6 @@ class Migration(migrations.Migration):
('code', models.CharField(max_length=10, blank=True)), ('code', models.CharField(max_length=10, blank=True)),
('description', models.CharField(max_length=255, blank=True)), ('description', models.CharField(max_length=255, blank=True)),
('sort_order', models.IntegerField(null=True, blank=True)), ('sort_order', models.IntegerField(null=True, blank=True)),
('slug', autoslug.fields.AutoSlugField(populate_from='name', editable=False)),
], ],
options={ options={
'ordering': ['sort_order'], 'ordering': ['sort_order'],
@ -57,7 +54,6 @@ class Migration(migrations.Migration):
('code', models.CharField(max_length=10, blank=True)), ('code', models.CharField(max_length=10, blank=True)),
('reagent_class', models.CharField(max_length=50, blank=True)), ('reagent_class', models.CharField(max_length=50, blank=True)),
('sort_order', models.IntegerField(null=True, blank=True)), ('sort_order', models.IntegerField(null=True, blank=True)),
('slug', autoslug.fields.AutoSlugField(populate_from='name', editable=False)),
], ],
options={ options={
'ordering': ['sort_order'], 'ordering': ['sort_order'],

View file

@ -1,14 +1,11 @@
from django.db import models from django.db import models
from autoslug import AutoSlugField
class ProcessType(models.Model): class ProcessType(models.Model):
name = models.CharField(max_length=100) name = models.CharField(max_length=100)
code = models.CharField(max_length=10, blank=True) code = models.CharField(max_length=10, blank=True)
description = models.CharField(max_length=255, blank=True) description = models.CharField(max_length=255, blank=True)
sort_order = models.IntegerField(blank=True, null=True) sort_order = models.IntegerField(blank=True, null=True)
slug = AutoSlugField(populate_from='name')
def __str__(self): def __str__(self):
return self.name return self.name
@ -23,7 +20,6 @@ class Reagent(models.Model):
code = models.CharField(max_length=10, blank=True) code = models.CharField(max_length=10, blank=True)
reagent_class = models.CharField(max_length=50, blank=True) reagent_class = models.CharField(max_length=50, blank=True)
sort_order = models.IntegerField(blank=True, null=True) sort_order = models.IntegerField(blank=True, null=True)
slug = AutoSlugField(populate_from='name')
def __str__(self): def __str__(self):
return self.name return self.name
@ -37,7 +33,6 @@ class Flaw(models.Model):
name = models.CharField(max_length=200) name = models.CharField(max_length=200)
description = models.CharField(max_length=255, blank=True) description = models.CharField(max_length=255, blank=True)
sort_order = models.IntegerField(blank=True, null=True) sort_order = models.IntegerField(blank=True, null=True)
slug = AutoSlugField(populate_from='name')
def __str__(self): def __str__(self):
return self.name return self.name

View file

@ -1,5 +1,4 @@
from django.db import migrations, models from django.db import migrations, models
import autoslug.fields
class Migration(migrations.Migration): class Migration(migrations.Migration):
@ -16,7 +15,6 @@ class Migration(migrations.Migration):
('iacuc_number', models.CharField(blank=True, max_length=25)), ('iacuc_number', models.CharField(blank=True, max_length=25)),
('description', models.CharField(blank=True, max_length=255)), ('description', models.CharField(blank=True, max_length=255)),
('sort_order', models.IntegerField(blank=True, null=True)), ('sort_order', models.IntegerField(blank=True, null=True)),
('slug', autoslug.fields.AutoSlugField(populate_from='name', editable=False)),
], ],
options={ options={
'ordering': ['sort_order'], 'ordering': ['sort_order'],

View file

@ -1,7 +1,5 @@
from django.db import models from django.db import models
from autoslug import AutoSlugField
class Project(models.Model): class Project(models.Model):
name = models.CharField(max_length=100) name = models.CharField(max_length=100)
@ -9,7 +7,6 @@ class Project(models.Model):
iacuc_number = models.CharField(max_length=25, blank=True) iacuc_number = models.CharField(max_length=25, blank=True)
description = models.CharField(max_length=255, blank=True) description = models.CharField(max_length=255, blank=True)
sort_order = models.IntegerField(blank=True, null=True) sort_order = models.IntegerField(blank=True, null=True)
slug = AutoSlugField(populate_from='name')
def __str__(self): def __str__(self):
return self.name return self.name

View file

@ -1,5 +1,4 @@
from django.db import migrations, models from django.db import migrations, models
import autoslug.fields
class Migration(migrations.Migration): class Migration(migrations.Migration):
@ -17,7 +16,6 @@ class Migration(migrations.Migration):
('species', models.CharField(max_length=50, blank=True)), ('species', models.CharField(max_length=50, blank=True)),
('parasite', models.BooleanField(default=False)), ('parasite', models.BooleanField(default=False)),
('sort_order', models.IntegerField(blank=True, null=True)), ('sort_order', models.IntegerField(blank=True, null=True)),
('slug', autoslug.fields.AutoSlugField(populate_from='common_name', editable=False)),
], ],
options={ options={
'ordering': ['sort_order'], 'ordering': ['sort_order'],

View file

@ -1,7 +1,5 @@
from django.db import models from django.db import models
from autoslug import AutoSlugField
class Species(models.Model): class Species(models.Model):
common_name = models.CharField(max_length=100) common_name = models.CharField(max_length=100)
@ -9,7 +7,6 @@ class Species(models.Model):
species = models.CharField(max_length=50, blank=True) species = models.CharField(max_length=50, blank=True)
parasite = models.BooleanField(default=False) parasite = models.BooleanField(default=False)
sort_order = models.IntegerField(blank=True, null=True) sort_order = models.IntegerField(blank=True, null=True)
slug = AutoSlugField(populate_from='common_name')
def __str__(self): def __str__(self):
return self.common_name return self.common_name

View file

@ -214,9 +214,6 @@ AUTH_USER_MODEL = 'users.User'
LOGIN_REDIRECT_URL = 'users:redirect' LOGIN_REDIRECT_URL = 'users:redirect'
LOGIN_URL = 'account_login' LOGIN_URL = 'account_login'
# SLUGLIFIER
AUTOSLUG_SLUGIFY_FUNCTION = 'slugify.slugify'
# Location of root django.contrib.admin URL, use {% url 'admin:index' %} # Location of root django.contrib.admin URL, use {% url 'admin:index' %}
ADMIN_URL = r'^admin/' ADMIN_URL = r'^admin/'

View file

@ -18,10 +18,6 @@ psycopg2==2.6.1
# User Registration # User Registration
django-allauth==0.25.2 django-allauth==0.25.2
# Unicode slugification
unicode-slugify==0.1.3
django-autoslug==1.9.3
# Time zones support # Time zones support
pytz==2016.4 pytz==2016.4