Skip to content
This repository has been archived by the owner on Oct 5, 2021. It is now read-only.

Commit

Permalink
Merge pull request #256 from Pal0r/fix_service_admin_form
Browse files Browse the repository at this point in the history
Fixes ServicesActivated admin form status field default & display
  • Loading branch information
foxmask committed Oct 17, 2017
2 parents 38b2d85 + 845b291 commit ca2a99a
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions django_th/forms/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,16 @@ class ServicesAdminForm(forms.ModelForm):
"""
class Meta:
model = ServicesActivated
exclude = ()

status_values = ((0, 'Disabled'), (1, 'Enabled'))
status = forms.ChoiceField(status_values)
fields = '__all__'

status_values = ((False, 'Disabled'), (True, 'Enabled'))
status = forms.ChoiceField(
choices=status_values,
label="Status",
initial='',
widget=forms.Select(),
required=True
)
name = forms.ChoiceField(available_services())

# todo : set the value of status when editing the object

0 comments on commit ca2a99a

Please sign in to comment.