move admin stuff to its own file
This commit is contained in:
Родитель
394e5fcc35
Коммит
96e93e959e
|
@ -0,0 +1,22 @@
|
|||
from django import forms
|
||||
from django.contrib import admin
|
||||
|
||||
from .models import Addon, BlacklistedGuid
|
||||
|
||||
|
||||
class AddonForm(forms.ModelForm):
|
||||
|
||||
class Meta:
|
||||
model = Addon
|
||||
|
||||
def clean(self):
|
||||
return self.cleaned_data
|
||||
|
||||
|
||||
class AddonAdmin(admin.ModelAdmin):
|
||||
form = AddonForm
|
||||
raw_id_fields = ('users',)
|
||||
|
||||
|
||||
admin.site.register(BlacklistedGuid)
|
||||
admin.site.register(Addon, AddonAdmin)
|
|
@ -1,7 +1,6 @@
|
|||
from datetime import datetime
|
||||
|
||||
from django.conf import settings
|
||||
from django.contrib import admin
|
||||
from django.db import models
|
||||
|
||||
import amo
|
||||
|
@ -122,6 +121,3 @@ class BlacklistedGuid(models.Model):
|
|||
|
||||
def __unicode__(self):
|
||||
return self.guid
|
||||
|
||||
|
||||
admin.site.register(BlacklistedGuid)
|
||||
|
|
Загрузка…
Ссылка в новой задаче