summaryrefslogtreecommitdiffstats
path: root/agenda/forms.py
blob: c8cb28058cad476e7e460d524883d430fc76e519 (plain)
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
from django.db import models
from django.conf import settings
from infopoint.agenda import * 
from infopoint.agenda.models import * 
from infopoint.sites.models import Site
import datetime
from django.contrib.contenttypes import generic
from django.contrib import databrowse
from django.contrib.auth.models import User,Group
from django.contrib.comments.models import Comment,ContentType,User
from django import forms
from django.forms import ModelForm,DateTimeInput
from django.template.loader import render_to_string

from django.contrib import admin

# Create your models here.


class EventForm(ModelForm):
	class Meta:
		model = Event

class RedesForm(ModelForm):
	class Meta:
		model = Network

class GroupAddEventForm(forms.Form):
	group = forms.ModelMultipleChoiceField(queryset=Group.objects.all(),help_text='Send this event information to a group')

class TodoForm(ModelForm):
	class Meta:
		model = Todo

class TodoCompletedForm(forms.Form):
	pass

class TodoCreateForm(forms.Form):
	"""
	Add the tasks that need to be done, even if you plan to do them yourself.
	To have a list of things to be done will be great for sharing the information between the group
	"""
	title = forms.CharField(max_length=100)
	description = forms.CharField(max_length=300,required=False,widget=forms.TextInput(attrs={'size':'40'}))
	due_date = forms.DateField(required=False,widget=forms.DateTimeInput)
	public = forms.BooleanField(required=False)
	group = forms.ModelMultipleChoiceField(queryset=Group.objects.all(), required=False,help_text='Is this task related to a group?')
	event = forms.ModelMultipleChoiceField(queryset=Event.calendar.all(), required=False,help_text='Is this task related to an event?')
	location = forms.ModelMultipleChoiceField(queryset=Location.places.all(), required=False,help_text='Is this task related to a locattion?')


class TodoRelatedCreateForm(forms.Form):
	"""
	Put here the tasks needed to be done before the event...
	"""
	title = forms.CharField(max_length=100)
	public = forms.BooleanField(required=False,help_text='Is this todo public?')
	description = forms.CharField(max_length=300,required=False,widget=forms.TextInput(attrs={'size':'25'}))
	due_date = forms.DateField(required=False,widget=forms.DateTimeInput)



class AttendanceForm(ModelForm):
	class Meta:
		model = Attendance


class ConfirmForm(ModelForm):
	exclude = ['person', 'update', 'event']
        class Meta:
		model = Attendance