use an abstract base model class for services
This commit is contained in:
parent
4e1f40c9c1
commit
25c290b8ae
|
@ -2,11 +2,16 @@ from django.db import models
|
|||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
|
||||
class IdentityProvider(models.Model):
|
||||
class ServiceBase(models.Model):
|
||||
class Meta:
|
||||
abstract = True
|
||||
|
||||
title = models.CharField(_('Title'), max_length=50)
|
||||
slug = models.SlugField()
|
||||
base_url = models.CharField(_('Base URL'), max_length=200)
|
||||
|
||||
|
||||
class IdentityProvider(ServiceBase):
|
||||
class Meta:
|
||||
verbose_name = _('Identity Provider')
|
||||
verbose_name_plural = _('Identity Providers')
|
||||
|
@ -15,11 +20,7 @@ class IdentityProvider(models.Model):
|
|||
service_id = 'idp'
|
||||
|
||||
|
||||
class WebForms(models.Model):
|
||||
title = models.CharField(_('Title'), max_length=50)
|
||||
slug = models.SlugField()
|
||||
base_url = models.CharField(_('Base URL'), max_length=200)
|
||||
|
||||
class WebForms(ServiceBase):
|
||||
class Meta:
|
||||
verbose_name = _('Web Forms')
|
||||
verbose_name_plural = _('Web Forms')
|
||||
|
|
Loading…
Reference in New Issue