burke-software / django-report-utils

Common functions used for reporting needs. Used by django-report-builder and django-report-scaffold.
Other
10 stars 27 forks source link

Please add filter_property function to this package #7

Closed predatell closed 9 years ago

predatell commented 10 years ago

File ".../report_utils/mixins.py", line 278, in report_to_list if filter_property(property_filter, val):

NameError: global name 'filter_property' is not defined

bufke commented 10 years ago

Yep that's certainly not right. It's a legacy of this being removed out of django report builder. Can I ask under what use case you encountered this error? Are you trying to make use of property_filters without using report builder?

https://github.com/burke-software/django-report-builder/blob/master/report_builder/views.py#L107

It might seem logical to move that function to this package - but it's very report builder specific. It even inspects fields from models in report builder - making it pretty useless outside report builder. I'm open to ideas.

predatell commented 10 years ago

This error means that python does not know this function. If you don't want to add this function to this module you should import it from any other module. Please look at this file: report_utils/mixins.py. You will find filter_property function there. But there is no import of this function in that module.

bufke commented 10 years ago

I'm aware of the issue - I'd like to understand your use case more. This project was made to abstract common code from report builder and report scaffold.

predatell commented 10 years ago

I am not using django-report-utils without django-report-builder. I use 2 these packages from pypi. But django-report-utils raise an error.

You gave me description of this function.

https://github.com/burke-software/django-report-builder/blob/master/report_builder/views.py#L107

But I can not understand how do you use it here:

https://github.com/burke-software/django-report-utils/blob/master/report_utils/mixins.py#L284

without importing ???

predatell commented 10 years ago

maybe we should add something like:

from report_builder.views import filter_property

bufke commented 10 years ago

Ah dang - ok I'll look at this soon. Guess the property feature isn't so popular if you're the first to report this.

bufke commented 9 years ago

property was greatly refactored in the report builder 3.x release. Reopen this if there is still a problem though.