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()
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)