summaryrefslogtreecommitdiff
path: root/gstudio/forms.py
diff options
context:
space:
mode:
authorgnowgi <nagarjun@gnowledge.org>2012-03-15 16:19:20 +0530
committergnowgi <nagarjun@gnowledge.org>2012-03-15 16:19:20 +0530
commit7a4f561e851fdc7246d804c3abb6748b8a4199a6 (patch)
treed2afc3463fd49625a9be482012f5c3bfcf7c42b9 /gstudio/forms.py
downloadgnowsys-7a4f561e851fdc7246d804c3abb6748b8a4199a6.tar.gz
master trunk of gnowsys-studio
Diffstat (limited to 'gstudio/forms.py')
-rw-r--r--gstudio/forms.py94
1 files changed, 94 insertions, 0 deletions
diff --git a/gstudio/forms.py b/gstudio/forms.py
new file mode 100644
index 00000000..c4a1a0dc
--- /dev/null
+++ b/gstudio/forms.py
@@ -0,0 +1,94 @@
+# Copyright (c) 2011, 2012 Free Software Foundation
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+
+
+from gstudio.models import *
+from django.forms import ModelForm
+from django.contrib.admin import widgets
+
+class MetatypeForm(ModelForm):
+
+ class Meta:
+ model = Metatype
+
+class ObjecttypeForm(ModelForm):
+
+
+
+
+
+
+ class Meta:
+ model = Objecttype
+ fields = ('title', 'altnames','plural','parent','slug','metatypes','tags',
+ 'status','content','prior_nodes','posterior_nodes','password','login_required','sites')
+
+class AttributetypeForm(ModelForm):
+
+ class Meta:
+ model = Attributetype
+ fields =('title','altnames','subjecttype','applicable_nodetypes','dataType',
+ 'slug','status','content','prior_nodes','posterior_nodes','password','login_required','sites')
+
+class RelationtypeForm(ModelForm):
+
+ class Meta:
+ model = Relationtype
+ fields =('title','altnames','slug','inverse','left_subjecttype','left_applicable_nodetypes','right_subjecttype',
+ 'right_applicable_nodetypes','content','prior_nodes','posterior_nodes','sites')
+class SystemtypeForm(ModelForm):
+
+ class Meta:
+ model =Systemtype
+ fields =('title','altnames','content','parent','slug','status','nodetype_set','relationtype_set','attributetype_set','metatype_set','processtype_set',
+ 'prior_nodes','posterior_nodes','sites')
+
+
+class ProcesstypeForm(ModelForm):
+
+ class Meta:
+ model =Processtype
+ fields =('title','altnames','content','parent','slug','status','changing_attributetype_set','changing_relationtype_set',
+ 'prior_nodes','posterior_nodes','sites')
+
+
+class RelationForm(ModelForm):
+ class Meta:
+ model = Relation
+
+class AttributeForm(ModelForm):
+ def __init__(self, *args, **kwargs):
+ super(AttributeForm, self).__init__(*args, **kwargs)
+ self.fields['last_update'].widget = widgets.AdminSplitDateTime()
+ self.fields['creation_date'].widget = widgets.AdminSplitDateTime()
+
+ class Meta:
+ model = Attribute
+
+
+class ComplementForm(ModelForm):
+ class Meta:
+ model = Complement
+
+class UnionForm(ModelForm):
+ class Meta:
+ model = Union
+
+class IntersectionForm(ModelForm):
+ class Meta:
+ model = Intersection
+
+