Esempio n. 1
0
 def delete(self,*args):
     if self.params.key:
         item = ActivityLog.get(self.params.key)
         if item:
             item.delete()
             self.status ='ActivityLog is deleted!'
         else:
             self.status='ActivityLog does not exist'
     else:
         self.status = 'Key was not Provided!'
     self.redirect(ActivityLogController.get_url())
Esempio n. 2
0
 def details(self, *args):
     if self.params.key:
         item = ActivityLog.get(self.params.key)
         if item:
             return {'op':'update', 'ActivityLogForm': ActivityLogForm(instance=item)}
         else:
             self.status = 'ActivityLog does not exists'
             self.redirect(ActivityLogController.get_url())
     else:
         self.status = 'Key not provided'
         return {'op':'insert' ,'ActivityLogForm':ActivityLogForm()}
Esempio n. 3
0
 def save(self, *args):
     instance = None
     if self.params.key:
         instance = ActivityLog.get(self.params.key)
     form=ActivityLogForm(data=self.request.POST, instance=instance)
     if form.is_valid():
         result=form.save(commit=False)
         result.put()
         self.status = 'ActivityLog is saved'
         self.redirect(ActivityLogController.get_url())
     else:
         self.SetTemplate(templateName = 'ActivityLog_edit.html')
         self.status = 'Form is not Valid'
         return {'op':'update', 'ActivityLogForm': form}