djangosnippets.org: Latest snippets posted by dgouldinhttps://djangosnippets.org/users/dgouldin/2011-02-28T16:09:08.777759-06:00dgouldinGet default form data
2011-02-28T16:09:08.777759-06:00dgouldinhttps://djangosnippets.org/snippets/2372/<p>Given an unbound form, determine what data would be generated from POSTing the form unchanged. The goal is to end up with a dict such that, passed into another form constructor as its data kwarg, form.changed_data == [].</p>
Freely redistributableCustom admin widgets by field type
2009-03-10T12:04:49.210800-05:00dgouldinhttps://djangosnippets.org/snippets/1361/<p>There are probably ways to improve the implementation, but this was something I came up with when I wanted to change the default size of all of my CharField admin fields. Now all I have to do in my ModelAdmin class is:</p>
<p>form = get_admin_form(model)</p>
<p>or subclass BaseAdminForm if I …</p>
Freely redistributableGoogle Contacts API friend finder
2008-04-15T13:01:59.572176-05:00dgouldinhttps://djangosnippets.org/snippets/706/<p>This view will provide a link for AuthSub proxy authentication to the Google Contacts API and then grab the user's Google contacts and compare against User.email for possible user relationships.</p>
<p>A couple of things to note:</p>
<ul>
<li>
<p>Dependency on the GData Python client library:
http://code.google.com/p/gdata-python-client/</p>
</li>
<li>
<p>The domain hosting the view must …</p></li></ul>
Freely redistributable