summaryrefslogtreecommitdiff
path: root/app/notes
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2016-06-17 10:21:26 -0400
committerluxagraf <sng@luxagraf.net>2016-06-17 10:21:26 -0400
commitb658d4b38f1aab3ed1bdc629300392c1b3e9e8fa (patch)
tree28eefd84cd586f23f1b1e7d96c4b58c229b7e183 /app/notes
parentcec274a4b7de8e07a3d7dc29127ba18f0dd42305 (diff)
fixed notes to be like an instagram for the web also tweaked styles for
picwide captions and added support for show camera make, model and lens
Diffstat (limited to 'app/notes')
-rw-r--r--app/notes/admin.py3
-rw-r--r--app/notes/migrations/0004_auto_20160616_1444.py27
-rw-r--r--app/notes/migrations/0005_auto_20160616_1445.py20
-rw-r--r--app/notes/models.py6
4 files changed, 53 insertions, 3 deletions
diff --git a/app/notes/admin.py b/app/notes/admin.py
index 3e15be2..e84b7a0 100644
--- a/app/notes/admin.py
+++ b/app/notes/admin.py
@@ -2,11 +2,10 @@ from django.contrib import admin
from django.contrib.gis.admin import OSMGeoAdmin
from notes.models import Note, LuxNote
-from utils.widgets import AdminImageWidget, LGEntryForm, LGEntryFormSmall, OLAdminBase
+from utils.widgets import LGEntryForm, OLAdminBase
class LuxNoteAdmin(OLAdminBase):
- form = LGEntryFormSmall
prepopulated_fields = {"slug": ('title',)}
list_display = ('slug', 'pub_date', 'location')
fieldsets = (
diff --git a/app/notes/migrations/0004_auto_20160616_1444.py b/app/notes/migrations/0004_auto_20160616_1444.py
new file mode 100644
index 0000000..76b1f3a
--- /dev/null
+++ b/app/notes/migrations/0004_auto_20160616_1444.py
@@ -0,0 +1,27 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9 on 2016-06-16 14:44
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+import django.utils.timezone
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('photos', '0010_auto_20160517_0906'),
+ ('notes', '0003_auto_20160208_1120'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='luxnote',
+ name='images',
+ field=models.ManyToManyField(to='photos.LuxImage'),
+ ),
+ migrations.AlterField(
+ model_name='luxnote',
+ name='pub_date',
+ field=models.DateTimeField(default=django.utils.timezone.now),
+ ),
+ ]
diff --git a/app/notes/migrations/0005_auto_20160616_1445.py b/app/notes/migrations/0005_auto_20160616_1445.py
new file mode 100644
index 0000000..129bbc2
--- /dev/null
+++ b/app/notes/migrations/0005_auto_20160616_1445.py
@@ -0,0 +1,20 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9 on 2016-06-16 14:45
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('notes', '0004_auto_20160616_1444'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='luxnote',
+ name='images',
+ field=models.ManyToManyField(blank=True, null=True, to='photos.LuxImage'),
+ ),
+ ]
diff --git a/app/notes/models.py b/app/notes/models.py
index 775c78c..1acf966 100644
--- a/app/notes/models.py
+++ b/app/notes/models.py
@@ -17,6 +17,8 @@ import markdown
from utils.widgets import markdown_to_html
from daily.models import CheckIn
+from photos.models import LuxImage
+from jrnl.models import render_images
def twitter_truncate(txt):
@@ -32,6 +34,7 @@ class LuxNote(models.Model):
body_markdown = models.TextField('Note')
point = models.PointField(blank=True, null=True)
location = models.ForeignKey(Location, blank=True, null=True)
+ images = models.ManyToManyField(LuxImage, blank=True, null=True)
def __str__(self):
return self.title
@@ -63,7 +66,8 @@ class LuxNote(models.Model):
def save(self, *args, **kwargs):
- self.body_html = markdown_to_html(self.body_markdown)
+ md = render_images(self.body_markdown)
+ self.body_html = markdown_to_html(md)
if not self.point:
self.point = CheckIn.objects.latest().point
try: