/
sitemaps.py
76 lines (62 loc) · 2.73 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
from django.contrib.sitemaps import Sitemap
from django.core.urlresolvers import reverse
import datetime
from lacaravane.models import Document,DocumentItem,Caravane,Video,VideoComment,Site,ContactUs,VideoCategory,MeetingRegistrationForm,ClassifiedFavorite,ClassifiedCategory,ClassifiedDepartment,Classified,ClassifiedAbuse,CaravaneImplantation,CaravaneRegYear,CaravaneBrand,ClassifiedPriceRange,UserCountry,UserTownship,UserProfile,Product,ProductCategory,ProductAbuse,Destocking,DestockingImage,DestockingFavorite,Offer,Createemailalert,OtherSite,Subscription,Meeting
class MainSitemap(Sitemap):
changefreq = "daily"
priority = 1
def items(self):
return ['home', 'documents','doc1','doc2','doc3','doc4','caravans_model','caravans_list','add_template','site_list','contact_us','meeting','previous_meeting','classified','new_classified','view_destock','my_destock','my_destock_list','my_fav_destock',
'add_othersite','othersites','my_fav_product','my_dashboard','my_document','my_caravane','my_meeting','my_classified','myfav_classified','my_video','my_site','my_shop','my_email','forum_view','chat_view','geolocal','geolocal_france','products','add_product','product_home','destock_home','my_dealer_dashboard','history','partner']
def location(self, item):
return reverse(item)
class DocumentSitemap(Sitemap):
changefreq = "daily"
priority =1
def items(self):
return Document.objects.all()
class VideoSitemap(Sitemap):
changefreq = "daily"
priority =1
def items(self):
return VideoCategory.objects.all()
class MeetingSitemap(Sitemap):
changefreq = "daily"
priority =1
def items(self):
return Meeting.objects.all()
def lastmod(self, obj):
return obj.created_at.date()
class ClassifiedCategorySitemap(Sitemap):
changefreq = "daily"
priority =1
def items(self):
return ClassifiedCategory.objects.all()
def lastmod(self, obj):
return obj.created_at.date()
class ClassifiedSitemap(Sitemap):
changefreq = "daily"
priority =1
def items(self):
return Classified.objects.all()
def lastmod(self, obj):
return obj.created_at.date()
class ProductCategorySitemap(Sitemap):
changefreq = "daily"
priority =1
def items(self):
return ProductCategory.objects.all()
class ProductSitemap(Sitemap):
changefreq = "daily"
priority =1
def items(self):
return Product.objects.all()
def lastmod(self, obj):
return obj.created_at.date()
class DestockingSitemap(Sitemap):
changefreq = "daily"
priority =1
def items(self):
return Destocking.objects.all()
def lastmod(self, obj):
return obj.created_at.date()