diff --git a/core/admin.py b/core/admin.py index 88bd68e..87c812a 100644 --- a/core/admin.py +++ b/core/admin.py @@ -44,7 +44,7 @@ class QMsFoundInline(admin.TabularInline): extra=1 class PhotoInline(admin.TabularInline): - model = Photo + model = DPhoto exclude = ['is_mugshot' ] extra = 1 @@ -104,7 +104,7 @@ class CaveAdmin(TroggleModelAdmin): class EntranceAdmin(TroggleModelAdmin): search_fields = ('caveandentrance__cave__kataster_number',) -admin.site.register(Photo) +admin.site.register(DPhoto) admin.site.register(Cave, CaveAdmin) admin.site.register(Area) #admin.site.register(OtherCaveName) @@ -136,5 +136,5 @@ def export_as_xml(modeladmin, request, queryset): serializers.serialize("xml", queryset, stream=response) return response -admin.site.add_action(export_as_xml) -admin.site.add_action(export_as_json) \ No newline at end of file +#admin.site.add_action(export_as_xml) +#admin.site.add_action(export_as_json) \ No newline at end of file diff --git a/core/models.py b/core/models.py index c60f0ac..64529f1 100644 --- a/core/models.py +++ b/core/models.py @@ -531,7 +531,7 @@ class QM(TroggleModel): return u"%s%s%s" % ('[[QM:',self.code(),']]') photoFileStorage = FileSystemStorage(location=settings.PHOTOS_ROOT, base_url=settings.PHOTOS_URL) -class Photo(TroggleImageModel): +class DPhoto(TroggleImageModel): caption = models.CharField(max_length=1000,blank=True,null=True) contains_logbookentry = models.ForeignKey(LogbookEntry,blank=True,null=True) contains_person = models.ManyToManyField(Person,blank=True,null=True) diff --git a/core/templatetags/wiki_markup.py b/core/templatetags/wiki_markup.py index 3b770a4..810634b 100644 --- a/core/templatetags/wiki_markup.py +++ b/core/templatetags/wiki_markup.py @@ -3,7 +3,7 @@ from django.utils.html import conditional_escape from django.template.defaultfilters import stringfilter from django.utils.safestring import mark_safe from django.conf import settings -from core.models import QM, Photo, LogbookEntry, Cave +from core.models import QM, DPhoto, LogbookEntry, Cave import re, urlparse register = template.Library() @@ -122,7 +122,7 @@ def wiki_to_html_short(value, autoescape=None): linkText=None try: - photo=Photo.objects.get(file=matchdict['photoName']) + photo=DPhoto.objects.get(file=matchdict['photoName']) if not linkText: linkText=str(photo) res=r'' + linkText + '' diff --git a/core/views_logbooks.py b/core/views_logbooks.py index e5cc4e0..0d6aea7 100644 --- a/core/views_logbooks.py +++ b/core/views_logbooks.py @@ -10,7 +10,8 @@ from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect # Django uses Context, not RequestContext when you call render_to_response. We always want to use RequestContext, so that django adds the context from settings.TEMPLATE_CONTEXT_PROCESSORS. This way we automatically get necessary settings variables passed to each template. So we use a custom method, render_response instead of render_to_response. Hopefully future Django releases will make this unnecessary. -from troggle.alwaysUseRequestContext import render_response +from django.shortcuts import render_to_response as render_response +#from troggle.alwaysUseRequestContext import render_response import re diff --git a/core/views_other.py b/core/views_other.py index b2b4a69..78d3bd1 100644 --- a/core/views_other.py +++ b/core/views_other.py @@ -1,4 +1,4 @@ -from troggle.core.models import Cave, Expedition, Person, LogbookEntry, PersonExpedition, PersonTrip, Photo, QM +from troggle.core.models import Cave, Expedition, Person, LogbookEntry, PersonExpedition, PersonTrip, DPhoto, QM from django.conf import settings from django import forms from django.template import loader, Context @@ -28,7 +28,7 @@ def frontpage(request): expeditions = Expedition.objects.order_by("-year") logbookentry = LogbookEntry cave = Cave - photo = Photo + photo = DPhoto from django.contrib.admin.templatetags import log return render_with_context(request,'frontpage.html', locals()) diff --git a/urls.py b/urls.py index 699c448..e20aacd 100644 --- a/urls.py +++ b/urls.py @@ -67,7 +67,7 @@ urlpatterns = patterns('', url(r'^eyecandy$', views_other.eyecandy), (r'^admin/doc/?', include('django.contrib.admindocs.urls')), - (r'^admin/', include(admin.site.urls)), + #(r'^admin/', include(admin.site.urls)), (r'^accounts/', include('registration.urls')), (r'^profiles/', include('profiles.urls')),