From 3ca747d694281f945bb469d15bc5697091fee042 Mon Sep 17 00:00:00 2001 From: olivier <> Date: Tue, 1 May 2007 15:58:45 +0000 Subject: [PATCH] added license headers + cleanup --- telemeta/models.py | 9 +++++++++ telemeta/urls.py | 41 +++++++++++++++++++++++++++-------------- telemeta/views/web.py | 8 ++++++++ 3 files changed, 44 insertions(+), 14 deletions(-) diff --git a/telemeta/models.py b/telemeta/models.py index 7c6d8995..13bc4e37 100644 --- a/telemeta/models.py +++ b/telemeta/models.py @@ -1,3 +1,12 @@ +# Copyright (C) 2007 Samalyse SARL +# All rights reserved. +# +# This software is licensed as described in the file COPYING, which +# you should have received as part of this distribution. The terms +# are also available at http://svn.parisson.org/telemeta/TelemetaLicense. +# +# Author: Olivier Guilyardi + import telemeta from django.db import models from django.db.models import Q diff --git a/telemeta/urls.py b/telemeta/urls.py index f08699cb..e7e77846 100644 --- a/telemeta/urls.py +++ b/telemeta/urls.py @@ -1,36 +1,49 @@ +# Copyright (C) 2007 Samalyse SARL +# All rights reserved. +# +# This software is licensed as described in the file COPYING, which +# you should have received as part of this distribution. The terms +# are also available at http://svn.parisson.org/telemeta/TelemetaLicense. +# +# Author: Olivier Guilyardi + from django.conf.urls.defaults import * from telemeta.models import MediaItem, MediaCollection from telemeta.core import ComponentManager from telemeta.views.web import WebView +# initialization comp_mgr = ComponentManager() web_view = WebView(comp_mgr) -all_items = { - 'queryset': MediaItem.objects.all(), -} - -all_collections = { - 'queryset': MediaCollection.objects.all(), -} +# query sets for Django generic views +all_items = { 'queryset': MediaItem.objects.all(), } +all_collections = { 'queryset': MediaCollection.objects.all(), } urlpatterns = patterns('', (r'^$', web_view.index), + + # items (r'^items/$', 'django.views.generic.list_detail.object_list', dict(all_items, paginate_by=10, template_name="mediaitem_list.html")), (r'^items/(?P[0-9]+)/$', web_view.item_detail), (r'^items/(?P[0-9]+)/download/(?P[0-9A-Z]+)/$', web_view.item_export), - #(r'^media_item/(?P[0-9]+)/$', 'telemeta.views.web.media_item_edit'), - (r'^media_item/(?P[0-9]+)/update/$', 'telemeta.views.web.media_item_update'), + # collections (r'^collections/$', 'django.views.generic.list_detail.object_list', dict(all_collections, paginate_by=10, template_name="collection_list.html")), (r'^collections/(?P[0-9]+)/$', 'django.views.generic.list_detail.object_detail', dict(all_collections, template_name="collection_detail.html")), - #(r'^dictionaries/$', web_view.dictionary_list), + + # search + (r'^search/$', web_view.quick_search), + + # administration (r'^admin/$', web_view.admin_index), + + # dictionaries administrations (r'^admin/dictionaries/(?P[0-9a-z]+)/$', web_view.edit_dictionary), (r'^admin/dictionaries/(?P[0-9a-z]+)/add/$', web_view.add_to_dictionary), (r'^admin/dictionaries/(?P[0-9a-z]+)/update/$', web_view.update_dictionary), @@ -40,12 +53,12 @@ urlpatterns = patterns('', (r'^admin/dictionaries/(?P[0-9a-z]+)/(?P[0-9]+)/update/$', web_view.update_dictionary_value), - (r'^search/$', web_view.quick_search), - # CSS+Images (FIXME: for developement only) - (r'^css/(?P.*)$', 'django.views.static.serve', {'document_root': './telemeta/htdocs/css'}), - (r'^images/(?P.*)$', 'django.views.static.serve', {'document_root': './telemeta/htdocs/images'}), + (r'^css/(?P.*)$', 'django.views.static.serve', + {'document_root': './telemeta/htdocs/css'}), + (r'^images/(?P.*)$', 'django.views.static.serve', + {'document_root': './telemeta/htdocs/images'}), ) diff --git a/telemeta/views/web.py b/telemeta/views/web.py index a23cedc7..3d926703 100644 --- a/telemeta/views/web.py +++ b/telemeta/views/web.py @@ -1,3 +1,11 @@ +# Copyright (C) 2007 Samalyse SARL +# All rights reserved. +# +# This software is licensed as described in the file COPYING, which +# you should have received as part of this distribution. The terms +# are also available at http://svn.parisson.org/telemeta/TelemetaLicense. +# +# Author: Olivier Guilyardi import telemeta from django.template import Context, loader -- 2.39.5