comparison apps/bundle/forms.py @ 184:b711f0087709

Use DESCRIPTION file for bundles (SCHEMA CHANGE) * Added two new fields to the Bundle model: * octave_format, which allows users to specify if their bundle has been formatted according to octave packaging standards or not * description_file, which points to a file named DESCRIPTION in the root directory (or the next top-level directory), if the octave_format checkbox is ticked and if one exists * Fixed the uploader field for form by making it a hidden input and preventing hidden inputs from showing up entirely
author dellsystem <ilostwaldo@gmail.com>
date Sat, 27 Oct 2012 15:58:08 -0400
parents cdcbfaa65cfe
children ff9c95239c3a
comparison
equal deleted inserted replaced
183:cdcbfaa65cfe 184:b711f0087709
6 class BundleForm(forms.ModelForm): 6 class BundleForm(forms.ModelForm):
7 class Meta: 7 class Meta:
8 model = Bundle 8 model = Bundle
9 fields = ('uploader', 'name', 'description', 'free_license', 9 fields = ('uploader', 'name', 'description', 'free_license',
10 'octave_format') 10 'octave_format')
11 widgets = {
12 # Ideally, the uploader field should just not show up at all
13 # Not really possible if we want to validate the name
14 # This is the next best option (hidden fields just aren't shown)
15 'uploader': forms.HiddenInput,
16 }
11 17
12 file = forms.FileField(help_text=("Upload a plain text file or an \ 18 file = forms.FileField(help_text=("Upload a plain text file or an \
13 archive file.")) 19 archive file."))
14 20
15 def clean(self): 21 def clean(self):