Created
October 19, 2017 02:15
-
-
Save paltman/b8f988c5ec03fe803e173ba2f9c78b78 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.conf.urls import url, include | |
from django.urls import reverse | |
from django.utils import timezone | |
from pinax.announcements.forms import AnnouncementForm | |
from .base import ViewConfig as BaseViewConfig | |
announcement = { | |
"pk": 1, | |
"title": "Bacon ipsum dolor amet corned beef beef tri-tip venison", | |
"publish_start": timezone.now(), | |
"publish_end": timezone.now(), | |
"content": "Anim labore doner shank fatback ham enim burgdoggen ipsum pork chop deserunt. Pancetta venison sausage officia sint. Tri-tip hamburger pork chop dolor andouille. Flank pork loin beef ribs, spare ribs bresaola dolore picanha tongue incididunt ham bacon." | |
} | |
announcement_list = [ | |
announcement, | |
announcement, | |
announcement, | |
announcement | |
] | |
label = "announcement" | |
title = "Pinax Announcements" | |
url_namespace = "pinax_announcements" | |
class ViewConfig(BaseViewConfig): | |
def resolved_path(self): | |
return reverse("{}:{}".format(url_namespace, self.name), kwargs=self.pattern_kwargs) | |
views = [ | |
ViewConfig( | |
pattern=r"^pinax-announcements/$", | |
template="pinax/announcements/announcement_list.html", | |
name="announcement_list", | |
pattern_kwargs={}, | |
announcement_list=announcement_list | |
), | |
# Rest of ViewConfig's cut for brevity | |
] | |
urlpatterns = [ | |
view.url() | |
for view in views | |
] | |
url = url(r"", include( | |
"pinax_theme_tester.configs.announcements", namespace=url_namespace) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment