Permalink
Browse files

switched editImage views to do lookup by localId instead of uuid

  • Loading branch information...
1 parent 9f0be79 commit aaf7fd3ba28bf67dd5cb042368a1e40771261455 @trey0 trey0 committed Mar 11, 2011
Showing with 10 additions and 11 deletions.
  1. +6 −6 geocamLens/ViewLensAbstract.py
  2. +2 −3 geocamLens/models.py
  3. +2 −2 geocamLens/urls.py
@@ -104,8 +104,8 @@ def getExportSettings(self):
for f in exportedVars))
return json.dumps(exportDict)
- def editImage0(self, request, uuid, template):
- img = self.defaultImageModel.objects.get(uuid = uuid)
+ def editImage0(self, request, id, template):
+ img = self.defaultImageModel.objects.get(id=id)
ajax = request.POST.has_key('ajax')
if request.method == 'POST':
form = EditImageForm(request.POST, instance=img)
@@ -130,11 +130,11 @@ def editImage0(self, request, uuid, template):
form=form),
context_instance = RequestContext(request)))
- def editImage(self, request, uuid):
- return self.editImage0(request, uuid, 'editImage.html')
+ def editImage(self, request, id):
+ return self.editImage0(request, id, 'editImage.html')
- def editImageWrapper(self, request, uuid):
- return self.editImage0(request, uuid, 'editImageWrapper.html')
+ def editImageWrapper(self, request, id):
+ return self.editImage0(request, id, 'editImageWrapper.html')
def uploadImageAuth(self, request):
return self.uploadImage(request, request.user.username)
@@ -134,6 +134,8 @@ class Image(coreModels.PointFeature):
content_type_field='imgType',
object_id_field='imgId')
+ viewerExtension = '.jpg'
+
class Meta:
abstract = True
@@ -203,9 +205,6 @@ def process(self, importFile=None):
self.makeThumbnail(settings.GEOCAM_CORE_DESC_THUMB_SIZE)
# remember to call save() after process()
- def getViewerUrl(self):
- return '%sview/%s/' % (settings.SCRIPT_NAME, self.uuid)
-
def getCaptionHtml(self):
return ''
View
@@ -36,8 +36,8 @@
(r'^upload-m/$', views.uploadImageAuth,
{'challenge': 'basic'}),
- (r'^edit/photo/(?P<uuid>[^/]+)/$', views.editImageWrapper),
- (r'^editWidget/photo/(?P<uuid>[^/]+)/$', views.editImage),
+ (r'^edit/photo/(?P<id>[^/]+)/$', views.editImageWrapper),
+ (r'^editWidget/photo/(?P<id>[^/]+)/$', views.editImage),
# legacy URLs, compatible with the old version of GeoCam
# Mobile *if* user authentication is off (not recommended!).

0 comments on commit aaf7fd3

Please sign in to comment.