summaryrefslogtreecommitdiffstats
path: root/agenda/forms.py
blob: bc8a93db5369896f46f69e5f73179f0a6a51754b (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
77
78
79
80
81
82
83
84
85
86
87
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.admin import widgets
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.utils.translation import ugettext as _

from django.contrib import admin

# Create your models here.


class EventForm(ModelForm):
	class Meta:
		model = Event
class SubmitEventForm(EventForm):
	class Meta:
		model = Event
		exclude = ['site', 'atendees', 'redes', 'isrecurrenceof']

class NewEventForm(ModelForm):
	class Meta:
		model = Event
		exclude = ['site', 'start_date', 'end_date', 'pixie', 'atendees', 'redes']
class NewEventRestrictedForm(NewEventForm):
	pass

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 DateForm(forms.Form):
	start_date = forms.DateField(widget=widgets.AdminSplitDateTime)
	end_date = forms.DateField(widget=widgets.AdminSplitDateTime)

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


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