Пример #1
0
def viewUserDebts(request, userKey=None):
    from tuition.settings import SITE_SUPPORT_EMAIL
    from tuition.utils.manager import AppManager
    from models import Debt
    from forms import DebtForm, ExpenseYearFilter, DebtReturnForm
    from tuition.utils.appConstants import MONTH_NUM_FULL_NAME_DICT
    from tuition.utils.utils import ExportHandle, ExportClassHandle

    # keyToSetReminder = request.GET.get('key', None)
    # if keyToSetReminder:
    #   debt = Debt.get(keyToSetReminder)
    #   serializedObjectList = [debt.toDict]
    #   GoogleCalendarService()
    loggedInEmployee = AppManager.getUserByEmail(AppManager.getCurrentLoggedInUser().email())
    form = DebtForm(initial={'incurredDate' : datetime.date.today().strftime('%d/%m/%Y')})
    markAsReturnForm = DebtReturnForm()
    template_values = {
                       'loggedInEmployee'   : loggedInEmployee,
                       'yearFilterForm'     : ExpenseYearFilter(),
                       'monthNameDict'      : MONTH_NUM_FULL_NAME_DICT,
                       'exportHandle'       : ExportHandle.asDict(),
                       'classHandle'        : ExportClassHandle.asDict(),
                       'form'               : form,
                       'markAsReturnForm'   : markAsReturnForm
                       }
    return render_to_response('viewDebts.html', template_values, context_instance=RequestContext(request))
Пример #2
0
def viewUserDebts(request, userKey=None):
    from tuition.settings import SITE_SUPPORT_EMAIL
    from tuition.utils.manager import AppManager
    from models import Debt
    from forms import DebtForm, ExpenseYearFilter, DebtReturnForm
    from tuition.utils.appConstants import MONTH_NUM_FULL_NAME_DICT
    from tuition.utils.utils import ExportHandle, ExportClassHandle

    # keyToSetReminder = request.GET.get('key', None)
    # if keyToSetReminder:
    #   debt = Debt.get(keyToSetReminder)
    #   serializedObjectList = [debt.toDict]
    #   GoogleCalendarService()
    loggedInEmployee = AppManager.getUserByEmail(
        AppManager.getCurrentLoggedInUser().email())
    form = DebtForm(
        initial={'incurredDate': datetime.date.today().strftime('%d/%m/%Y')})
    markAsReturnForm = DebtReturnForm()
    template_values = {
        'loggedInEmployee': loggedInEmployee,
        'yearFilterForm': ExpenseYearFilter(),
        'monthNameDict': MONTH_NUM_FULL_NAME_DICT,
        'exportHandle': ExportHandle.asDict(),
        'classHandle': ExportClassHandle.asDict(),
        'form': form,
        'markAsReturnForm': markAsReturnForm
    }
    return render_to_response('viewDebts.html',
                              template_values,
                              context_instance=RequestContext(request))
Пример #3
0
def viewUserExpenses(request, userKey=None):
    from tuition.settings import SITE_SUPPORT_EMAIL
    from tuition.utils.manager import AppManager
    from models import Expenses
    from forms import ExpenseForm, ExpenseYearFilter
    from tuition.utils.appConstants import MONTH_NUM_FULL_NAME_DICT
    from tuition.utils.utils import ExportHandle, ExportClassHandle

    loggedInEmployee = AppManager.getUserByEmail(AppManager.getCurrentLoggedInUser().email())
    form = ExpenseForm(initial={'dateOfExpense' : datetime.date.today().strftime('%d/%m/%Y')})
    template_values = {
                       'loggedInEmployee'   : loggedInEmployee,
                       'yearFilterForm'     : ExpenseYearFilter(),
                       'monthNameDict'      : MONTH_NUM_FULL_NAME_DICT,
                       'exportHandle'       : ExportHandle.asDict(),
                       'classHandle'        : ExportClassHandle.asDict(),
                       'form'               : form
                       }
    return render_to_response('viewExpenses.html', template_values, context_instance=RequestContext(request))
Пример #4
0
def viewUserExpenses(request, userKey=None):
    from tuition.settings import SITE_SUPPORT_EMAIL
    from tuition.utils.manager import AppManager
    from models import Expenses
    from forms import ExpenseForm, ExpenseYearFilter
    from tuition.utils.appConstants import MONTH_NUM_FULL_NAME_DICT
    from tuition.utils.utils import ExportHandle, ExportClassHandle

    loggedInEmployee = AppManager.getUserByEmail(
        AppManager.getCurrentLoggedInUser().email())
    form = ExpenseForm(
        initial={'dateOfExpense': datetime.date.today().strftime('%d/%m/%Y')})
    template_values = {
        'loggedInEmployee': loggedInEmployee,
        'yearFilterForm': ExpenseYearFilter(),
        'monthNameDict': MONTH_NUM_FULL_NAME_DICT,
        'exportHandle': ExportHandle.asDict(),
        'classHandle': ExportClassHandle.asDict(),
        'form': form
    }
    return render_to_response('viewExpenses.html',
                              template_values,
                              context_instance=RequestContext(request))