core: add slug to application

This commit is contained in:
Jens Langhammer 2018-12-26 17:17:39 +01:00
parent 7178468135
commit 2eae37107d
No known key found for this signature in database
GPG Key ID: BEBC05297D92821B
3 changed files with 22 additions and 1 deletions

View File

@ -12,7 +12,8 @@ class ApplicationForm(forms.ModelForm):
class Meta: class Meta:
model = Application model = Application
fields = ['name', 'launch_url', 'icon_url', 'rules', 'provider', 'skip_authorization'] fields = ['name', 'slug', 'launch_url', 'icon_url',
'rules', 'provider', 'skip_authorization']
widgets = { widgets = {
'name': forms.TextInput(), 'name': forms.TextInput(),
'launch_url': forms.TextInput(), 'launch_url': forms.TextInput(),

View File

@ -0,0 +1,19 @@
# Generated by Django 2.1.4 on 2018-12-26 15:52
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('passbook_core', '0003_invite'),
]
operations = [
migrations.AddField(
model_name='application',
name='slug',
field=models.SlugField(default=''),
preserve_default=False,
),
]

View File

@ -55,6 +55,7 @@ class Application(RuleModel):
add custom fields and other properties""" add custom fields and other properties"""
name = models.TextField() name = models.TextField()
slug = models.SlugField()
launch_url = models.URLField(null=True, blank=True) launch_url = models.URLField(null=True, blank=True)
icon_url = models.TextField(null=True, blank=True) icon_url = models.TextField(null=True, blank=True)
provider = models.OneToOneField('Provider', null=True, provider = models.OneToOneField('Provider', null=True,