Ejemplo n.º 1
0
 def add(self):
   if GenericViewer.add(self):
     return False
   payeeCategory = PayeeCategory(
     name = self.request.get('name'),
     )
   if (not users.is_current_user_admin() or
       self.request.get('owner') != ''):
       payeeCategory.owner = users.get_current_user()
   payeeCategory.put()
   self.messages.append('Payee category successfully added.')
   self.redirect()
   return True
Ejemplo n.º 2
0
 def add(self):
   if GenericViewer.add(self):
     return False
   bank = Bank(
     name = self.request.get('name'),
     country = self.request.get('country'),
     bankCode = self.request.get('bankCode'),
     bicBankCode = self.request.get('bicBankCode'),
     )
   bank.put()
   self.messages.append('Bank successfully added.')
   self.redirect()
   return True
Ejemplo n.º 3
0
 def add(self):
   if GenericViewer.add(self):
     return False
   account = Account(
     name = self.request.get('account'),
     bank = db.get(self.request.get('bank')),
     owner = users.get_current_user(),
     currency = self.request.get('currency'),
     )
   account.put()
   self.messages.append('Account successfully added.')
   self.redirect()
   return True
Ejemplo n.º 4
0
 def add(self):
   if GenericViewer.add(self):
     return False
   operation = Operation(
     number = self.request.get('number'),
     date = datetime.strptime(self.request.get('date'),'%m/%d/%Y'),
     description = self.request.get('description'),
     #payee,
     categories = db.get(self.request.get('category')),
     account = db.get(self.request.get('account')),
     amount = self.request.get('amount')
     )
   operation.put()
   self.messages.append('Operation ``%s'' successfully added.'
                        % operation.description)
   self.redirect('/operation?account=' + self.request.get('account'))
   return True