A few other things came up today after digging into the differences
between biblion master biblia branch, and work I did in my older fork
off of master.
biblion.models.Biblion is a confusing name, it really should be
biblion.models.Blog. The app named biblion is enough, but naming the
Blog model Biblia makes for a very confusing set of url names and
template names.
Also, Biblia now has a multi-blog setup, but the url schema doesn't
reflect this. The way biblia is now, two posts with the same slug can
not exist, even when they are posted to different blogs.
Furthermore,"blog" could be replaced as (?P<blog_slug>[\w-]+)
Here is the way it is now:
urlpatterns = patterns("",
url(r"^$", biblion.views.BiblionList.as_view(),
name="biblion_list"),
url(r"^create/$", biblion.views.BiblionCreate.as_view(),
name="biblion_create"),
url(r"^blog/(?P<slug>[\w-]+)/$",
biblion.views.BiblionDetail.as_view(), name="biblion_detail"),
url(r"^blog/(?P<slug>[\w-]+)/update/$",
biblion.views.BiblionUpdate.as_view(), name="biblion_update"),
url(r"^blog/(?P<slug>[\w-]+)/post/$",
biblion.views.PostCreate.as_view(), name="biblion_post_create"),
url(r"^post/(?P<slug>[\w-]+)/$",
biblion.views.PostDetail.as_view(), name="biblion_post_detail"),
url(r"^post/(?P<slug>[\w-]+)/edit/$",
biblion.views.PostUpdate.as_view(), name="biblion_post_update"),
)
What do you think of a schema like this instead?
urlpatterns = patterns("",
# blogs
url(r"^$", biblion.views.BiblionList.as_view(),
name="biblion_blog_list"),
url(r"^create/$", biblion.views.BiblionCreate.as_view(),
name="biblion_blog_create"),
url(r"^(?P<blog_slug>[-\w]+)/$",
biblion.views.BiblionDetail.as_view(), name="biblion_blog_detail"),
url(r"^(?P<blog_slug>[-\w]+)/edit/$",
biblion.views.BiblionUpdate.as_view(), name="biblion_blog_update"),
# posts
url(r"^(?P<blog_slug>[-\w]+)/post/$",
biblion.views.PostCreate.as_view(), name="biblion_post_create"),
url(r"^(?P<blog_slug>[-\w]+)/(?P<post_slug>[\w-]+)/$",
biblion.views.PostDetail.as_view(), name="biblion_post_detail"),
url(r"^(?P<blog_slug>[-\w]+)/(?P<post_slug>[\w-]+)/edit/$",
biblion.views.PostUpdate.as_view(), name="biblion_post_update"),
# other post ideas
url(r"^(?P<blog_slug>[-\w]+)/(?P<year>\d{4})/(?P<month>\d{2})/
(?P<day>\d{2})/(?P<slug>[-\w]+)/$",
biblion.views.PostDetail.as_view(), name="biblion_post_detail"),
url(r"^(?P<blog_slug>[-\w]+)/(?P<post_uuid>[0-9a-f-]{36,36})/
$", biblion.views.PostDetail.as_view(), name="biblion_post_uuid"),
)
--
You received this message because you are subscribed to the Google Groups
"Pinax Core Development" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/pinax-core-dev?hl=en.