/usr/lib/python2.7/dist-packages/metadataserver/admin.py is in python-django-maas 1.5+bzr2252-0ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | # Copyright 2014 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Register models with Django.
We used to do this directly from `models/__init__.py`, as a side effect of
importing from that package, but it led to `AlreadyRegistered` errors when
running some tests in isolation (even when the import only happened once).
Django automatically discovers the `admin` module and ensures that models are
only registered once.
"""
from __future__ import (
absolute_import,
print_function,
unicode_literals,
)
str = None
__metaclass__ = type
__all__ = []
from django.contrib import admin
from django.db.models import (
get_app,
get_models,
)
# Register models in the admin site. When the DEBUG setting is enabled, the
# webapp will serve an administrator UI at /admin.
for model in get_models(get_app('metadataserver')):
admin.site.register(model)
|