| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- from django.forms import ModelForm, CharField, SlugField
- from .models import ChannelSettings
- class ChannelSettingsForm(ModelForm):
- class Meta:
- model=ChannelSettings
- fields = ['interact']
- #fields='__all__'
- #exclude = ['id'] #Does not need "fields = '__all__'".
- # labels={
- # 'name': '<i class="sitemap icon"></i>Name',
- # 'slug': '<i class="linkify icon"></i>Slug',
- # 'nickname': '<i class="id badge icon"></i>Nickname',
- # 'username': '<i class="id card icon"></i>Username',
- # 'password': '<i class="privacy icon"></i>Password',
- # 'mail': '<i class="envelope icon"></i>NickServ registration E-mail',
- # 'home_channel': '<i class="hashtag icon"></i>Home channel',
- # 'command_character': '<i class="terminal icon"></i>Command character',
- # 'help_character': '<i class="help icon"></i>Help character',
- # 'services': '<i class="lightbulb outline icon"></i>Network services',
- # 'enabled': '<i class="power off icon"></i>Enabled',
- # # 'mute': '<i class="comment slash icon"></i>Mute',
- # }
- # widgets={
- # 'enabled': forms.CheckboxInput(attrs={'_style': 'inverted toggle',}),
- # }
- # class HostForm(ModelForm):
- # class Meta:
- # model=Host
- # exclude=['network', 'connection_attempts', 'connection_succeeds']
- # labels={
- # 'address': '<i class="server icon"></i>Address',
- # 'port': '<i class="dungeon icon"></i>Port',
- # 'ssl': '<i class="lock icon"></i>Use SSL',
- # }
- # widgets={
- # 'ssl': forms.CheckboxInput(attrs={'_style': 'inverted toggle',}),
- # }
- # layout = [
- # ('Four Fields',
- # ('Field', 'address'),
- # ('Field', 'port'),
- # ('Field', 'ssl'),
- # ('Field', 'DELETE'),
- # )
- # ]
- # class OwnerForm(ModelForm):
- # class Meta:
- # model=Owner
- # exclude=['network',]
- # labels={
- # 'hostmask': '<i class="fingerprint icon"></i>Owner hostmask',
- # }
- # layout = [
- # ('Two Fields',
- # ('Field', 'hostmask'),
- # ('Field', 'DELETE'),
- # )
- # ]
- # class ChannelForm(ModelForm):
- # class Meta:
- # model=Channel
- # fields=['autojoin', 'statistic_commands', 'games', 'chat']
- # labels={
- # 'autojoin': '<i class="power icon"></i>Auto join',
- # 'statistic_commands': '<i class="chart pie icon"></i>Statistic commands',
- # 'chat': '<i class="comment dots icon"></i>Chat',
- # 'games': '<i class="gamepad icon"></i>Games',
- # }
- # widgets={
- # 'autojoin': forms.CheckboxInput(attrs={'_style': 'inverted toggle'}),
- # 'statistic_commands': forms.CheckboxInput(attrs={'_style': 'inverted toggle'}),
- # 'chat': forms.CheckboxInput(attrs={'_style': 'inverted toggle'}),
- # 'games': forms.CheckboxInput(attrs={'_style': 'inverted toggle'}),
- # }
- # class CurseWordForm(ModelForm):
- # class Meta:
- # model=CurseWord
- # fields={'content'}
- # labels={
- # 'content': '<i class="book dead icon"></i>Curse word'
- # }
- # widgets={
- # 'content': forms.TextInput(attrs={'_no_required': 'True'}),
- # }
- # class AdjectiveForm(ModelForm):
- # class Meta:
- # model=Adjective
- # fields={'content'}
- # labels={
- # 'content': '<i class="book dead icon"></i>Adjective'
- # }
- # widgets={
- # 'content': forms.TextInput(attrs={'_no_required': 'True'}),
- # }
|