djangosnippets.org: Latest snippets tagged with 'OneToOneField'http://djangosnippets.org/tags/onetoonefield/2011-11-05T07:40:44.641337-05:00Exists Filter OneToOneField in Admin
2011-11-05T07:40:44.641337-05:00davidvazhttp://djangosnippets.org/snippets/2591/<p>Adds Boolean like Filter in Admin to OneToOneField reference. Allowing to filter in the Parent for instances without Referenced Field.</p>
<p>To register the filter, import in <code>urls.py</code> for example:</p>
<pre><code>import filterspecs
</code></pre>
<p>Example <code>models.py</code>:</p>
<pre><code>from django.db import models
class Place(models.Model):
name = model.CharField(maxlength=50)
address = model.CharField(maxlength=80)
class Restaurant(meta.Model):
place = …</code></pre>
Freely redistributableSane OneToOne getter
2010-11-10T12:36:53.234443-06:00Wraithanhttp://djangosnippets.org/snippets/2254/<p>Since django insists on throwing a DoesNotExist rather than just returning a None from the far side of a null OneToOneField, I wrote this to have a sane way of getting those fields out without having to try/except all over in my code.</p>
Freely redistributable