示例#1
0
 def insert_data(self):
     names = [
         'Uso de imagen', 'Exclusividad en rubro', 'Exclusividad total'
     ]
     for name in names:
         type_contract = TypeContract()
         type_contract.name = name
         type_contract.save()
示例#2
0
 def insert_data(self):
     names = [
         'Uso de imagen', 'Exclusividad en rubro', 'Exclusividad total'
     ]
     for name in names:
         type_contract = TypeContract()
         type_contract.name = name
         type_contract.save()
示例#3
0
 def post(self, request, *args, **kwargs):
     context = {}
     try:
         type_contract = TypeContract()
         type_contract.name = ''
         type_contract.save()
         context['status'] = 'success'
         context['status'] = self.MSG_SAVE
         context['type'] = {
             'name': type_contract.name,
             'id': type_contract.id
         }
     except:
         context['status'] = 'warning'
         context['status'] = self.MSG_ERROR
         return
     return self.render_to_response(context)
示例#4
0
 def post(self, request, *args, **kwargs):
     context = {}
     try:
         type_contract = TypeContract()
         type_contract.name = ''
         type_contract.save()
         context['status'] = 'success'
         context['status'] = self.MSG_SAVE
         context['type'] = {
             'name': type_contract.name,
             'id': type_contract.id
         }
     except:
         context['status'] = 'warning'
         context['status'] = self.MSG_ERROR
         return
     return self.render_to_response(context)