djangosnippets.org: Latest snippets posted by pawnheartshttps://djangosnippets.org/users/pawnhearts/2010-02-25T02:55:19.078143-06:00pawnheartsjstree in change_list for mptt models
2010-02-25T02:55:19.078143-06:00pawnheartshttps://djangosnippets.org/snippets/1941/<p>to get code with all media files and setup.py:
hg clone http://code.tabed.org/mptt_admin/
<a href="http://tabed.org/static/mptt_admin2.jpg">screenshot</a></p>
Freely redistributableemail backend which use sendmail subprocess
2010-01-13T04:53:09.567036-06:00pawnheartshttps://djangosnippets.org/snippets/1864/<p>email backend which use sendmail subprocess</p>
Freely redistributablejstree integration to django admin
2010-01-08T04:02:53.835550-06:00pawnheartshttps://djangosnippets.org/snippets/1858/<p>You have some tree-like structure in your models, for example:</p>
<p><code>class MyModel(models.Model):
parent = models.ForeignKey('self', verbose_name=u'Parent', \
null=True, blank=True, related_name='children')
name = models.CharField(u'Раздел', max_lengtch=255)
position = PositiveSmallIntegerField(u'Позиция', default=0)
class Meta:
ordering = ('position',)</code></p>
<p>To see it as a tree in admin's object list(you also can sort items, move to another …</p>
Freely redistributableached decorator for functions
2010-01-07T11:52:58.194608-06:00pawnheartshttps://djangosnippets.org/snippets/1852/<p>example:</p>
<p>@cached()
def foo(slug):
return Egg.objects.filter(slug=slug)</p>
Freely redistributable