Пример #1
0
    def get(self, request, parcel=None):
        config = RequestConfig(request)
        parcelDoesNotExist = False
        if parcel:
            parcelNumber = parcel
            form = NeighborhoodAssocationSearchForm(request.GET)
            try:
                selected_property = Property.objects.get(parcel=parcelNumber)
                na = Neighborhood_Association.objects.filter(
                    geometry__contains=selected_property.geometry).order_by('area2')
            except Property.DoesNotExist:
                na = Neighborhood_Association.objects.all().order_by('name')
                parcelDoesNotExist = True

        else:
            form = NeighborhoodAssocationSearchForm()
            na = Neighborhood_Association.objects.all().order_by('name')
            parcelNumber = ''

        naTable = NeighborhoodAssociationTable(na, prefix="na-")
        config.configure(naTable)

        return render_to_response('neighborhood_associations.html', {
            'form': form,
            'title': parcelNumber,
            'table': naTable,
            'parcelDoesNotExist': parcelDoesNotExist
        }, context_instance=RequestContext(request))
Пример #2
0
    def get(self, request, parcel=None):
        config = RequestConfig(request)
        parcelDoesNotExist = False
        if parcel:
            parcelNumber = parcel
            form = NeighborhoodAssocationSearchForm(request.GET)
            try:
                selected_property = Property.objects.get(parcel=parcelNumber)
                na = Neighborhood_Association.objects.filter(
                    geometry__contains=selected_property.geometry).order_by(
                        'area2')
            except Property.DoesNotExist:
                na = Neighborhood_Association.objects.all().order_by('name')
                parcelDoesNotExist = True

        else:
            form = NeighborhoodAssocationSearchForm()
            na = Neighborhood_Association.objects.all().order_by('name')
            parcelNumber = ''

        naTable = NeighborhoodAssociationTable(na, prefix="na-")
        config.configure(naTable)

        return render_to_response('neighborhood_associations.html', {
            'form': form,
            'title': parcelNumber,
            'table': naTable,
            'parcelDoesNotExist': parcelDoesNotExist
        },
                                  context_instance=RequestContext(request))
Пример #3
0
def	showApplications(request):
	config = RequestConfig(request)
	soldProperties = Property.objects.all().filter(status__exact='Sold').order_by('status', 'applicant')
	approvedProperties = Property.objects.all().filter(status__istartswith='Sale').order_by('status', 'applicant')
	soldTable = PropertyStatusTable(soldProperties, prefix="1-")
	approvedTable = PropertyStatusTable(approvedProperties, prefix="2-")
	config.configure(soldTable)
	config.configure(approvedTable)
	return render(request, 'renew/app_status_template.html', {'soldTable': soldTable, 'approvedTable': approvedTable, 'title': 'applications & sale activity'})
Пример #4
0
def showAnnualReportIndex(request):
    config = RequestConfig(request)
    f = AnnualReportFilters(
        request.GET, queryset=annual_report.objects.all().order_by('id'))
    table = AnnualReportTable(f)
    config.configure(table)
    return render_to_response('admin-with-filter-table.html', {
        'filter': f,
        'title': 'Annual Report Admin',
        'table': table
    }, context_instance=RequestContext(request))
Пример #5
0
def condition_report_list(request):
    config = RequestConfig(request)
    f = ConditionReportFilters(
        request.GET, queryset=ConditionReport.objects.all().order_by('-timestamp'))
    table = ConditionReportTable(f)
    config.configure(table)
    return render_to_response('admin-with-filter-table.html', {
        'filter': f,
        'title': 'Condition Reports Admin',
        'table': table
    }, context_instance=RequestContext(request))
Пример #6
0
def inquiry_list(request):
    config = RequestConfig(request)
    f = PropertyInquiryFilters(
        request.GET, queryset=propertyInquiry.objects.all().order_by('-timestamp'))
    table = PropertyInquiryTable(f)
    config.configure(table)
    return render_to_response('admin-with-filter-table.html', {
        'filter': f,
        'title': 'Property Inquiry Admin',
        'table': table
    }, context_instance=RequestContext(request))
Пример #7
0
def showAnnualReportIndex(request):
    config = RequestConfig(request)
    f = AnnualReportFilters(
        request.GET, queryset=annual_report.objects.all().order_by('id'))
    table = AnnualReportTable(f)
    config.configure(table)
    return render_to_response('admin-with-filter-table.html', {
        'filter': f,
        'title': 'Annual Report Admin',
        'table': table
    },
                              context_instance=RequestContext(request))
Пример #8
0
    def get_table(self, queryset, downloadable=False):
        """Convert the queryset to a report table."""
        if not getattr(self, 'table_class', None):
            raise ImproperlyConfigured("Report class must define `table_class`")
        data = self.get_table_data(queryset)
        if downloadable:
            downloadable_class = getattr(self, 'downloadable_table_class', self.table_class)
            table = downloadable_class(
                data, empty_text=self.empty_text, attrs=self.attrs
            )
        else:
            table = self.table_class(data, empty_text=self.empty_text, attrs=self.attrs)

        config = RequestConfig(self.request, paginate={
            'per_page': self.page_size,
        })
        config.configure(table)
        return table
Пример #9
0
def showApplications(request):
    config = RequestConfig(request)

    soldProperties = Property.objects.all().filter(
        status__istartswith='Sold').order_by('status', 'applicant')
    approvedProperties = Property.objects.all().filter(
        status__istartswith='Sale').order_by('status', 'applicant')

    soldFilter = ApplicationStatusFilters(
        request.GET, queryset=soldProperties, prefix="sold-")
    approvedFilter = ApplicationStatusFilters(
        request.GET, queryset=approvedProperties, prefix="approved-")

    soldTable = PropertyStatusTable(soldFilter, prefix="sold-")
    approvedTable = PropertyStatusTable(approvedFilter, prefix="approved-")

    config.configure(soldTable)
    config.configure(approvedTable)
    return render(request, 'app_status_template.html', {'soldTable': soldTable, 'approvedTable': approvedTable, 'title': 'applications & sale activity', 'soldFilter': soldFilter, 'approvedFilter': approvedFilter})
Пример #10
0
    def get_table(self, queryset, downloadable=False):
        """Convert the queryset to a report table."""
        if not getattr(self, 'table_class', None):
            raise ImproperlyConfigured(
                "Report class must define `table_class`")
        data = self.get_table_data(queryset)
        if downloadable:
            downloadable_class = getattr(self, 'downloadable_table_class',
                                         self.table_class)
            table = downloadable_class(data,
                                       empty_text=self.empty_text,
                                       attrs=self.attrs)
        else:
            table = self.table_class(data,
                                     empty_text=self.empty_text,
                                     attrs=self.attrs)

        config = RequestConfig(self.request,
                               paginate={
                                   'per_page': self.page_size,
                               })
        config.configure(table)
        return table