Remove `Clef` Model
This commit is contained in:
parent
0f0e5fcd25
commit
87063e267e
|
@ -106,10 +106,6 @@ bureau
|
||||||
users | Can add adhesion
|
users | Can add adhesion
|
||||||
users | Can change adhesion
|
users | Can change adhesion
|
||||||
users | Can delete adhesion
|
users | Can delete adhesion
|
||||||
users | Can view clef
|
|
||||||
users | Can add clef
|
|
||||||
users | Can change clef
|
|
||||||
users | Can delete clef
|
|
||||||
users | Can view user
|
users | Can view user
|
||||||
users | Can add user
|
users | Can add user
|
||||||
users | Can change user
|
users | Can change user
|
||||||
|
@ -134,7 +130,6 @@ keyholder
|
||||||
media | Can change borrowed item
|
media | Can change borrowed item
|
||||||
media | Can delete borrowed item
|
media | Can delete borrowed item
|
||||||
users | Can view user
|
users | Can view user
|
||||||
users | Can view clef
|
|
||||||
|
|
||||||
users (default group for everyone)
|
users (default group for everyone)
|
||||||
media | Can view author
|
media | Can view author
|
||||||
|
|
|
@ -13,14 +13,7 @@ from reversion.admin import VersionAdmin
|
||||||
|
|
||||||
from med.admin import admin_site
|
from med.admin import admin_site
|
||||||
from .forms import UserCreationAdminForm
|
from .forms import UserCreationAdminForm
|
||||||
from .models import Adhesion, Clef, User
|
from .models import Adhesion, User
|
||||||
|
|
||||||
|
|
||||||
class ClefAdmin(VersionAdmin):
|
|
||||||
list_display = ('name', 'owner', 'comment')
|
|
||||||
ordering = ('name',)
|
|
||||||
search_fields = ('name', 'owner__username', 'comment')
|
|
||||||
autocomplete_fields = ('owner',)
|
|
||||||
|
|
||||||
|
|
||||||
class AdhesionAdmin(VersionAdmin):
|
class AdhesionAdmin(VersionAdmin):
|
||||||
|
@ -116,4 +109,3 @@ class UserAdmin(VersionAdmin, BaseUserAdmin):
|
||||||
|
|
||||||
admin_site.register(User, UserAdmin)
|
admin_site.register(User, UserAdmin)
|
||||||
admin_site.register(Adhesion, AdhesionAdmin)
|
admin_site.register(Adhesion, AdhesionAdmin)
|
||||||
admin_site.register(Clef, ClefAdmin)
|
|
||||||
|
|
|
@ -50,31 +50,6 @@ class User(AbstractUser):
|
||||||
return last_year and self in last_year.members.all()
|
return last_year and self in last_year.members.all()
|
||||||
|
|
||||||
|
|
||||||
class Clef(models.Model):
|
|
||||||
name = models.CharField(
|
|
||||||
verbose_name=_('name'),
|
|
||||||
max_length=255,
|
|
||||||
unique=True,
|
|
||||||
)
|
|
||||||
owner = models.ForeignKey(
|
|
||||||
'User',
|
|
||||||
on_delete=models.PROTECT,
|
|
||||||
verbose_name=_('owner'),
|
|
||||||
blank=True,
|
|
||||||
null=True,
|
|
||||||
)
|
|
||||||
comment = models.CharField(
|
|
||||||
verbose_name=_('comment'),
|
|
||||||
max_length=255,
|
|
||||||
null=True,
|
|
||||||
blank=True,
|
|
||||||
)
|
|
||||||
|
|
||||||
class Meta:
|
|
||||||
verbose_name = _('key')
|
|
||||||
verbose_name_plural = _('keys')
|
|
||||||
|
|
||||||
|
|
||||||
class Adhesion(models.Model):
|
class Adhesion(models.Model):
|
||||||
starting_in = models.IntegerField(
|
starting_in = models.IntegerField(
|
||||||
verbose_name=_('starting in'),
|
verbose_name=_('starting in'),
|
||||||
|
|
Loading…
Reference in New Issue