From a6d95991f82f6a9a110a3c5e323c7f8d4ab4b3f3 Mon Sep 17 00:00:00 2001 From: "luxagraf@c63593aa-01b0-44d9-8516-4b9c7e931d7f" Date: Fri, 23 Apr 2010 01:54:13 +0000 Subject: fixed 404 template and photo importing script --- apps/photos/utils.py | 28 ++++++++++++++----------- cron/sync_photo_sets.py | 2 +- templates/404.html | 23 ++++++++++++++------ templates/base.html | 1 + templates/contact_form/contact_form.txt | 6 +++--- templates/contact_form/contact_form_subject.txt | 2 +- 6 files changed, 39 insertions(+), 23 deletions(-) diff --git a/apps/photos/utils.py b/apps/photos/utils.py index 0e69c4e..b3d8be1 100644 --- a/apps/photos/utils.py +++ b/apps/photos/utils.py @@ -252,18 +252,22 @@ def sync_sets(*args, **kwargs): # okay it already exists, but is it up-to-date? #get_photos_in_set(row,set.id) - except ObjectDoesNotExist: - s = PhotoGallery.objects.create ( - set_id = force_unicode(info['id']), - set_title = force_unicode(post.findtext('title')), - set_desc = force_unicode(post.findtext('description')), - set_slug = slugify(force_unicode(post.findtext('title'))), - primary = force_unicode(info['primary']), - ) - get_photos_in_set(s) - #create the gallery thumbnail image: - photo = Photo.objects.get(flickr_id__exact=str(info['primary'])) - make_gallery_thumb(photo,s) + except ObjectDoesNotExist: + disregard = ['POTD 2008','Snow Day','Wedding','Some random stuff'] + if force_unicode(post.findtext('title')) in disregard: + pass + else: + s = PhotoGallery.objects.create ( + set_id = force_unicode(info['id']), + set_title = force_unicode(post.findtext('title')), + set_desc = force_unicode(post.findtext('description')), + set_slug = slugify(force_unicode(post.findtext('title'))), + primary = force_unicode(info['primary']), + ) + get_photos_in_set(s) + #create the gallery thumbnail image: + photo = Photo.objects.get(flickr_id__exact=str(info['primary'])) + make_gallery_thumb(photo,s) def get_photos_in_set(set): BASE_PATH = 'http://flickr.com/services/rest/' diff --git a/cron/sync_photo_sets.py b/cron/sync_photo_sets.py index c8b67df..6fec651 100644 --- a/cron/sync_photo_sets.py +++ b/cron/sync_photo_sets.py @@ -8,4 +8,4 @@ sys.path.append('/home/luxagraf/webapps/django/lib/python2.5/') os.environ['DJANGO_SETTINGS_MODULE'] = 'settings' from photos import utils -utils.sync_flickr_photos() \ No newline at end of file +utils.sync_sets() \ No newline at end of file diff --git a/templates/404.html b/templates/404.html index d3db4f8..54826c8 100644 --- a/templates/404.html +++ b/templates/404.html @@ -2,29 +2,40 @@ {% load typogrify %} {% block pagetitle %}Luxagraf | Error 404 {% endblock %} - +{%block bodyid%}id="writing-detail" class="single"{%endblock%} {% block title %}404 Page Not Found{% endblock %} {% block primary %}
-

Error 404 – Page Not Found

+ +
+

Error 404 – Page Not Found

+ +
+
+ -

Oh my god you broke the internet.

+

Al Gore is pissed.

-

So is the hamster

+

So is the hamster.

This is probably because of one or more of the following:

The hamster who fetches these pages has stepped out for a smoke break (he earns extra travel money over at the Philip Morris Labs where he poses as a rat and gets paid under the table).

The hamster who fetches these pages is actually at Phillip Morris Labs working right now in which case you'll just have to wait until he comes back here.

The hamster who fetches the pages finally made enough extra travel money working nights at the Philip Morris Labs to actually travel and is no longer running this site at all, in fact he's sipping Mai Tai's in Indonesia even as we speak, laughing that semi-sinister but always endearing high pitched squeak of a laugh.

The hamster may be innocent. Perhaps I was drunk and left the page in the back of a cab.

-

Wait, why is this our fault? Why are you so quick to blame the hamster? This could be your fault. You might have man hands or thick, clumsy fingers or that led you to type the wrong address. Or you might just be an idiot. Or you might be following the links of an idiot. See what happens when you visit other sites? Keep it simple, make the hamster happy. Limit your internet usage to luxagraf only.

-

Of course its possible that you're ahead of me and the page simply hasn't been invented yet, which makes you a genius. And explains why the hamster couldn't find it.

+

Wait, why is this our fault? Why are you so quick to blame the hamster? This could be your fault. You might have man hands or thick, clumsy fingers that led you to type the wrong address. Or you might just be an idiot. Or you might be following the links of an idiot. See what happens when you visit other sites? Keep it simple, make the hamster happy. Limit your internet usage to luxagraf only.

+

Of course it's also possible that you're ahead of me and the page simply hasn't been invented yet, which makes you a genius. And explains why the hamster couldn't find it.

It's also entirely possible that the page exists but the hamster doesn't want to show it to you. It maybe one of those "backroom" pages he has, where secret stuff beyond your wildest imaginings is happening even now, right this second, just behind this blank white curtain. Stuff which you can only guess at. You can ask the hamster for an invite. Just email a full body shot, two forms of ID and a credit card number for verification purposes.

Whatever the case you may return from whence you came, Head for the main page or try searching again for whatever it is you wanted to find.

+
+
{% endblock %} diff --git a/templates/base.html b/templates/base.html index 68a1942..d0c80f0 100644 --- a/templates/base.html +++ b/templates/base.html @@ -21,6 +21,7 @@ type="text/css" media="screen"> + {%block stylesheet%}{%endblock%} diff --git a/templates/contact_form/contact_form.txt b/templates/contact_form/contact_form.txt index 701b8bb..5d8bf3e 100644 --- a/templates/contact_form/contact_form.txt +++ b/templates/contact_form/contact_form.txt @@ -1,5 +1,5 @@ -Message from luxagraf: - Name: {{name}} -Wrote: {{body}} \ No newline at end of file +Wrote: {{body}} + +Reply-To Address: {{email}} \ No newline at end of file diff --git a/templates/contact_form/contact_form_subject.txt b/templates/contact_form/contact_form_subject.txt index 9719f2c..2eb8f20 100644 --- a/templates/contact_form/contact_form_subject.txt +++ b/templates/contact_form/contact_form_subject.txt @@ -1 +1 @@ -[luxagraf] {{subject_line}} \ No newline at end of file +[luxmail] {{subject_line}} \ No newline at end of file -- cgit v1.2.3-70-g09d2