diff options
author | anujag <anujag@anujag-D630.(none)> | 2012-07-31 15:33:53 +0530 |
---|---|---|
committer | anujag <anujag@anujag-D630.(none)> | 2012-07-31 15:33:53 +0530 |
commit | c3eabc2a4de968da44adada1fa33cc66997de79d (patch) | |
tree | 322018e3d05f5193aaeb4e07e79ec815b1a97b53 /gstudio/models.py | |
parent | cc3f8b81565f7c360b30200485a9260b725b765d (diff) | |
download | gnowsys-c3eabc2a4de968da44adada1fa33cc66997de79d.tar.gz |
Minor changes in CNL and models
Diffstat (limited to 'gstudio/models.py')
-rw-r--r-- | gstudio/models.py | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/gstudio/models.py b/gstudio/models.py index e98f4b7..1e5ec0c 100644 --- a/gstudio/models.py +++ b/gstudio/models.py @@ -371,12 +371,13 @@ class NID(models.Model): reltype = [num for elem in reltype for num in elem] #this rqud for filtering for i in reltype: - titledict.update({i:i.id}) + titledict.update({i.title:i.id}) for i in range(len(titledict)): listval.append(Relationtype.objects.get(title = titledict.keys()[i])) - inverselist.append(str(titledict.keys()[i].inverse)) + obj=Relationtype.objects.get(title=titledict.keys()[i]) + inverselist.append(str(obj.inverse)) for j in range(len(pt)): for i in range(len(listval)): @@ -845,10 +846,16 @@ class Nodetype(Node): model='IPAddressField' aturl="admin/gstudio/attribute"+model.lower()+"/add/?attributetype="+str(each.id)+"&subject="+str(self.id) atsubject=self.subject_of.all() + """ + check whether Attribute for the current AT is already added or not + """ fl=0 for eachs in atsubject: if eachs.attributetype_id==each.id and eachs.subject_id==each.subjecttype.id: fl=1 + """ + fl=0 means, Attribute for AT is not added, now show it as to be added + " " " if fl==0: retats[each.title]=aturl @@ -1263,8 +1270,12 @@ class Nodetype(Node): return get_url_shortener()(self) def __unicode__(self): - displayname="NT: "+self.title - return displayname + objref=str(self.ref) + reftitle=str(self.ref.title) + objref=objref.replace(reftitle,"") + objtype=objref.strip() + return objtype + " " + self.title + @property def memberof_sentence(self): |