Exemplo n.º 1
0
 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
Exemplo n.º 2
0
 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
Exemplo n.º 3
0
 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
Exemplo n.º 4
0
 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