admin.py 754 B

123456789101112131415161718192021222324
  1. # -*- coding: utf-8 -*-
  2. from __future__ import unicode_literals
  3. from django.contrib import admin
  4. from polymorphic.admin import PolymorphicChildModelAdmin
  5. from coin.configuration.admin import ConfigurationAdminFormMixin
  6. from simple_dsl.models import SimpleDSL
  7. class SimpleDSLInline(admin.StackedInline):
  8. model = SimpleDSL
  9. class SimpleDSLAdmin(ConfigurationAdminFormMixin, PolymorphicChildModelAdmin):
  10. base_model = SimpleDSL
  11. # Used for form inclusion (when browsing a subscription object in the
  12. # admin, SimpleDSLInline will be displayed)
  13. inline = SimpleDSLInline
  14. # Since we don't provide a view, don't display a "view on site" link
  15. # in the admin.
  16. view_on_site = False
  17. admin.site.register(SimpleDSL, SimpleDSLAdmin)