Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- saveCalendar(value: any) {
- console.log("Updated Value"+ value); // value from the table
- this.body = {
- "promotionname": this.promotionname,
- "period": this.period,
- "indicator": this.indicator,
- "value": this.value
- };
- this.services.saveCalendar(this.body)
- .then(
- response => {
- if(response == "Success")
- {
- this.firstPage(this.clickedItem);
- }
- }
- );
- }
- saveCalendar(body: object): Promise<any> {
- return this.http.post(environment.serverUrl+'/api/update_promocal', body)
- .toPromise()
- .then(
- response => {
- if(response['_body'] == "Save Successful!")
- {
- return "Success";
- }
- }
- )
- .catch(error => console.log('Error while getting response: '+error))
- }
- def update_promocal(request):
- id1 = request.GET.get('id')
- column = request.GET.get('column')
- data = request.GET.get('data')
- test = Promocal.objects.get(id = id1)
- if column == 'promotionname':
- test.promotion_name = data
- elif column == 'period':
- test.period = data
- elif column == 'indicator':
- test.indicator = data
- elif column == 'value':
- test.value = data
- elif column == 'marketdriver':
- test.market_driver = data
- else:
- test.save()
- test.save()
Add Comment
Please, Sign In to add comment