Esempio n. 1
0
from django.template.defaultfilters import slugify
from django.utils.translation import ugettext
from django.conf.urls import url

from ella.core.custom_urls import resolver

from ella_galleries.views import gallery_item_detail
from ella_galleries.models import Gallery

urlpatterns = [
    url(r'^(?P<item_slug>[\w-]+)/(?P<url_remainder>.+/)$', gallery_item_detail, name='gallery-item-detail-custom'),
    url(r'^(?P<item_slug>[\w-]+)/$', gallery_item_detail, name='gallery-item-detail'),
]

resolver.register(urlpatterns, prefix=slugify(ugettext('Item')), model=Gallery)
resolver.register_custom_detail(Gallery, gallery_item_detail)
Esempio n. 2
0
from django.utils.translation import ugettext
from django.template.defaultfilters import slugify
from django.conf.urls.defaults import patterns, url

from ella.core.custom_urls import resolver
from ella.interviews.views import unanswered, reply, detail, QuestionForm, QuestionFormPreview, list_questions
from ella.interviews.models import Interview

urlpatterns = patterns(
    '',
    url('^%s/$' % slugify(ugettext('unanswered')),
        unanswered,
        name='interview-unanswered'),
    url('^%s/$' % slugify(ugettext('reply')),
        list_questions, {},
        name='interview-list-questions'),
    url('^%s/(\d+)/$' % slugify(ugettext('reply')),
        reply, {},
        name='interview-reply'),
    url('^%s/$' % slugify(ugettext('ask')),
        QuestionFormPreview(QuestionForm),
        name='interview-ask'),
)
# add Interview-specific functionality
resolver.register(urlpatterns, model=Interview)

# override Interview's detail view
resolver.register_custom_detail(Interview, detail)
Esempio n. 3
0
File: urls.py Progetto: whit/ella
    url(r'^(?P<poll_id>\d+)/vote/$', poll_vote, name="polls_vote"),
    # POLL - vote to poll alt2
    url(r'^poll/(?P<poll_id>\d+)/vote/$', poll_vote, name="polls_poll_vote"),

    # SURVEY - vote to survey
    url(r'^survey/(?P<survey_id>\d+)/vote/$',
        survey_vote,
        name="polls_survey_vote"),

    # CONTEST - vote to contest
    #url(r'^contest/(?P<contest_id>\d+)/vote/$', contest_vote, name="polls_contest_vote"),
    # QUIZ - votes to quiz
    #url(r'^quiz/(?P<quiz_id>\d+)/vote/$', quiz_vote, name="polls_quiz_vote"),
)

resolver.register_custom_detail(Quiz, quiz)
resolver.register_custom_detail(Contest, contest)

resolver.register(patterns(
    '',
    url('^%s/$' % slugify(_('results')),
        result_details,
        name='polls-quiz-result')),
                  model=Quiz)
resolver.register(patterns(
    '',
    url('^%s/$' % slugify(_('result')),
        contest_result,
        name='polls-contest-result'),
    url('^%s/$' % slugify(_('conditions')),
        contest_conditions,
Esempio n. 4
0
File: urls.py Progetto: whit/ella
from django.template.defaultfilters import slugify
from django.utils.translation import ugettext
from django.conf.urls.defaults import patterns, url

from ella.galleries.views import gallery_item_detail
from ella.galleries.models import Gallery
from ella.core.custom_urls import resolver


urlpatterns = patterns('',
    url(r'^(?P<item_slug>[\w-]+)/$', gallery_item_detail, name='gallery-item-detail'),
)

resolver.register(urlpatterns, prefix=slugify(ugettext('Item')), model=Gallery)
resolver.register_custom_detail(Gallery, gallery_item_detail)
Esempio n. 5
0
'''
Created on 17.10.2011

@author: xaralis
'''
from django.conf.urls.defaults import patterns, url

from ella.articles.models import Article
from ella.core.custom_urls import resolver

from .views import article_detail, article_page

# List this only to enable inclusion from base urls.py DO NOT DELETE
urlpatterns = patterns('iw.iwapp.views',)

browse_article_patterns = patterns('iw.iwapps.views',
    url(r'^strana/(?P<page>\d+)/$', article_page, name="article_page")
)

resolver.register(browse_article_patterns, model=Article)
resolver.register_custom_detail(Article, article_detail)
Esempio n. 6
0
    # POLL - vote to poll alt1
    url(r'^(?P<poll_id>\d+)/vote/$', poll_vote, name="polls_vote"),
    # POLL - vote to poll alt2
    url(r'^poll/(?P<poll_id>\d+)/vote/$', poll_vote, name="polls_poll_vote"),

    # SURVEY - vote to survey
    url(r'^survey/(?P<survey_id>\d+)/vote/$', survey_vote, name="polls_survey_vote"),

    # CONTEST - vote to contest
    #url(r'^contest/(?P<contest_id>\d+)/vote/$', contest_vote, name="polls_contest_vote"),
    # QUIZ - votes to quiz
    #url(r'^quiz/(?P<quiz_id>\d+)/vote/$', quiz_vote, name="polls_quiz_vote"),
)


resolver.register_custom_detail(Quiz, quiz)
resolver.register_custom_detail(Contest, contest)

resolver.register(
    patterns('',
        url('^%s/$' % slugify(_('results')), result_details, name='polls-quiz-result')
    ),
    model=Quiz
)
resolver.register(
    patterns('',
        url('^%s/$' % slugify(_('result')), contest_result, name='polls-contest-result'),
        url('^%s/$' % slugify(_('conditions')), contest_conditions, name='polls-contest-conditions')
    ),
    model=Contest
)