Exemple #1
0
def getAgendaView(request):
    mlogger.debug("Display ")    
    page = getPage(request)
    today = datetime.now().date()   
    events = Event.objects.filter(institute__id=request.institute.id,when__gte=today).order_by('when')
    return object_list(request, queryset=events,
                           extra_context={},template_object_name="event",paginate_by=settings.EVENTS_PER_PAGE,page=page,template_name="events/agenda_display.html")
Exemple #2
0
def displayJobs(request):
    mlogger.debug("diplaying paginated list of jobs")
    page = getPage(request)
    jobs = Job.objects.filter(   Q(institute__isnull=True) | Q(institute__id=request.institute.id)  ).order_by('-createddate')
  
    
    return object_list(request, queryset=jobs,
                           extra_context={},template_object_name="job",paginate_by=settings.JOBS_PER_PAGE,page=page,template_name="jobs/display_jobs.html")
Exemple #3
0
def displayResearchArchive(request,faculty_name):
    mlogger.debug("display research archives..................")    
    faculty_name = faculty_name.replace("-"," ")
    profile = UserProfile.objects.get(fullname__iexact=faculty_name)
    user = profile.user
    entries = Entry.objects.filter(institute__id=request.institute.id,user__id=user.id,research_paper=True).order_by('-createddate')
    page = getPage(request)    
    return object_list(request, queryset=entries,
                           extra_context={},template_object_name="entry",paginate_by=settings.ARCHIVES_PER_PAGE,page=page,template_name="publish/faculty_publish_archives.html")
Exemple #4
0
def displayFunds(request):    
    mlogger.debug("displaying all the funds  .............")
    today = datetime.datetime.today().date()
    funds = Fund.objects.filter(institute__id=request.institute.id,deadline__gte=today,totaldonations__lt=F('totalamount')).order_by('-createddate')    
    
    page = getPage(request)    
    return object_list(request, queryset=funds,extra_context={'type':'open'},
                       template_object_name="fund", paginate_by=settings.FUNDS_PER_PAGE,
                       page=page,template_name="payments/funds.html")
Exemple #5
0
def displayClosedFunds(request):
    mlogger.debug("display closed funds")
    #funds which crossed their expiry date
    #funds which raised enough amount
    today = datetime.datetime.today().date()   
    funds = Fund.objects.filter(institute__id=request.institute.id).filter( Q(deadline__lt=today) | Q(totaldonations__gte=F('totalamount')) ).order_by('-createddate')
    page = getPage(request)    
    return object_list(request, queryset=funds,extra_context={'type':'close'},
                       template_object_name="fund", paginate_by=settings.FUNDS_PER_PAGE,
                       page=page,template_name="payments/funds.html")
Exemple #6
0
def displayJobs(request):
    mlogger.debug("diplaying paginated list of jobs")
    page = getPage(request)
    jobs = Job.objects.filter(
        Q(institute__isnull=True)
        | Q(institute__id=request.institute.id)).order_by('-createddate')

    return object_list(request,
                       queryset=jobs,
                       extra_context={},
                       template_object_name="job",
                       paginate_by=settings.JOBS_PER_PAGE,
                       page=page,
                       template_name="jobs/display_jobs.html")
Exemple #7
0
def displayClosedFunds(request):
    mlogger.debug("display closed funds")
    #funds which crossed their expiry date
    #funds which raised enough amount
    today = datetime.datetime.today().date()
    funds = Fund.objects.filter(institute__id=request.institute.id).filter(
        Q(deadline__lt=today)
        | Q(totaldonations__gte=F('totalamount'))).order_by('-createddate')
    page = getPage(request)
    return object_list(request,
                       queryset=funds,
                       extra_context={'type': 'close'},
                       template_object_name="fund",
                       paginate_by=settings.FUNDS_PER_PAGE,
                       page=page,
                       template_name="payments/funds.html")
Exemple #8
0
def displayFunds(request):
    mlogger.debug("displaying all the funds  .............")
    today = datetime.datetime.today().date()
    funds = Fund.objects.filter(
        institute__id=request.institute.id,
        deadline__gte=today,
        totaldonations__lt=F('totalamount')).order_by('-createddate')

    page = getPage(request)
    return object_list(request,
                       queryset=funds,
                       extra_context={'type': 'open'},
                       template_object_name="fund",
                       paginate_by=settings.FUNDS_PER_PAGE,
                       page=page,
                       template_name="payments/funds.html")
Exemple #9
0
def displayNewsLetters(request):
    mlogger.debug("Display news letters home...........................")   
    entries = Entry.objects.filter(institute__id=request.institute.id,research_paper=False).order_by('-createddate')
    page = getPage(request)    
    return object_list(request, queryset=entries,
                           extra_context={},template_object_name="entry",paginate_by=settings.ENTRIES_PER_PAGE,page=page,template_name="publish/institute_publish_home.html")
Exemple #10
0
def getMyPosts(request):
    mlogger.debug("get the post which are posted by user")
    entries = Entry.objects.filter(institute__id=request.institute.id,user__id=request.user.id).order_by('-createddate')
    page = getPage(request)
    return object_list(request, queryset=entries,
                           extra_context={},template_object_name="entry",paginate_by=settings.ARCHIVES_PER_PAGE,page=page,template_name="publish/institute_myposts.html")