diff options
Diffstat (limited to 'bn_django/git_wiki/models.py')
-rw-r--r-- | bn_django/git_wiki/models.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/bn_django/git_wiki/models.py b/bn_django/git_wiki/models.py index ad3affb..78a26f6 100644 --- a/bn_django/git_wiki/models.py +++ b/bn_django/git_wiki/models.py @@ -82,6 +82,7 @@ class Item(models.Model): return "/k/%s/" % self.slug() def get_admin_url(self): return "%s/k/%s/" % (ADMIN_URL, self.id) + def update(self): import commands @@ -208,6 +209,13 @@ def reposcan(): f.close() return (heads, tags) +def newest_items(): + num = Item.objects.count() + min = num-7 + if min < 0: + min = 0 + return Item.objects.all()[min:num] + def shortlog(hash=None,tree=None): import commands |