Merge pull request #2708 from eviljeff/devhub-model-cleanup
HubPromo and HubEvent seem to be unused so removing them.
This commit is contained in:
Коммит
91842b45c7
|
@ -1,15 +1,6 @@
|
|||
from django.contrib import admin
|
||||
|
||||
from .models import HubPromo, HubEvent, ActivityLog
|
||||
|
||||
|
||||
class HubPromoAdmin(admin.ModelAdmin):
|
||||
list_display = ('heading', 'body', 'visibility')
|
||||
list_editable = ('visibility',)
|
||||
|
||||
|
||||
class HubEventAdmin(admin.ModelAdmin):
|
||||
list_display = ('name', 'url', 'location', 'date')
|
||||
from .models import ActivityLog
|
||||
|
||||
|
||||
class HubNewsAdmin(admin.ModelAdmin):
|
||||
|
@ -26,6 +17,4 @@ class HubNewsAdmin(admin.ModelAdmin):
|
|||
def has_delete_permission(self, request, obj=None):
|
||||
return False
|
||||
|
||||
admin.site.register(HubPromo, HubPromoAdmin)
|
||||
admin.site.register(HubEvent, HubEventAdmin)
|
||||
admin.site.register(ActivityLog, HubNewsAdmin)
|
||||
|
|
|
@ -21,7 +21,6 @@ from olympia.bandwagon.models import Collection
|
|||
from olympia.files.models import File
|
||||
from olympia.reviews.models import Review
|
||||
from olympia.tags.models import Tag
|
||||
from olympia.translations.fields import save_signal, TranslatedField
|
||||
from olympia.users.helpers import user_link
|
||||
from olympia.users.models import UserProfile
|
||||
from olympia.versions.models import Version
|
||||
|
@ -48,47 +47,6 @@ class BlogPost(ModelBase):
|
|||
db_table = 'blogposts'
|
||||
|
||||
|
||||
class HubPromo(ModelBase):
|
||||
VISIBILITY_CHOICES = (
|
||||
(0, 'Nobody'),
|
||||
(1, 'Visitors'),
|
||||
(2, 'Developers'),
|
||||
(3, 'Visitors and Developers'),
|
||||
)
|
||||
|
||||
heading = TranslatedField()
|
||||
body = TranslatedField()
|
||||
visibility = models.SmallIntegerField(choices=VISIBILITY_CHOICES)
|
||||
|
||||
class Meta:
|
||||
db_table = 'hubpromos'
|
||||
|
||||
def __unicode__(self):
|
||||
return unicode(self.heading)
|
||||
|
||||
def flush_urls(self):
|
||||
return ['*/developers*']
|
||||
|
||||
models.signals.pre_save.connect(save_signal, sender=HubPromo,
|
||||
dispatch_uid='hubpromo_translations')
|
||||
|
||||
|
||||
class HubEvent(ModelBase):
|
||||
name = models.CharField(max_length=255, default='')
|
||||
url = models.URLField(max_length=255, default='')
|
||||
location = models.CharField(max_length=255, default='')
|
||||
date = models.DateField(default=datetime.now)
|
||||
|
||||
class Meta:
|
||||
db_table = 'hubevents'
|
||||
|
||||
def __unicode__(self):
|
||||
return self.name
|
||||
|
||||
def flush_urls(self):
|
||||
return ['*/developers*']
|
||||
|
||||
|
||||
class AddonLog(ModelBase):
|
||||
"""
|
||||
This table is for indexing the activity log by addon.
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
DROP TABLE hubpromos, hubevents;
|
Загрузка…
Ссылка в новой задаче