-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathforms.py
97 lines (82 loc) · 3.97 KB
/
forms.py
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
88
89
90
91
92
93
94
95
96
97
from django import forms
from planner.models import Reminder
# class EventForm(forms.ModelForm):
# class Meta:
# model = Event
# fields = ['name', 'status', 'start_date', 'description', 'assigned_to', 'attendees_user',
# 'attendees_contacts', 'attendees_leads']
# start_date = forms.DateTimeField(input_formats=['%m/%d/%Y %H:%M:%S'], error_messages={
# 'invalid': ("Invalid Startdate")}, required=True)
# parent_id = forms.IntegerField(required=False)
# parent_typeChoices = (
# ('Account', 'Account'), ('Lead', 'Lead'), ('Opportunity', 'Opportunity'),
# ('Case', 'Case'))
# parent_type = forms.ChoiceField(choices=parent_typeChoices, error_messages={
# 'invalid': ("Invalid parent_type selected.")}, required=False)
# class TaskEventForm(EventForm):
# class Meta(EventForm.Meta):
# model = Event
# fields = ['priority', 'close_date', 'event_type'] + EventForm.Meta.fields
# parent_typeChoices = (
# ('Account', 'Account'), ('Contact', 'Contact'), ('Lead', 'Lead'), ('Opportunity', 'Opportunity'),
# ('Case', 'Case'))
# parent_type = forms.ChoiceField(choices=parent_typeChoices, error_messages={
# 'invalid': ("Invalid parent_type selected.")}, required=False)
# priority = forms.ChoiceField(choices=(('Low', 'Low'), ('Normal', 'Normal'), ('High', 'High'), ('Urgent', 'Urgent')),
# error_messages={
# 'invalid': ("Invalid Priority selected.")}, required=True) # only tasks
# close_date = forms.DateTimeField(input_formats=['%m/%d/%Y %H:%M:%S'], required=True)
# class CallEventForm(EventForm):
# class Meta(EventForm.Meta):
# model = Event
# fields = ['direction', 'duration', 'event_type'] + EventForm.Meta.fields
# direction = forms.ChoiceField(choices=(('Outbound', 'Outbound'),
# ('Inbound', 'Inbound')), error_messages={
# 'invalid': ("Invalid Direction selected.")}, required=True) # only calls
# duration = forms.ChoiceField(choices=(("300", "5m"),
# ("600", "10m"),
# ("900", "15m"),
# ("1800", "30m"),
# ("2700", "45m"),
# ("3600", "1h"),
# ("7600", "2h")), error_messages={
# 'invalid': ("Invalid Duration selected.")}, required=True) # not for tasks
class ReminderForm(forms.ModelForm):
class Meta:
model = Reminder
fields = "__all__"
reminder_type = forms.ChoiceField(
choices=(("Email", "Email"), ("Popup", "Popup")),
widget=forms.Select(attrs={"class": "form-control input-sm"}),
)
reminder_time = forms.ChoiceField(
choices=(
("0", "on time"),
("60", "1m before"),
("120", "2m before"),
("300", "5m before"),
("600", "10m before"),
("900", "15m before"),
("1800", "30m before"),
("3600", "1h before"),
("7200", "2h before"),
("10800", "3h before"),
("18000", "5h before"),
("86400", "1d before"),
),
widget=forms.Select(attrs={"class": "form-control input-sm"}),
)
# class MeetingEventForm(EventForm):
# class Meta(EventForm.Meta):
# model = Event
# fields = ['duration', 'close_date', 'event_type', ] + EventForm.Meta.fields
# duration = forms.ChoiceField(choices=(
# ("900", "15m"),
# ("1800", "30m"),
# ("3600", "1h"),
# ("7200", "2h"),
# ("10800", "3h"),
# ("86400", "1d")
# ), error_messages={
# 'invalid': ("Invalid Duration selected.")}, required=True) # not for tasks
# close_date = forms.DateTimeField(input_formats=['%m/%d/%Y %H:%M:%S'], required=True)