mirror of
https://github.com/tjsga/studyguides.git
synced 2025-04-18 17:40:17 -04:00
edit tags to have display name and identifying url
This commit is contained in:
parent
5d680462f4
commit
1342505783
|
@ -0,0 +1,24 @@
|
||||||
|
# Generated by Django 3.1.2 on 2020-11-04 20:57
|
||||||
|
|
||||||
|
import django.core.validators
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('courses', '0007_auto_20201027_1250'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='tag',
|
||||||
|
name='url',
|
||||||
|
field=models.SlugField(max_length=100, null=True, unique=True, validators=[django.core.validators.RegexValidator(message='Only lowercase alphanumeric, dashes, and underscores allowed', regex='^[a-z0-9_\\-]+$')]),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='tag',
|
||||||
|
name='name',
|
||||||
|
field=models.CharField(max_length=100, unique=True),
|
||||||
|
),
|
||||||
|
]
|
|
@ -37,7 +37,8 @@ class Guide(models.Model):
|
||||||
|
|
||||||
class Tag(models.Model):
|
class Tag(models.Model):
|
||||||
id = models.AutoField(primary_key=True)
|
id = models.AutoField(primary_key=True)
|
||||||
name = models.SlugField(max_length=100, unique=True, validators=[RegexValidator(
|
name = models.CharField(max_length=100, unique=True)
|
||||||
|
url = models.SlugField(max_length=100, unique=True, null=True, validators=[RegexValidator(
|
||||||
regex="^[a-z0-9_\-]+$", message="Only lowercase alphanumeric, dashes, and underscores allowed")])
|
regex="^[a-z0-9_\-]+$", message="Only lowercase alphanumeric, dashes, and underscores allowed")])
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user