def getExpenseThisWeek(self):
		import datetime
		from tuition.tools.models import Expenses
		from tuition.utils.manager import AppManager
		from tuition.utils.utils import weekStartEnd

		serializedObjects = []
		loggedInEmployee = AppManager.getUserByEmail(AppManager.getCurrentLoggedInUser().email())
		startOfWeek = weekStartEnd().get('start')
		thisWeeksExpense = Expenses.all().filter('user ='******'dateOfExpense >=', startOfWeek).order('-dateOfExpense')
		thisWeeksExpense = thisWeeksExpense.fetch(limit=1000)
		for expense in thisWeeksExpense:
			serializedObjects.append(expense.toDict)
		return self.respond(expenses=serializedObjects)
	def getDebtThisWeek(self):
		import datetime
		from tuition.tools.models import Debt
		from tuition.utils.manager import AppManager
		from tuition.utils.utils import weekStartEnd

		serializedObjects = []
		loggedInEmployee = AppManager.getUserByEmail(AppManager.getCurrentLoggedInUser().email())
		startOfWeek = weekStartEnd().get('start')
		thisWeeksDebt = Debt.all().filter('user ='******'incurredDate >=', startOfWeek).order('-incurredDate')
		thisWeeksDebt = thisWeeksDebt.fetch(limit=1000)
		for debt in thisWeeksDebt:
			serializedObjects.append(debt.toDict)
		return self.respond(debts=serializedObjects)
Example #3
0
    def getExpenseThisWeek(self):
        import datetime
        from tuition.tools.models import Expenses
        from tuition.utils.manager import AppManager
        from tuition.utils.utils import weekStartEnd

        serializedObjects = []
        loggedInEmployee = AppManager.getUserByEmail(
            AppManager.getCurrentLoggedInUser().email())
        startOfWeek = weekStartEnd().get('start')
        thisWeeksExpense = Expenses.all().filter(
            'user ='******'dateOfExpense >=',
                                           startOfWeek).order('-dateOfExpense')
        thisWeeksExpense = thisWeeksExpense.fetch(limit=1000)
        for expense in thisWeeksExpense:
            serializedObjects.append(expense.toDict)
        return self.respond(expenses=serializedObjects)
Example #4
0
    def getDebtThisWeek(self):
        import datetime
        from tuition.tools.models import Debt
        from tuition.utils.manager import AppManager
        from tuition.utils.utils import weekStartEnd

        serializedObjects = []
        loggedInEmployee = AppManager.getUserByEmail(
            AppManager.getCurrentLoggedInUser().email())
        startOfWeek = weekStartEnd().get('start')
        thisWeeksDebt = Debt.all().filter(
            'user ='******'incurredDate >=',
                                           startOfWeek).order('-incurredDate')
        thisWeeksDebt = thisWeeksDebt.fetch(limit=1000)
        for debt in thisWeeksDebt:
            serializedObjects.append(debt.toDict)
        return self.respond(debts=serializedObjects)