Skip to content
Snippets Groups Projects
Commit 103a909a authored by Ernesto Rico Schmidt's avatar Ernesto Rico Schmidt
Browse files

getting real.

parent ba41badf
No related branches found
No related tags found
No related merge requests found
Showing
with 76 additions and 83 deletions
......@@ -5,7 +5,7 @@ from django.utils.html import clean_html, strip_tags
import MySQLdb
from helsinki.program.models import Note, Show, TimeSlot
from models import Note, Show, TimeSlot
USER = 'helsinki'
PASSWD = 'helsinki'
......
......@@ -5,7 +5,7 @@ from django.utils.html import strip_tags
from datetime import time
import MySQLdb
from helsinki.program.models import Show, ProgramSlot, RRule
from models import Show, ProgramSlot, RRule
USER = 'helsinki'
PASSWD = 'helsinki'
......
......@@ -5,7 +5,7 @@ from django.utils.html import clean_html, strip_tags
import MySQLdb
from helsinki.program.models import BroadcastFormat, Host, Show
from models import BroadcastFormat, Host, Show
USER = 'helsinki'
PASSWD = 'helsinki'
......
File moved
from haystack.indexes import CharField, DateTimeField, SearchIndex
from haystack.indexes import CharField, SearchIndex
from haystack import site
from datetime import datetime
from program.models import Note, Show
from models import Note, Show
class NoteIndex(SearchIndex):
SearchableText = CharField(document=True, use_template=True)
......
File moved
# http://docs.djangoproject.com/en/dev/howto/custom-template-tags/
# http://docs.djangoproject.com/en/1.2/howto/custom-template-tags/
from django import template
register = template.Library()
from helsinki.program.models import (
BroadcastFormat,
MusicFocus,
ShowInformation,
ShowTopic)
from program.models import BroadcastFormat, MusicFocus, ShowInformation, ShowTopic
@register.inclusion_tag('program/box_broadcastformat.html')
@register.inclusion_tag('program/boxes/broadcastformat.html')
def broadcastformat():
broadcastformats = BroadcastFormat.objects.all()
return {'broadcastformats': broadcastformats}
@register.inclusion_tag('program/box_musicfocus.html')
@register.inclusion_tag('program/boxes/musicfocus.html')
def musicfocus():
musicfoci = MusicFocus.objects.all()
return {'musicfoci': musicfoci}
@register.inclusion_tag('program/box_showinformation.html')
@register.inclusion_tag('program/boxes/showinformation.html')
def showinformation():
showinformations = ShowInformation.objects.all()
return {'showinformations': showinformations}
@register.inclusion_tag('program/box_showtopic.html')
@register.inclusion_tag('program/boxes/showtopic.html')
def showtopic():
showtopics = ShowTopic.objects.all()
return {'showtopics': showtopics}
from django.conf.urls.defaults import *
from django.conf.urls.defaults import patterns, url
from django.views.generic.list_detail import object_detail, object_list
from models import BroadcastFormat, Host, Show, TimeSlot
from models import Host, Show, TimeSlot
from views import current_show, day_schedule, recommendations, show_list, week_schedule
host_dict = {
hosts_dict = {
'queryset': Host.objects.all(),
'template_object_name': 'host'
}
show_dict = {
shows_dict = {
'queryset': Show.objects.all(),
'template_object_name': 'show'
}
timeslot_dict = {
timeslots_dict = {
'queryset': TimeSlot.objects.all(),
'template_object_name': 'timeslot'
}
recommendation_dict = {'template_name': 'program/recommendations_box.html'}
recommendations_dict = {'template_name': 'program/boxes/recommendations.html'}
urlpatterns = patterns('',
(r'^today/?$', day_schedule),
(r'^(?P<year>\d{4})/(?P<month>\d{1,2})/(?P<day>\d{1,2})/?$', day_schedule),
(r'^(?P<year>\d{4})/(?P<week>\d{1,2})/?$', week_schedule),
(r'^current_box/?$', current_show),
(r'^hosts/?$', object_list, host_dict),
url(r'^hosts/(?P<object_id>\d+)/?$', object_detail, host_dict, name='host-detail'),
(r'^tips/?$', recommendations),
(r'^tips_box/?$', recommendations, recommendation_dict),
(r'^shows/?$', show_list),
url(r'^shows/(?P<slug>[\w-]+)/?$', object_detail, show_dict, name='show-detail'),
url(r'^(?P<object_id>\d+)/?$', object_detail, timeslot_dict, name='timeslot-detail'),
(r'^week/?$', week_schedule)
url(r'^today/?$', day_schedule),
url(r'^(?P<year>\d{4})/(?P<month>\d{1,2})/(?P<day>\d{1,2})/?$', day_schedule),
url(r'^(?P<year>\d{4})/(?P<week>\d{1,2})/?$', week_schedule),
url(r'^current_box/?$', current_show),
url(r'^hosts/?$', object_list, hosts_dict),
url(r'^hosts/(?P<object_id>\d+)/?$', object_detail, hosts_dict, name='host-detail'),
url(r'^tips/?$', recommendations),
url(r'^tips_box/?$', recommendations, recommendations_dict),
url(r'^shows/?$', show_list),
url(r'^shows/(?P<slug>[\w-]+)/?$', object_detail, shows_dict, name='show-detail'),
url(r'^(?P<object_id>\d+)/?$', object_detail, timeslots_dict, name='timeslot-detail'),
url(r'^week/?$', week_schedule)
)
from django.views.generic import list_detail
from django.views.generic import simple
from django.views.generic import list_detail, simple
from django.shortcuts import get_object_or_404
from helsinki.program.models import (
BroadcastFormat,
MusicFocus,
Note,
Show,
ShowInformation,
ShowTopic,
TimeSlot)
from models import BroadcastFormat, MusicFocus, Note, Show, ShowInformation, ShowTopic, TimeSlot
from datetime import date, datetime, time, timedelta
def show_list(request):
if 'broadcastformat' in request.GET:
broadcastformat = get_object_or_404(BroadcastFormat, slug=request.GET['broadcastformat'])
......@@ -72,7 +63,7 @@ def current_show(request):
extra_context = dict(current=current, next=next, after_next=after_next)
return simple.direct_to_template(request, template='program/current_box.html', extra_context=extra_context)
return simple.direct_to_template(request, template='program/boxes/current.html', extra_context=extra_context)
def week_schedule(request, year=None, week=None):
if year is None and week is None:
......
Django==1.2.5
MySQL-python==1.2.3
PIL==1.1.7
PyYAML==3.09
django-haystack==1.1.0
pysolr==2.0.13
python-dateutil==1.5
import haystack
haystack.autodiscover()
\ No newline at end of file
haystack.autodiscover()
import os
# Django settings for helsinki project.
import os.path
PROJECT_DIR = os.path.dirname(__file__)
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
ADMINS = ( )
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'helsinki2',
'USER': 'helsinki',
'PASSWORD': 'helsinki'
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(PROJECT_DIR, 'dev_data.sqlite'),
}
}
......@@ -27,16 +24,14 @@ LANGUAGE_CODE = 'de'
SITE_ID = 1
USE_I18N = True
USE_L10N = True
MEDIA_ROOT = ''
MEDIA_URL = ''
ADMIN_MEDIA_PREFIX = '/media/'
SECRET_KEY = 'oepk-$!=)c)7+y%cdz-x46_h5bp!o-*9%dv!(sf=3r4zfqk_(t'
SECRET_KEY = ''
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
......@@ -52,10 +47,10 @@ MIDDLEWARE_CLASSES = (
'django.contrib.messages.middleware.MessageMiddleware',
)
ROOT_URLCONF = 'helsinki.program.urls'
ROOT_URLCONF = 'helsinki.urls'
TEMPLATE_DIRS = (
os.path.join(os.path.dirname(__file__), "templates"),
os.path.join(PROJECT_DIR, "templates"),
)
INSTALLED_APPS = (
......@@ -65,12 +60,16 @@ INSTALLED_APPS = (
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.admin',
'helsinki.program',
'program',
'haystack',
)
HAYSTACK_SITECONF = 'helsinki.program.search_sites'
HAYSTACK_SITECONF = 'helsinki.search_sites'
HAYSTACK_SEARCH_ENGINE = 'solr'
HAYSTACK_SOLR_URL = 'http://localhost:8988/solr'
# plone integration
HAYSTACK_ID_FIELD = 'docid'
try:
from local_settings import *
except ImportError:
pass
from setuptools import setup, find_packages
import os
version = '0.1'
setup(name='helsinki.program',
version=version,
description="Program Management for Radio Helsinki, Graz",
long_description=open("README.rst").read() + "\n" +
open(os.path.join("docs", "CHANGES.rst")).read(),
# Get more strings from http://www.python.org/pypi?:action=list_classifiers
classifiers=[
"Programming Language :: Python",
"Topic :: Software Development :: Libraries :: Python Modules",
],
keywords='django radio',
author='Ernesto Rico-Schmidt',
author_email='',
url='https://github.com/nnrcschmdt/helsinki/',
license='GPL',
packages=find_packages(exclude=['ez_setup']),
namespace_packages=['helsinki',],
include_package_data=True,
zip_safe=False,
install_requires=[
'setuptools',
# -*- Extra requirements: -*-
'Django',
'python-dateutil',
'PyYAML',
'MySQL-python',
'django-haystack',
'pysolr'
],
)
File moved
File moved
File moved
......@@ -3,7 +3,7 @@
<dt class="portletHeader"><span>Legende<span></dt>
{% for broadcastformat in broadcastformats %}
<dd class="portletItem bcformat bf-{{ broadcastformat.slug }}">
<a href="?broadcastformat={{ broadcastformat.slug }}">{{ broadcastformat.format }}</a>
<a href="../?broadcastformat={{ broadcastformat.slug }}">{{ broadcastformat.format }}</a>
</dd>
{% endfor %}
</dl>
......
......@@ -5,7 +5,7 @@
<ul>
{% for item in musicfoci %}
<li class="mf-{{ item.abbrev }}">
<a href="?musicfocus={{ item.slug }}">{{ item }}</a>
<a href="../?musicfocus={{ item.slug }}">{{ item }}</a>
</li>
{% endfor %}
</ul>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment