add hostingpackages api doc

- add to docs/code.rst toctree
- add new docs/code/hostingpackages.rst containing the autodoc directives
- document undocumented code in hostingpackages app
- update translation templates
This commit is contained in:
Jan Dittberner 2015-01-18 13:37:21 +01:00
parent 12455e2d99
commit 4f2ebbae63
6 changed files with 87 additions and 18 deletions

View file

@ -144,8 +144,28 @@ class MailboxOption(MailboxOptionBase, HostingOption):
class CustomerHostingPackageManager(models.Manager):
"""
This is the default manager implementation for
:py:class:`CustomerHostingPackage`.
"""
def create_from_template(self, customer, template, name, **kwargs):
"""
Use this method to create a new :py:class:`CustomerHostingPackage` from
a :py:class:`HostingPackageTemplate`.
The method copies data from the template to the new
:py:class:`CustomerHostingPackage` instance.
:param customer: a Django user representing a customer
:param template: a :py:class:`HostingPackageTemplate`
:param str name: the name of the hosting package there must only be
one hosting package of this name for each customer
:return: customer hosting package
:rtype: :py:class:`CustomerHostingPackage`
"""
package = CustomerHostingPackage(
customer=customer, template=template, name=name)
for attrname in ('description', 'diskspace', 'diskspace_unit',