Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
ale
ngv
Commits
53bf4324
Commit
53bf4324
authored
Sep 14, 2008
by
ale
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* fixed bug #15
* converted to sqlalchemy 0.5 syntax
parent
2904bdab
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
6 deletions
+3
-6
ngv_frontend/ngv_frontend/controllers/docs.py
ngv_frontend/ngv_frontend/controllers/docs.py
+1
-2
ngv_frontend/ngv_frontend/model/document.py
ngv_frontend/ngv_frontend/model/document.py
+2
-4
No files found.
ngv_frontend/ngv_frontend/controllers/docs.py
View file @
53bf4324
...
...
@@ -53,13 +53,12 @@ class DocsController(BaseController):
doc
.
parent
=
None
elif
not
doc
.
parent
and
parent_id
:
doc
.
parent
=
model
.
Document
.
query
.
get
(
parent_id
)
model
.
Session
.
update
(
doc
)
else
:
doc
=
model
.
Document
.
create
(
title
=
title
,
contents
=
contents
,
username
=
username
,
parent_id
=
parent_id
)
model
.
Session
.
save
(
doc
)
model
.
Session
.
add
(
doc
)
model
.
Session
.
commit
()
redirect
=
'view'
# handle attachment uploads
...
...
ngv_frontend/ngv_frontend/model/document.py
View file @
53bf4324
...
...
@@ -46,8 +46,6 @@ class Document(object):
rev1
=
DocumentRevision
(
username
=
username
,
contents
=
contents
)
doc
.
revisions
.
append
(
rev1
)
Session
.
add
(
rev1
)
#Session.commit()
#Session.refresh(doc)
return
doc
@
classmethod
...
...
@@ -87,9 +85,9 @@ class Document(object):
return
out
def
add_revision
(
self
,
contents
,
username
):
rev
=
DocumentRevision
(
username
=
username
,
contents
=
contents
)
rev
=
DocumentRevision
(
username
=
username
,
contents
=
contents
,
document
=
self
)
self
.
revisions
.
append
(
rev
)
Session
.
save
(
rev
)
def
latest_revision
(
self
):
return
DocumentRevision
.
query
.
filter_by
(
document_id
=
self
.
id
)
\
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment