iommi_demo.app.models ===================== .. py:module:: iommi_demo.app.models .. autoapi-nested-parse:: Models for the demo. Realistically, these should probably be in different files, with models/__init__.py just importing the models from them. Attributes ---------- .. autoapisummary:: iommi_demo.app.models.User Classes ------- .. autoapisummary:: iommi_demo.app.models.Owner iommi_demo.app.models.Cat Module Contents --------------- .. py:data:: User .. py:class:: Owner(*args, **kwargs) Bases: :py:obj:`django.db.models.Model` Owns a cat .. py:attribute:: name .. py:attribute:: user .. py:attribute:: address .. py:method:: __str__() -> str .. py:method:: get_absolute_url() -> str The URL for the detail view of this specific instance. Needs to be kept in sync with `main_menu.py`. :returns: The URL for this instance. .. py:method:: get_absolute_url_if_permitted(user: User) -> str Returns the URL but only if the user can view it. Useful as if Iommi gets a blank URL for e.g. `cell__url` it skips it. :param user: The user to check permissions for. :return: The URL if the user can visit it, otherwise a blank string. .. py:class:: Cat(*args, **kwargs) Bases: :py:obj:`django.db.models.Model` Is a cat .. py:attribute:: name .. py:attribute:: age .. py:attribute:: owner .. py:method:: __str__() -> str .. py:method:: get_absolute_url() -> str The URL for the detail view of this specific instance. Needs to be kept in sync with `main_menu.py`. :returns: The URL for this instance. .. py:method:: get_absolute_url_if_permitted(user: User) -> str Returns the URL but only if the user can view it. Useful as if Iommi gets a blank URL for e.g. `cell__url` it skips it. :param user: The user to check permissions for. :return: The URL if the user can visit it, otherwise a blank string.