Make the statistics slug field unique

Signed-off-by: Roberto Rosario <roberto.rosario@mayan-edms.com>
This commit is contained in:
Roberto Rosario
2019-11-15 22:36:35 -04:00
parent f3d01a01b2
commit a9fdd3e654
3 changed files with 22 additions and 1 deletions

View File

@@ -8,6 +8,7 @@
- Move the file patching code from the Dependency class to a
generalized utility of the storages app.
- Add book link to the documentation.
- Make the statistics slug field unique.
3.2.10 (2019-11-19)
===================

View File

@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.25 on 2019-11-16 02:36
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('mayan_statistics', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='statisticresult',
name='slug',
field=models.SlugField(unique=True, verbose_name='Slug'),
),
]

View File

@@ -11,7 +11,7 @@ from django.utils.translation import ugettext_lazy as _
class StatisticResult(models.Model):
# Translators: 'Slug' refers to the URL valid ID of the statistic
# More info: https://docs.djangoproject.com/en/1.7/glossary/#term-slug
slug = models.SlugField(verbose_name=_('Slug'))
slug = models.SlugField(unique=True, verbose_name=_('Slug'))
datetime = models.DateTimeField(
auto_now=True, verbose_name=_('Date time')
)