mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
805892f623
* Clean up & comment base templates * Clean up login template & form * Use SVG file for NetBox logo * Simplify breadcrumbs * Merge changelog.html into home.html * Rename title_container block to header * Move breadcrumbs block to object.html * Attach names to endblock template tags * Reorganize root-level templates into base/ and inc/ * Remove obsolete reference to Bootstrap 3.4.1
30 lines
749 B
Python
30 lines
749 B
Python
from django import forms
|
|
from django.contrib.auth.forms import AuthenticationForm, PasswordChangeForm as DjangoPasswordChangeForm
|
|
|
|
from utilities.forms import BootstrapMixin, DateTimePicker
|
|
from .models import Token
|
|
|
|
|
|
class LoginForm(BootstrapMixin, AuthenticationForm):
|
|
pass
|
|
|
|
|
|
class PasswordChangeForm(BootstrapMixin, DjangoPasswordChangeForm):
|
|
pass
|
|
|
|
|
|
class TokenForm(BootstrapMixin, forms.ModelForm):
|
|
key = forms.CharField(
|
|
required=False,
|
|
help_text="If no key is provided, one will be generated automatically."
|
|
)
|
|
|
|
class Meta:
|
|
model = Token
|
|
fields = [
|
|
'key', 'write_enabled', 'expires', 'description',
|
|
]
|
|
widgets = {
|
|
'expires': DateTimePicker(),
|
|
}
|