summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/blog/admin.py2
-rw-r--r--app/blog/widgets.py2
-rw-r--r--app/guide/models.py2
-rw-r--r--app/locations/admin.py26
-rwxr-xr-xapp/locations/models.py2
-rw-r--r--app/pages/models.py2
-rw-r--r--app/photos/models.py6
-rw-r--r--app/projects/models/__init__.py10
-rw-r--r--app/projects/models/base.py2
-rw-r--r--app/projects/models/code.py2
10 files changed, 39 insertions, 17 deletions
diff --git a/app/blog/admin.py b/app/blog/admin.py
index c0d72d9..d756b18 100644
--- a/app/blog/admin.py
+++ b/app/blog/admin.py
@@ -4,7 +4,7 @@ from blog.models import Entry, PostImage, EntryAside
from blog.widgets import AdminImageWidget
from django.contrib.gis.admin import OSMGeoAdmin
from django.conf import settings
-from models import *
+from .models import *
diff --git a/app/blog/widgets.py b/app/blog/widgets.py
index e7d9da8..33b2d9a 100644
--- a/app/blog/widgets.py
+++ b/app/blog/widgets.py
@@ -7,7 +7,7 @@ import os
def thumbnail(image_path):
absolute_url = os.path.join(settings.IMAGES_URL, image_path[7:])
- print absolute_url
+ print(absolute_url)
return u'<img style="max-width: 400px" src="%s" alt="%s" />' % (absolute_url, image_path)
class AdminImageWidget(AdminFileWidget):
diff --git a/app/guide/models.py b/app/guide/models.py
index 5a2036d..90f63e1 100644
--- a/app/guide/models.py
+++ b/app/guide/models.py
@@ -7,7 +7,7 @@ from django.template.defaultfilters import truncatewords_html
from PIL import Image
-from utils import markdown2 as markdown
+import markdown
from taggit.managers import TaggableManager
from locations.models import Location,Region,Country
from blog.models import Entry
diff --git a/app/locations/admin.py b/app/locations/admin.py
index 0d1c57a..c61d9de 100644
--- a/app/locations/admin.py
+++ b/app/locations/admin.py
@@ -1,6 +1,6 @@
from django.contrib import admin
from django.contrib.gis.admin import OSMGeoAdmin
-from locations.models import Region,Country,Location,State,Route
+from locations.models import Region,Country,Location,State,Route,BirdingLocation
from django.contrib.gis.maps.google import GoogleMap
from django.conf import settings
@@ -293,3 +293,27 @@ class RouteAdmin(OSMGeoAdmin):
# associating the Options with the actual model
admin.site.register(Route,RouteAdmin)
+
+
+class BirdingLocationAdmin(OSMGeoAdmin):
+ list_display = ('name','slug',)
+ prepopulated_fields = {'slug': ('name',)}
+ search_fields = ('name',)
+ ordering = ('name',)
+ save_as = True
+ search_fields = ['name',]
+ list_select_related = True
+ fieldsets = (
+ ('Location', {'fields': ('name','point', 'slug','location'), 'classes': ('show','extrapretty')}),
+ )
+ #options for OSM map Using custom ESRI topo map
+ default_lon = -10909310
+ default_lat = 4650301
+ default_zoom = 4
+ units = True
+ scrollable = False
+ map_width = 700
+ map_height = 425
+ map_template = 'gis/admin/osm.html'
+
+admin.site.register(BirdingLocation,BirdingLocationAdmin)
diff --git a/app/locations/models.py b/app/locations/models.py
index 000105e..bbeb2e0 100755
--- a/app/locations/models.py
+++ b/app/locations/models.py
@@ -159,7 +159,6 @@ class Location(models.Model):
def __unicode__(self): return self.name
-"""
class BirdingLocation(models.Model):
location = models.ForeignKey(Location)
name = models.CharField(max_length=50)
@@ -174,7 +173,6 @@ class BirdingLocation(models.Model):
def __unicode__(self): return self.name
-"""
class Route(models.Model):
name = models.CharField(max_length=200)
diff --git a/app/pages/models.py b/app/pages/models.py
index 198e186..fcc0e5a 100644
--- a/app/pages/models.py
+++ b/app/pages/models.py
@@ -3,7 +3,7 @@ from django.db import models
from django.conf import settings
from django.contrib.sitemaps import Sitemap
-from utils import markdown2 as markdown
+import markdown
def markdown_processor(md):
return markdown.markdown(md, ['footnotes'],safe_mode = False)
diff --git a/app/photos/models.py b/app/photos/models.py
index e64e186..7daae94 100644
--- a/app/photos/models.py
+++ b/app/photos/models.py
@@ -1,10 +1,10 @@
import datetime
-import Image
+from PIL import Image
import os.path
from django.contrib.gis.db import models
from django.contrib.sitemaps import Sitemap
from django.contrib.syndication.views import Feed
-from django.utils.encoding import force_unicode
+from django.utils.encoding import force_text
from django.conf import settings
@@ -48,7 +48,7 @@ class Photo(models.Model):
def admin_thumbnail(self):
- return force_unicode('<a href="%s"><img src="%s"></a>' % \
+ return force_text('<a href="%s"><img src="%s"></a>' % \
(self.get_absolute_url(), self.get_small_square_url()))
admin_thumbnail.allow_tags = True
admin_thumbnail.short_description = 'Thumbnail'
diff --git a/app/projects/models/__init__.py b/app/projects/models/__init__.py
index 19a4f56..ca95ec7 100644
--- a/app/projects/models/__init__.py
+++ b/app/projects/models/__init__.py
@@ -1,5 +1,5 @@
-from base import Project
-from fiveby import FiveBy
-from natparks import NationalParks
-from code import Code, CodeBlogDemo, CodeBlogEntry
-from gifs import AnimatedGif
+from .base import Project
+from .fiveby import FiveBy
+from .natparks import NationalParks
+from .code import Code, CodeBlogDemo, CodeBlogEntry
+from .gifs import AnimatedGif
diff --git a/app/projects/models/base.py b/app/projects/models/base.py
index 23d2af4..26a0122 100644
--- a/app/projects/models/base.py
+++ b/app/projects/models/base.py
@@ -5,7 +5,7 @@ from django.contrib.sitemaps import Sitemap
from django.template.defaultfilters import truncatewords_html
from django.contrib.syndication.views import Feed
-from utils import markdown2 as markdown
+import markdown
from photos.models import PhotoGallery
diff --git a/app/projects/models/code.py b/app/projects/models/code.py
index 19de428..495fc2f 100644
--- a/app/projects/models/code.py
+++ b/app/projects/models/code.py
@@ -1,7 +1,7 @@
import datetime
from django.db import models
-from utils import markdown2 as markdown
+import markdown
PUB_STATUS = (
(0, 'Draft'),
(1, 'Published'),