File: forms.py

package info (click to toggle)
python-sphinxcontrib-django 2.5-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 608 kB
  • sloc: python: 1,448; makefile: 20; sh: 6
file content (20 lines) | stat: -rw-r--r-- 483 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from __future__ import annotations

from django import forms

from .models import SimpleModel


class SimpleForm(forms.ModelForm):
    test1 = forms.CharField(label="Test1")
    test2 = forms.CharField(help_text="Test2")

    def __init__(self, *args, **kwargs) -> None:
        """
        This is a custom init method
        """
        super().__init__(*args, **kwargs)

    class Meta:
        model = SimpleModel
        fields = ("file", "childA", "childrenB", "dummy_field")