示例#1
0
def picture_list(request, housingresources_id):
    context = {
        'module': 'listings',
        'housingresources_id': housingresources_id,
    }
    objs = HousingPicture.obs.get_queryset().filter(
        housing_resources__pk=housingresources_id).order_by('-order_no')

    page = request.GET.get('page', 1)
    clients = paging_objs(object_list=objs,
                          per_page=BACK_PAGE_COUNT,
                          page=page)

    context['clients'] = clients

    return render(request, 'super/housing/listings/img/list.html', context)
示例#2
0
def list(request):

    objs = HousingResources.obs.get_queryset().order_by('-created')

    page = request.GET.get('page', 1)
    clients = paging_objs(
        object_list=objs,
        per_page=BACK_PAGE_COUNT,
        page=page)

    context = {
        'module': 'listings_release',
        'clients': clients,
    }

    return render(request, 'super/release/listings/list.html', context)
示例#3
0
def bedroom_list(request, housingresources_id):
    context = {
        'module': 'listings',
        'housingresources_id': housingresources_id,
    }

    objs = Bedroom.objects.filter(
        housing_resources__pk=housingresources_id).order_by('-created')

    page = request.GET.get('page', 1)
    clients = paging_objs(object_list=objs,
                          per_page=BACK_PAGE_COUNT,
                          page=page)

    context['clients'] = clients

    return render(request, 'super/housing/listings/bedroom/list.html', context)
示例#4
0
def list(request):
    context = {'module': 'listings'}
    objs = HousingResources.obs.get_queryset().filter(
        audit_status=2).order_by('-created')

    search_name = request.GET.get('search_name', '')
    if search_name:
        context['search_name'] = search_name
        objs = objs.filter(user__profile__mobile__icontains=search_name)

    search_lease = request.GET.get('search_lease', -1)
    search_lease = int(search_lease) if search_lease else -1
    context['search_lease'] = search_lease
    if search_lease != -1:
        objs = objs.filter(lease=search_lease)

    search_status = request.GET.get('search_status', -1)
    search_status = int(search_status) if search_status else 0
    context['search_status'] = search_status
    if search_status != -1:
        objs = objs.filter(status=search_status)

    search_start = request.GET.get('search_start', '')
    if search_start:
        context['search_start'] = search_start
        start_date = datetime.datetime.strptime(search_start, '%Y-%m-%d')
        objs = objs.filter(created__gte=start_date)

    search_end = request.GET.get('search_end', '')
    if search_end:
        context['search_end'] = search_end
        end_date = datetime.datetime.strptime(search_end, '%Y-%m-%d')
        objs = objs.filter(created__lte=end_date)

    page = request.GET.get('page', 1)
    clients = paging_objs(object_list=objs,
                          per_page=BACK_PAGE_COUNT,
                          page=page)

    context['clients'] = clients

    return render(request, 'super/housing/listings/list.html', context)
示例#5
0
def meet_list(request):
    context = {'module': 'listings_meet'}
    objs = HousingResourcesMeet.obs.get_queryset().order_by('-created')

    search_start = request.GET.get('search_start', '')
    if search_start:
        context['search_start'] = search_start
        start_date = datetime.datetime.strptime(search_start, '%Y-%m-%d')
        objs = objs.filter(created__gte=start_date)

    search_end = request.GET.get('search_end', '')
    if search_end:
        context['search_end'] = search_end
        end_date = datetime.datetime.strptime(search_end, '%Y-%m-%d')
        objs = objs.filter(created__lte=end_date)

    page = request.GET.get('page', 1)
    clients = paging_objs(object_list=objs,
                          per_page=BACK_PAGE_COUNT,
                          page=page)

    context['clients'] = clients

    return render(request, 'super/housing/listings/meet/list.html', context)