talpor / django-dashing

django-dashing is a customisable, modular dashboard application framework for Django to visualize interesting data about your project. Inspired in the dashboard framework Dashing
BSD 3-Clause "New" or "Revised" License
731 stars 108 forks source link

Widget URL parameters #7

Closed mverteuil closed 10 years ago

mverteuil commented 10 years ago

Overview

router.register(views.GitHubIssuesWidget,
                'github-issues',
                github_user="[A-Za-z0-9_-]+",
                repository="[A-Za-z0-9_-]+")
router.register(views.GitHubPullRequestsWidget,
                'total-prs')

urlpatterns = patterns(
    '',
    url(r'^legacy/github-issues/(?P<github_user>[A-Za-z0-9_-]+)/(?P<repository>[A-Za-z0-9_-]+)/?', views.GitHubIssuesWidget.as_view(), name='github-issues'),
    url(r'^legacy/total-prs/?', views.GitHubPullRequestsWidget.as_view(), name='total-prs'),
) + widget_router.urls

Resulting in:

^dashboard/ ^legacy/github-issues/(?P<github_user>[A-Za-z0-9_-]+)/(?P<repository>[A-Za-z0-9_-]+)/? [name='github-issues']
^dashboard/ ^legacy/total-prs/? [name='total-prs']
^dashboard/ ^$ [name='dashboard']
^dashboard/ ^widgets/github-issues/(P<github_user>[A-Za-z0-9_-]+)/(P<repository>[A-Za-z0-9_-]+) [name='widget_github-issues']
^dashboard/ ^widgets/total-prs/ [name='widget_total-prs']
mtdb commented 10 years ago

Thanks for your input, I'm adding this change to the docs

mverteuil commented 10 years ago

Thanks for quickly accepting :)