aboutsummaryrefslogtreecommitdiffstats
path: root/bn_django/git_wiki
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@animus.robocracy.org>2008-08-11 20:45:15 -0700
committerBryan Newbold <bnewbold@animus.robocracy.org>2008-08-11 20:45:15 -0700
commit6a22baa306a72557698d64ac6c09842bed81f66b (patch)
tree137f5d9fb1ef3bc834ee4e037ca2e33f0f4c384f /bn_django/git_wiki
parent62dcf136d5b71c0b4d5744ec3551ce82edcc2a94 (diff)
downloadbnewnet-6a22baa306a72557698d64ac6c09842bed81f66b.tar.gz
bnewnet-6a22baa306a72557698d64ac6c09842bed81f66b.zip
more changes, works ok. TODO: comments for git_wiki, redo git_browse...
Diffstat (limited to 'bn_django/git_wiki')
-rw-r--r--bn_django/git_wiki/models.py39
-rw-r--r--bn_django/git_wiki/templates/git_wiki/item.html5
2 files changed, 27 insertions, 17 deletions
diff --git a/bn_django/git_wiki/models.py b/bn_django/git_wiki/models.py
index 2614739..2fe841f 100644
--- a/bn_django/git_wiki/models.py
+++ b/bn_django/git_wiki/models.py
@@ -10,10 +10,10 @@ if ADMIN_URL[-1] == '/':
ADMIN_URL=ADMIN_URL[:-1]
class Tree(models.Model):
- mode = models.CharField("file mode/permissions", blank=False,maxlength=4)
- path = models.CharField("relative path from repo base", maxlength=512)
- id = models.CharField("hash", maxlength=40,blank=False,primary_key=True)
- name = models.CharField("name of dir", maxlength=128,blank=False)
+ mode = models.CharField("file mode/permissions", blank=False,max_length=4)
+ path = models.CharField("relative path from repo base", max_length=512)
+ id = models.CharField("hash", max_length=40,blank=False,primary_key=True)
+ name = models.CharField("name of dir", max_length=128,blank=False)
type = 'tree'
def slug(self):
#TODO: secure this
@@ -64,11 +64,11 @@ class Tree(models.Model):
class Item(models.Model):
- mode = models.CharField("file mode/permissions", blank=False,maxlength=4)
- path = models.CharField("relative path from repo base", maxlength=512)
- id = models.CharField("hash", maxlength=40,blank=False,primary_key=True)
- name = models.CharField("name of dir", maxlength=128,blank=False)
- size = models.IntegerField("filesize in byte", maxlength=128,blank=False)
+ mode = models.CharField("file mode/permissions", blank=False,max_length=4)
+ path = models.CharField("relative path from repo base", max_length=512)
+ id = models.CharField("hash", max_length=40,blank=False,primary_key=True)
+ name = models.CharField("name of dir", max_length=128,blank=False)
+ size = models.IntegerField("filesize in byte", max_length=128,blank=False)
contents = models.TextField("ASCII contents of the file")
type='blob'
def slug(self):
@@ -109,20 +109,20 @@ class Item(models.Model):
return open(str(GITWIKI_DIR + '/objects/' + self.id[:2] + '/' + self.id[2:]),'r')
class Commit(models.Model):
- id = models.CharField("hash", maxlength=40,blank=False,primary_key=True)
+ id = models.CharField("hash", max_length=40,blank=False,primary_key=True)
rawdiff = models.TextField("ASCII contents of full commit diff")
commit_date = models.DateField("Date of commit to repository")
author_date = models.DateField("Date commit was writen/created")
- author = models.CharField("Name of commit author", maxlength=96)
+ author = models.CharField("Name of commit author", max_length=96)
author_email = models.CharField("Email address of commit author",\
- maxlength=196)
- committer = models.CharField("Name of committer", maxlength=96)
+ max_length=196)
+ committer = models.CharField("Name of committer", max_length=96)
committer_email = models.CharField("Email address of committer", \
- maxlength=196)
+ max_length=196)
comment = models.TextField("Notes on the commit")
- parenthash = models.CharField("parent's hash", maxlength=40)
+ parenthash = models.CharField("parent's hash", max_length=40)
#TODO: parent = models.ForeignKey()
- treehash = models.CharField("tree object's hash", maxlength=40)
+ treehash = models.CharField("tree object's hash", max_length=40)
tree = models.ForeignKey(Tree)
type='commit'
@@ -266,3 +266,10 @@ def shortlog(hash=None,tree=None):
logobj['shortdescription'] = logobj['description'][:128]
shortlog.append(logobj)
return shortlog
+
+from django.contrib import admin
+
+admin.site.register(Tree)
+admin.site.register(Item)
+admin.site.register(Commit)
+
diff --git a/bn_django/git_wiki/templates/git_wiki/item.html b/bn_django/git_wiki/templates/git_wiki/item.html
index 51680ef..98f1647 100644
--- a/bn_django/git_wiki/templates/git_wiki/item.html
+++ b/bn_django/git_wiki/templates/git_wiki/item.html
@@ -12,7 +12,7 @@
{% block gitwiki %}
&nbsp;
-{{ doc.html_body }}
+{{ doc.html_body|safe }}
<br /><hr />
<h3>Meta</h3>
<b>Item name:</b>
@@ -29,6 +29,8 @@
<br />
{% endblock %}
+{% comment %}
+BROKEN, comments need char type primary keys
{% block commentary %}
<div class="content" id="commentary">
{% load comments %}
@@ -46,3 +48,4 @@ They will be lost if the item is updated.</em></p>
{% include "comment_list" %}
</div>
{% endblock %}
+{% endcomment %}