diff --git a/databaseReset.py b/databaseReset.py index 5503104..77a7b8a 100644 --- a/databaseReset.py +++ b/databaseReset.py @@ -47,6 +47,7 @@ def import_QMs(): def import_surveys(): import parsers.surveys + parsers.surveys.parseSurveys(logfile=settings.LOGFILE) def reset(): reload_db() diff --git a/expo/imagekit_specs.py b/expo/imagekit_specs.py index 243cb9f..fd2e0a1 100644 --- a/expo/imagekit_specs.py +++ b/expo/imagekit_specs.py @@ -3,20 +3,19 @@ from imagekit import processors class ResizeThumb(processors.Resize): width = 100 - height = 75 - crop = True + crop = False class ResizeDisplay(processors.Resize): width = 600 -class EnhanceThumb(processors.Adjustment): - contrast = 1.2 - sharpness = 1.1 +#class EnhanceThumb(processors.Adjustment): + #contrast = 1.2 + #sharpness = 2 class Thumbnail(ImageSpec): access_as = 'thumbnail_image' pre_cache = True - processors = [ResizeThumb, EnhanceThumb] + processors = [ResizeThumb] class Display(ImageSpec): increment_count = True diff --git a/expo/models.py b/expo/models.py index 4c8332b..74a26d4 100644 --- a/expo/models.py +++ b/expo/models.py @@ -17,8 +17,11 @@ from models_survex import * class TroggleModel(models.Model): new_since_parsing = models.BooleanField(default=False, editable=False) + def object_name(self): + return self._meta.object_name + def get_admin_url(self): - return settings.URL_ROOT + "/admin/expo/" + self._meta.object_name.lower() + "/" + str(self.pk) + return settings.URL_ROOT + "/admin/expo/" + self.object_name.lower() + "/" + str(self.pk) class Meta: abstract = True @@ -26,8 +29,11 @@ class TroggleModel(models.Model): class TroggleImageModel(ImageModel): new_since_parsing = models.BooleanField(default=False, editable=False) + def object_name(self): + return self._meta.object_name + def get_admin_url(self): - return settings.URL_ROOT + "/admin/expo/" + self._meta.object_name.lower() + "/" + str(self.pk) + return settings.URL_ROOT + "/admin/expo/" + self.object_name.lower() + "/" + str(self.pk) class Meta: abstract = True @@ -42,7 +48,7 @@ class Expedition(TroggleModel): return self.year class Meta: - ordering = ('year',) + ordering = ('-year',) get_latest_by = 'date_from' def get_absolute_url(self): diff --git a/settings.py b/settings.py index 6b878ee..e99d199 100644 --- a/settings.py +++ b/settings.py @@ -1,3 +1,4 @@ +from localsettings import * import os import urlparse # Django settings for troggle project. @@ -35,11 +36,10 @@ USE_I18N = True ADMIN_MEDIA_PREFIX = '/troggle/media-admin/' PHOTOS_ROOT = os.path.join(EXPOWEB, 'photos') -if URL_ROOT: - MEDIA_URL = urlparse.urljoin(URL_ROOT , '/site_media/') - SURVEYS_URL = urlparse.urljoin(URL_ROOT , '/survey_scans/') - PHOTOS_URL = urlparse.urljoin(URL_ROOT , '/photos/') - SVX_URL = urlparse.urljoin(URL_ROOT , '/survex/') +MEDIA_URL = urlparse.urljoin(URL_ROOT , '/site_media/') +SURVEYS_URL = urlparse.urljoin(URL_ROOT , '/survey_scans/') +PHOTOS_URL = urlparse.urljoin(URL_ROOT , '/photos/') +SVX_URL = urlparse.urljoin(URL_ROOT , '/survex/') APPEND_SLASH = False SMART_APPEND_SLASH = True @@ -86,6 +86,4 @@ INSTALLED_APPS = ( 'troggle.profiles', 'troggle.expo', 'troggle.imagekit', -) - -from localsettings import * \ No newline at end of file +) \ No newline at end of file diff --git a/templates/object_list.html b/templates/object_list.html new file mode 100644 index 0000000..4021ad2 --- /dev/null +++ b/templates/object_list.html @@ -0,0 +1,15 @@ +{% extends "base.html" %} +{% load link %} +{% block title %}Troggle: all {{object_list.1.meta.object_name}} objects{%endblock%} + +{% block contentheader %} +