-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathsitemaps.py
172 lines (158 loc) · 4.96 KB
/
sitemaps.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
import datetime
from django.db import models
from django.contrib.sitemaps import *
from django.contrib.auth.models import *
from events.models import *
from django.contrib.sites import *
from datetime import datetime
from django.core.urlresolvers import *
from users.models import *
from django.contrib.sitemaps import *
from django.contrib.auth.models import *
import datetime
from django.db import models
from django.contrib.sitemaps import *
from django.contrib.auth.models import *
from events.models import *
from django.contrib.sites import *
from datetime import datetime
from django.core.urlresolvers import *
from users.models import *
from django.contrib.sitemaps import *
from admin.urls import *
from users.urls import *
from dtvpicker.models import *
from dtvpicker.urls import *
from submissions.urls import *
#For simple urls
class EventSitemap(Sitemap):
changefreq='never'
priority='0.5'
def items(self):
return Event.objects.all()
def lastmod(self,obj):
return obj.updated
def location(self,obj):
return '/'
class SiteSiteMap(Sitemap):
def __init__(self,names):
self.names=names
def items(self):
return self.names
def changefreq(self,obj):
return 'always'
def location(self,obj):
return reverse(obj)
#admin captured parameter urls start
class EditCoreSiteMap(Sitemap):
changefreq='always'
priority='0.5'
def items(self):
allusers=User.objects.all()
returnset=[]
for object in allusers:
profile=UserProfile.objects.filter(id=object.id)
if profile:
if profile.is_core:
returnset.append(object)
return returnset
def location(self,obj):
return '/editcore/'+str(obj.id)
class EditGroupSiteMap(Sitemap):
changefreq='always'
priority='0.5'
def items(self):
allgroups=Group.objects.all()
returnset=[]
for object in allgroups:
returnset.append(object)
return returnset
def location(self,obj):
return '/editgroup/'+str(obj.id)
#admin captured parameter urls end
#users captured parameter urls start
class Register_ActivateSiteMap(Sitemap):#i doubt whether this should be in the sitemap,but just in case!It should be commented out(since keys are revealed)
changefreq='always'
priority='0.5'
def items(self):
allusers=User.objects.all()
returnset=[]
for object in allusers:
profile=UserProfile.objects.filter(id=object.id)
if profile:
if profile:
returnset.append(object)
return returnset
def location(self,obj):
return '/register/activate'+str(obj.get_profile().activation_key)
#users captured parameter urls end
#dtvpicker captured parameter urls start
class AddSubEventSiteMap(Sitemap):
changefreq='always'
priority='0.5'
def items(self):
allevents=Event.objects.all()
returnset=[]
for object in allevents:
returnset.append(object)
return returnset
def location(self,obj):
return '/'+str(obj.title)+'/AddSubEvent/'
class EditSubEventSiteMap(Sitemap):
changefreq='always'
priority='0.5'
def items(self):
allsubevents=SubEvent.objects.all()
returnset=[]
for object in allsubevents:
returnset.append(object)
return returnset
def location(self,obj):
return '/'+str(obj.event.title)+'/EditSubEvent/'+str(obj.title)
class DeleteSubEventSiteMap(Sitemap):
changefreq='always'
priority='0.5'
def items(self):
allsubevents=SubEvent.objects.all()
returnset=[]
for object in allsubevents:
returnset.append(object)
return returnset
def location(self,obj):
return '/'+str(obj.event.title)+'/DeleteSubEvent/'+str(obj.title)
class LockEventSiteMap(Sitemap):
changefreq='always'
priority='0.5'
def items(self):
allevents=Event.objects.all()
returnset=[]
for object in allevents:
returnset.append(object)
return returnset
def location(self,obj):
return '/'+str(obj.title)+'/LockEvent/'
class UnlockEventSiteMap(Sitemap):
changefreq='always'
priority='0.5'
def items(self):
allevents=Event.objects.all()
returnset=[]
for object in allevents:
returnset.append(object)
return returnset
def location(self,obj):
return '/'+str(obj.title)+'/UnlockEvent/'
#dtvpicker captured parameter urls end here
#submissions captured parameter urls start here
class Event_SubmissionSiteMap(Sitemap):
changefreq='always'
priority='0.5'
def items(self):
allevents=Event.objects.all()
returnset=[]
for object in allevents:
returnset.append(object)
return returnset
def location(self,obj):
return '/'+str(obj.id)+'/'
#submissions captured parameter urls end here