Code

Ticket #4587: model_meta_admin.patch

File model_meta_admin.patch, 564 bytes (added by yi.codeplayer at gmail dot com, 7 years ago)
  • django/contrib/admin/sites.py

     
    7474        for model in model_or_iterable: 
    7575            if model in self._registry: 
    7676                raise AlreadyRegistered('The model %s is already registered' % model.__class__.__name__) 
     77            model._meta.admin = admin_class 
    7778            self._registry[model] = admin_class(model) 
    7879 
    7980    def unregister(self, model_or_iterable):