1
''' Kind reminders, (please review before editing!)
2
- Forms are for validating input, NOT business logic.
3
- Only include model specific logic in forms if it is required for input.
4
Example: user should be able to select only the groups it is member of.
7
from django import forms
9
from bashoneliners.main.models import OneLiner
18
class PostOneLinerForm(forms.ModelForm):
19
def save(self, hacker):
20
self.instance.hacker = hacker
21
return super(PostOneLinerForm, self).save()
27
'line': forms.Textarea(attrs={'cols': 80, 'rows': 3, }),
28
'summary': forms.Textarea(attrs={'cols': 80, 'rows': 3, }),
29
'explanation': forms.Textarea(attrs={'cols': 80, 'rows': 10, }),
30
'caveats': forms.Textarea(attrs={'cols': 80, 'rows': 3, }),