mirror of
https://github.com/jazzband/django-constance.git
synced 2026-03-16 22:40:24 +00:00
Add concrete_model class attribute to fake admin model. (#441)
* Add concrete_model class attribute to fake admin model. This is related to #244 and https://github.com/django-admin-tools/django-admin-tools/issues/103. * Set attribute during init.
This commit is contained in:
parent
b30ccb6257
commit
53ac3cd45f
1 changed files with 5 additions and 0 deletions
|
|
@ -185,6 +185,10 @@ class ConstanceAdmin(admin.ModelAdmin):
|
|||
change_list_template = 'admin/constance/change_list.html'
|
||||
change_list_form = ConstanceForm
|
||||
|
||||
def __init__(self, model, admin_site):
|
||||
model._meta.concrete_model = Config
|
||||
super().__init__(model, admin_site)
|
||||
|
||||
def get_urls(self):
|
||||
info = self.model._meta.app_label, self.model._meta.module_name
|
||||
return [
|
||||
|
|
@ -317,6 +321,7 @@ class Config:
|
|||
class Meta:
|
||||
app_label = 'constance'
|
||||
object_name = 'Config'
|
||||
concrete_model = None
|
||||
model_name = module_name = 'config'
|
||||
verbose_name_plural = _('config')
|
||||
abstract = False
|
||||
|
|
|
|||
Loading…
Reference in a new issue