November 2015
Beginner to intermediate
840 pages
26h 30m
English
NewsLink ObjectsOur NewsLinkDelete view suffers from the same quirk that our NewsLinkUpdate view does. Because we don’t have a URL-safe string unique identifier for NewsLink objects, we are forced to use the primary key of the row in the database, contrary to the principle of readable URLs. We sort this all out in Chapter 10, but for the moment, we build a rather unfriendly URL pattern, as shown in Example 9.75.
Example 9.75: Project Code
organizer/urls.py in cd1e78c2bd
13 url(r'^newslink/delete/(?P<pk>\d+)/$', 14 NewsLinkDelete.as_view(), 15 name='organizer_newslink_delete'),
Even without a unique identifier, we still take the opportunity to define a ...
Read now
Unlock full access