-
Notifications
You must be signed in to change notification settings - Fork 40
Expand file tree
/
Copy pathforms.py
More file actions
47 lines (34 loc) · 1.15 KB
/
forms.py
File metadata and controls
47 lines (34 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
from django import forms
from .models import *
from django.contrib.auth.models import User
from . import models
class Questionform(forms.ModelForm):
title = models.CharField(max_length=100)
description = models.TextField(blank=True, null=True)
visibility = models.BooleanField(max_length=10, default=True)
class Meta:
model = Questions
fields = ('title', 'description', 'visibility')
class Tagsform(forms.ModelForm):
name = models.CharField(max_length=100, null=True, blank=True)
class Meta:
model = Tags
fields = ('name',)
class Taggingform(forms.ModelForm):
class Meta:
model = Taggings
fields = ('question', 'tag')
class Answerform(forms.ModelForm):
description = models.TextField()
class Meta:
model = Answers
fields = ('description',)
class Commentform(forms.ModelForm):
body = models.TextField()
class Meta:
model = Comments
fields = ('body',)
class CreateMember(forms.ModelForm):
class Meta:
model = models.Members
fields=['name','year','position','branch','contact_details','experience']