Commit 6762a186 by Jocelyn Delalande

Add uniqueness constraint on slugs

Fix #75
parent 7c6fd259
# -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2018-12-29 17:33
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('articles', '0004_auto_20181229_1254'),
]
operations = [
migrations.AlterField(
model_name='article',
name='slug',
field=models.SlugField(unique=True),
),
]
......@@ -24,7 +24,7 @@ class Article(models.Model):
titre = models.CharField(max_length=200)
auteur = models.ForeignKey(auth.models.User, blank=True,
on_delete=models.CASCADE)
slug = models.SlugField()
slug = models.SlugField(unique=True)
pub_date = models.DateTimeField('Date de publication',default=datetime.now)
highlight = models.BooleanField('Mis en valeur dans le ruban',default=False)
chapeau = models.TextField("Chapeau", max_length=1500, blank=True)
......
# -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2018-12-29 17:33
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('texte', '0008_profilauteur_website_text'),
]
operations = [
migrations.AlterField(
model_name='texte',
name='slug',
field=models.SlugField(unique=True),
),
]
......@@ -212,7 +212,7 @@ class Texte(models.Model):
auth.models.User,
blank=True, on_delete=models.CASCADE)
titre = models.CharField(max_length=200)
slug = models.SlugField()
slug = models.SlugField(unique=True)
pub_date = models.DateTimeField('Date de publication',default=datetime.now)
fichier_source = models.FileField(
help_text="Laisser vide pour éditer un nouveau fichier en ligne",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment