Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions server_environment/models/server_env_tech_name_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,18 @@ class ServerEnvTechNameMixin(models.AbstractModel):
This mixin helps solve the problem by providing a tech name field
and a cleanup machinery as well as a unique constrain.

To use this mixin add it to the _inherit attr of your module like:
To use this mixin add it to the _inherit attr of your model like:
(instead of `server.env.mixin`)

_inherit = [
"my.model",
"server.env.techname.mixin",
"server.env.mixin",
]

"""

_name = "server.env.techname.mixin"
_inherit = "server.env.mixin"
_description = "Server environment technical name"
_sql_constraints = [
(
Expand Down
3 changes: 2 additions & 1 deletion server_environment/readme/CONFIGURE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,5 @@ Server environment integration
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Read the documentation of the class `models/server_env_mixin.py
<models/server_env_mixin.py>`_.
<models/server_env_mixin.py>`_ and `models/server_env_tech_name_mixin.py
<models/server_env_tech_name_mixin.py>`_
2 changes: 1 addition & 1 deletion server_environment/readme/USAGE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ If you want to have a technical name to reference::

class StorageBackend(models.Model):
_name = "storage.backend"
_inherit = ["storage.backend", "server.env.techname.mixin", "server.env.mixin"]
_inherit = ["storage.backend", "server.env.techname.mixin"]

[...]