Ability to move documents between projects.
Ability to move documents between projects.
diff --git a/mgmt/documents_views.py b/mgmt/documents_views.py
index bfa6b92..e00a8d5 100644
--- a/mgmt/documents_views.py
+++ b/mgmt/documents_views.py
@@ -9,7 +9,7 @@ from forms import CommentForm,DocForm
@render_to('project_docs.html')
def project_documents(request,id):
project = Project.objects.get(pk=id)
- cats = Category.objects.filter(document__project=project)
+ cats = Category.objects.filter(document__project=project).distinct()
return {'project': project,
'categories': cats}
@@ -62,6 +62,7 @@ def create_document(request,project):
else:
return {'form': form}
form = DocForm()
+ form.initial['project'] = project.id
return {'form': form}
@check_auth(Document,'edit')
diff --git a/mgmt/forms.py b/mgmt/forms.py
index 43222cd..0861f26 100644
--- a/mgmt/forms.py
+++ b/mgmt/forms.py
@@ -37,7 +37,7 @@ class RequestStateForm(forms.Form):
class DocForm(forms.ModelForm):
class Meta:
model = Document
- exclude = ("created", "author", "project")
+ exclude = ("created", "author")
# class DocForm(forms.Form):
# name = forms.CharField()