summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom Willemsen2011-10-17 02:57:42 +0200
committerGravatar Tom Willemsen2011-10-17 02:57:42 +0200
commitd7f99435105fd28e730427c0e494c9607d3803a3 (patch)
treeccb6a5e6c4ab5f11747ff0cbfae8fc7a3ccefde2
parent62cc00f06250478a40cf75439a33f871c6e85057 (diff)
downloaddotfiles-d7f99435105fd28e730427c0e494c9607d3803a3.tar.gz
dotfiles-d7f99435105fd28e730427c0e494c9607d3803a3.zip
Removed links module
-rw-r--r--links/__init__.py0
-rw-r--r--links/admin.py4
-rw-r--r--links/models.py35
-rw-r--r--links/tests.py16
-rw-r--r--links/urls.py5
-rw-r--r--links/views.py12
-rw-r--r--settings.py1
-rw-r--r--templates/base.html1
-rw-r--r--templates/links/links.html20
-rw-r--r--urls.py1
10 files changed, 0 insertions, 95 deletions
diff --git a/links/__init__.py b/links/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/links/__init__.py
+++ /dev/null
diff --git a/links/admin.py b/links/admin.py
deleted file mode 100644
index 29b8674..0000000
--- a/links/admin.py
+++ /dev/null
@@ -1,4 +0,0 @@
-from links.models import Bookmark
-from django.contrib import admin
-
-admin.site.register(Bookmark)
diff --git a/links/models.py b/links/models.py
deleted file mode 100644
index 50319a2..0000000
--- a/links/models.py
+++ /dev/null
@@ -1,35 +0,0 @@
-from django.db import models
-from main.models import Tag, Activity
-from django.db.models.signals import post_save, post_delete
-
-class Bookmark(models.Model):
- url = models.URLField(primary_key=True, max_length=255)
- date = models.DateTimeField(auto_now_add=True)
- name = models.CharField(max_length=255)
- description = models.TextField()
-# tags = models.ManyToManyField(Tag, null=True, blank=True)
- priority = models.IntegerField(null=True, blank=True)
-
- def __unicode__(self):
- return self.name
-
-def bookmark_saved_callback(sender, **kwargs):
- if kwargs['created']:
- acttype = 'add'
- else:
- acttype = 'edit'
-
- a = Activity(actcategory='link',
- actdescription=kwargs["instance"].name,
- acttype = acttype,
- objpk = kwargs["instance"].pk)
- a.save()
-
-def bookmark_deleted_callback(sender, **kwargs):
- a = Activity(actcategory='link',
- actdescription=kwargs["instance"].name,
- acttype = 'delete')
- a.save()
-
-post_save.connect(bookmark_saved_callback, sender=Bookmark)
-post_delete.connect(bookmark_deleted_callback, sender=Bookmark)
diff --git a/links/tests.py b/links/tests.py
deleted file mode 100644
index 501deb7..0000000
--- a/links/tests.py
+++ /dev/null
@@ -1,16 +0,0 @@
-"""
-This file demonstrates writing tests using the unittest module. These will pass
-when you run "manage.py test".
-
-Replace this with more appropriate tests for your application.
-"""
-
-from django.test import TestCase
-
-
-class SimpleTest(TestCase):
- def test_basic_addition(self):
- """
- Tests that 1 + 1 always equals 2.
- """
- self.assertEqual(1 + 1, 2)
diff --git a/links/urls.py b/links/urls.py
deleted file mode 100644
index 25d8cc8..0000000
--- a/links/urls.py
+++ /dev/null
@@ -1,5 +0,0 @@
-from django.conf.urls.defaults import patterns
-
-urlpatterns = patterns('links.views',
- (r'^$', 'index'),
-)
diff --git a/links/views.py b/links/views.py
deleted file mode 100644
index fe0d89d..0000000
--- a/links/views.py
+++ /dev/null
@@ -1,12 +0,0 @@
-from links.models import Bookmark
-from django.http import HttpResponse
-from django.template import Context, loader
-
-def index(request):
- bookmark_list = Bookmark.objects.all().order_by("-date")[:100]
- t = loader.get_template("links/links.html")
- c = Context({
- 'bookmarklist': bookmark_list,
- })
-
- return HttpResponse(t.render(c))
diff --git a/settings.py b/settings.py
index 2ef7e8f..5a6641e 100644
--- a/settings.py
+++ b/settings.py
@@ -87,5 +87,4 @@ INSTALLED_APPS = (
'main',
'blog',
'projects',
- 'links',
)
diff --git a/templates/base.html b/templates/base.html
index e910a76..01ec076 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -25,7 +25,6 @@
<a href="/">home</a><br />
<a href="/blog/">blog</a><br />
<a href="/projects/">projects</a><br />
- <a href="/links/">links</a>
</div>
{% block submenu %}{% endblock %}
diff --git a/templates/links/links.html b/templates/links/links.html
deleted file mode 100644
index b911d80..0000000
--- a/templates/links/links.html
+++ /dev/null
@@ -1,20 +0,0 @@
-{% extends "base.html" %}
-
-{% block subtitle %}
- links
-{% endblock %}
-
-{% block content %}
- <div class="container">
- <div class="header">
- <span class="title">links</span>
- </div>
- {% if bookmarklist %}
- {% for link in bookmarklist %}
- <a href="{{ link.url }}">{{ link.name }}</a><br/>
- {% endfor %}
- {% else %}
- No links, no where...
- {% endif %}
- </div>
-{% endblock %}
diff --git a/urls.py b/urls.py
index 1c46129..a5e253d 100644
--- a/urls.py
+++ b/urls.py
@@ -8,7 +8,6 @@ admin.autodiscover()
urlpatterns = patterns('',
(r'^blog/', include("blog.urls")),
(r'^projects/', include("projects.urls")),
- (r'^links/', include("links.urls")),
(r'^admin/', include(admin.site.urls)),
(r'^', include("main.urls")),
)