def saveResaddr(self, vurl, vlevel, vuid='', vtitle=''): doc = Documents.objects.filter(url=vurl) if (len(doc) == 0): doc = Documents(url=vurl, uid=vuid, title=vtitle, level=vlevel) doc.save() #print 'create\n' else: if vuid != '': doc[0].uid = vuid doc[0].title = vtitle # doc.update() doc[0].save() doc = doc[0] #print 'update\n' return doc.id
def saveResaddr(self, vurl, vlevel, vuid="", vtitle=""): doc = Documents.objects.filter(url=vurl) if len(doc) == 0: doc = Documents(url=vurl, uid=vuid, title=vtitle, level=vlevel) doc.save() # print 'create\n' else: if vuid != "": doc[0].uid = vuid doc[0].title = vtitle # doc.update() doc[0].save() doc = doc[0] # print 'update\n' return doc.id
def saveNewResaddr(self, vurl, vlevel): doc = Documents.objects.filter(url=vurl) if (len(doc) == 0): doc = Documents(url=vurl, level=vlevel) doc.save() return doc.id
def saveNewResaddr(self, vurl, vlevel): doc = Documents.objects.filter(url=vurl) if len(doc) == 0: doc = Documents(url=vurl, level=vlevel) doc.save() return doc.id