doc: dev: Minor example code refactor

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2022-10-01 14:17:31 -07:00 committed by James Valleroy
parent 0e326cfea3
commit 74678c1d69
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808

View File

@ -73,10 +73,9 @@ provide options to the user. Add the following to ``forms.py``.
def __init__(self, *args, **kw):
validator = DirectoryValidator(username=SYSTEM_USER,
check_creatable=True)
super(TransmissionForm,
self).__init__(title=_('Download directory'),
default='/var/lib/transmission-daemon/downloads',
validator=validator, *args, **kw)
super().__init__(title=_('Download directory'),
default='/var/lib/transmission-daemon/downloads',
validator=validator, *args, **kw)
This uses a utility provided by the framework and creates a Django form that
shows a single option to set the download directory for our Transmission app.