djangosnippets.org: Latest snippets posted by humphreymurrayhttps://djangosnippets.org/users/humphreymurray/2011-01-10T18:10:49.388632-06:00humphreymurrayClass based generic views that automatically check permissions
2011-01-10T18:10:49.388632-06:00humphreymurrayhttps://djangosnippets.org/snippets/2317/<p>Simple wrappers around the new class-based generic views (introduced in Django 1.3) that also check permissions.</p>
<p><strong>Example Usage</strong> <em>(views.py)</em>:</p>
<pre><code>from mymodule import RestrictedListView, RestrictedUpdateView
class MyListView(RestrictedListView):
model = MyModel
class MyUpdateView(RestrictedUpdateView):
model = MyModel
</code></pre>
<p>and so on for Create and Delete.</p>
Freely redistributableNewforms Validation of Credit Card Numbers
2008-05-19T23:01:07.222928-05:00humphreymurrayhttps://djangosnippets.org/snippets/764/<p>Some functions and newforms fields for validating credit card numbers, and their expiry dates.
</p>
<p>In my project, I have all of the credit card functions in a file called creditcards.py
</p>
<p>Just as an overview: To validate a credit card number there are a few steps:
1. Make sure the number …</p>
Freely redistributable