summaryrefslogtreecommitdiffstats
path: root/agenda/forms.py
diff options
context:
space:
mode:
Diffstat (limited to 'agenda/forms.py')
-rw-r--r--agenda/forms.py37
1 files changed, 24 insertions, 13 deletions
diff --git a/agenda/forms.py b/agenda/forms.py
index c8cb280..bc8a93d 100644
--- a/agenda/forms.py
+++ b/agenda/forms.py
@@ -6,11 +6,13 @@ 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
@@ -20,17 +22,28 @@ from django.contrib import admin
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')
+ group = forms.ModelMultipleChoiceField(queryset=Group.objects.all(),help_text=_('Send this event information to a group'))
class TodoForm(ModelForm):
- class Meta:
- model = Todo
+ class Meta:
+ model = Todo
class TodoCompletedForm(forms.Form):
pass
@@ -44,9 +57,9 @@ class TodoCreateForm(forms.Form):
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?')
+ 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):
@@ -54,11 +67,14 @@ 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?')
+ 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:
@@ -66,11 +82,6 @@ class AttendanceForm(ModelForm):
class ConfirmForm(ModelForm):
- exclude = ['person', 'update', 'event']
class Meta:
model = Attendance
-
-
-
-
-
+ exclude = ['person', 'update', 'event']