Merge lp:~manishsinha/zeitgeist-affinity/add-music-skeleton into lp:zeitgeist-affinity

Status: Merged
Merged at revision: 10
Proposed branch: lp:~manishsinha/zeitgeist-affinity/add-music-skeleton
Merge into: lp:zeitgeist-affinity
Diff against target: 111 lines (+58/-1)
7 files modified
logger/models.py (+5/-0)
music/models.py (+14/-0)
music/tests.py (+23/-0)
music/urls.py (+8/-0)
music/views.py (+6/-0)
settings.py (+1/-0)
urls.py (+1/-1)
To merge this branch: bzr merge lp:~manishsinha/zeitgeist-affinity/add-music-skeleton
Reviewer Review Type Date Requested Status
Jamal Fanaian Approve
Review via email: mp+42060@code.launchpad.net

Commit message

Added support for music. Piston based handler needs to be added

Description of the change

Added support for music. Piston based handler needs to be added

To post a comment you must log in.
10. By Manish Sinha (मनीष सिन्हा)

Make Metadata refer back to Event instead of Music refer to Metadata. this way we can have more than one Metadata for each event

Revision history for this message
Jamal Fanaian (jamalta) wrote :

Looks good!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'logger/models.py'
2--- logger/models.py 2010-10-18 19:22:47 +0000
3+++ logger/models.py 2010-11-28 21:05:12 +0000
4@@ -16,3 +16,8 @@
5 manifestation = models.CharField(max_length=255)
6 actor = models.CharField(max_length=255)
7 subject = models.ForeignKey(Subject)
8+
9+class Metadata(models.Model):
10+ eventid = models.ForeignKey(Event)
11+ name = models.CharField(max_length=255)
12+ value = models.CharField(max_length=255)
13
14=== added directory 'music'
15=== added file 'music/__init__.py'
16=== added file 'music/models.py'
17--- music/models.py 1970-01-01 00:00:00 +0000
18+++ music/models.py 2010-11-28 21:05:12 +0000
19@@ -0,0 +1,14 @@
20+from django.db import models
21+from affinity.logger import models as EventModel
22+
23+# Create your models here.
24+
25+class Music(models.Model):
26+ event = models.ForeignKey(EventModel.Event)
27+ title = models.CharField(max_length=255)
28+ artist = models.CharField(max_length=255)
29+ album = models.CharField(max_length=255)
30+ year = models.BigIntegerField()
31+ comment = models.CharField(max_length=255)
32+ track = models.CharField(max_length=255)
33+ genre = models.CharField(max_length=255)
34
35=== added file 'music/tests.py'
36--- music/tests.py 1970-01-01 00:00:00 +0000
37+++ music/tests.py 2010-11-28 21:05:12 +0000
38@@ -0,0 +1,23 @@
39+"""
40+This file demonstrates two different styles of tests (one doctest and one
41+unittest). These will both pass when you run "manage.py test".
42+
43+Replace these with more appropriate tests for your application.
44+"""
45+
46+from django.test import TestCase
47+
48+class SimpleTest(TestCase):
49+ def test_basic_addition(self):
50+ """
51+ Tests that 1 + 1 always equals 2.
52+ """
53+ self.failUnlessEqual(1 + 1, 2)
54+
55+__test__ = {"doctest": """
56+Another way to test that 1 + 1 is equal to 2.
57+
58+>>> 1 + 1 == 2
59+True
60+"""}
61+
62
63=== added file 'music/urls.py'
64--- music/urls.py 1970-01-01 00:00:00 +0000
65+++ music/urls.py 2010-11-28 21:05:12 +0000
66@@ -0,0 +1,8 @@
67+from django.conf.urls.defaults import *
68+from piston.resource import Resource
69+
70+urlpatterns = patterns('affinity.music.views',
71+ # Example:
72+ (r'^$', 'index'),
73+ #(r'^music$', Resource(EventHandler)),
74+)
75
76=== added file 'music/views.py'
77--- music/views.py 1970-01-01 00:00:00 +0000
78+++ music/views.py 2010-11-28 21:05:12 +0000
79@@ -0,0 +1,6 @@
80+# Create your views here.
81+
82+from django.http import HttpResponse
83+
84+def index(request):
85+ return HttpResponse("Music")
86
87=== modified file 'settings.py'
88--- settings.py 2010-11-24 19:44:28 +0000
89+++ settings.py 2010-11-28 21:05:12 +0000
90@@ -90,6 +90,7 @@
91 'django.contrib.sites',
92 'django.contrib.messages',
93 'affinity.logger',
94+ 'affinity.music',
95 # Uncomment the next line to enable the admin:
96 'django.contrib.admin',
97 # Uncomment the next line to enable admin documentation:
98
99=== modified file 'urls.py'
100--- urls.py 2010-10-18 19:22:47 +0000
101+++ urls.py 2010-11-28 21:05:12 +0000
102@@ -5,8 +5,8 @@
103 admin.autodiscover()
104
105 urlpatterns = patterns('',
106- # Example:
107 (r'^log/', include('logger.urls')),
108+ (r'^music/', include('music.urls')),
109
110 # Uncomment the admin/doc line below to enable admin documentation:
111 # (r'^admin/doc/', include('django.contrib.admindocs.urls')),

Subscribers

People subscribed via source and target branches