euscan-ng/euscanwww/djeuscan/admin.py
volpino 11c234f7f7 euscanwww: Added account profile page
* Added an account profile page
* Added a button to favourite packages
* Implemented models to favourite categories, herds, maintainers but
  still to implement

Signed-off-by: volpino <fox91@anche.no>
2012-06-12 15:27:28 +02:00

55 lines
1.5 KiB
Python

from djeuscan.models import Package, Version, VersionLog, EuscanResult, \
Log, WorldLog, CategoryLog, HerdLog, MaintainerLog, Herd, Maintainer, \
RefreshPackageQuery, HerdAssociation, CategoryAssociation, \
MaintainerAssociation, PackageAssociation
from django.contrib import admin
class EuscanResultAdmin(admin.ModelAdmin):
search_fields = ('package__name', 'package__category')
list_filter = ('datetime', )
ordering = ["-datetime"]
class HerdAdmin(admin.ModelAdmin):
search_fields = ('herd', 'email')
ordering = ["herd"]
class MaintainerAdmin(admin.ModelAdmin):
search_fields = ('name', 'email')
ordering = ["name"]
class PackageAdmin(admin.ModelAdmin):
search_fields = ('category', 'name')
list_filter = ('category', )
class VersionAdmin(admin.ModelAdmin):
search_fields = ('package__name', 'package__category')
list_filter = ('overlay', 'packaged', 'alive')
admin.site.register(Package, PackageAdmin)
admin.site.register(Herd, HerdAdmin)
admin.site.register(Maintainer, MaintainerAdmin)
admin.site.register(Version, VersionAdmin)
admin.site.register(VersionLog)
admin.site.register(EuscanResult, EuscanResultAdmin)
admin.site.register(Log)
admin.site.register(WorldLog)
admin.site.register(CategoryLog)
admin.site.register(HerdLog)
admin.site.register(MaintainerLog)
admin.site.register(RefreshPackageQuery)
admin.site.register(HerdAssociation)
admin.site.register(CategoryAssociation)
admin.site.register(MaintainerAssociation)
admin.site.register(PackageAssociation)