diff options
author | Daniel Neuhäuser <ich@danielneuhaeuser.de> | 2010-08-11 14:23:58 +0200 |
---|---|---|
committer | Daniel Neuhäuser <ich@danielneuhaeuser.de> | 2010-08-11 14:23:58 +0200 |
commit | 1d4c7d4fe01bc768ebb0bfc9765f58a86dcc74c6 (patch) | |
tree | 8da3846b879af3aade139942bf8183f6e9a2bb6e /sphinx/websupport/storage/db.py | |
parent | 4a2a6a7eab051ae5b44c15243acc4d142b984874 (diff) | |
download | sphinx-git-1d4c7d4fe01bc768ebb0bfc9765f58a86dcc74c6.tar.gz |
Added initial versioning support
Diffstat (limited to 'sphinx/websupport/storage/db.py')
-rw-r--r-- | sphinx/websupport/storage/db.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sphinx/websupport/storage/db.py b/sphinx/websupport/storage/db.py index 74a3e2b70..54b16f225 100644 --- a/sphinx/websupport/storage/db.py +++ b/sphinx/websupport/storage/db.py @@ -11,6 +11,7 @@ """ from datetime import datetime +from uuid import uuid4 from sqlalchemy import Column, Integer, Text, String, Boolean, ForeignKey,\ DateTime @@ -28,7 +29,7 @@ class Node(Base): """Data about a Node in a doctree.""" __tablename__ = db_prefix + 'nodes' - id = Column(Integer, primary_key=True) + id = Column(String(32), primary_key=True) document = Column(String(256), nullable=False) line = Column(Integer) source = Column(Text, nullable=False) @@ -93,7 +94,8 @@ class Node(Base): return comments - def __init__(self, document, line, source): + def __init__(self, id, document, line, source): + self.id = id self.document = document self.line = line self.source = source @@ -112,7 +114,7 @@ class Comment(Base): proposal_diff = Column(Text) path = Column(String(256), index=True) - node_id = Column(Integer, ForeignKey(db_prefix + 'nodes.id')) + node_id = Column(String, ForeignKey(db_prefix + 'nodes.id')) node = relation(Node, backref="comments") def __init__(self, text, displayed, username, rating, time, |