Support for RawQuerySet #44

Closed
someidiot opened this Issue Nov 15, 2016 · 3 comments

Comments

Projects
None yet
2 participants
@someidiot

Is this possible? Sometimes the ORM just can't do what I need and a raw query is the easiest way to go.

@atodorov

This comment has been minimized.

Show comment
Hide comment
@atodorov

atodorov Nov 15, 2016

Contributor

@someidiot I will have to look a bit more into the code to verify whether or not this is possible but the straight out answer is no. chartit is very tightly coupled to QuerySet and it's API. It does use said API for validation and field lookups. This is making it very hard to add functionality that doesn't conform to QuerySet. Right now I'm thinking about refactoring quite a few pieces of the code to allow for more flexibility but haven't had the time to do so in the last month.

Let me get back to you on the RawQuerySet support in a week or so, it may turn out less trickier than I think.

Contributor

atodorov commented Nov 15, 2016

@someidiot I will have to look a bit more into the code to verify whether or not this is possible but the straight out answer is no. chartit is very tightly coupled to QuerySet and it's API. It does use said API for validation and field lookups. This is making it very hard to add functionality that doesn't conform to QuerySet. Right now I'm thinking about refactoring quite a few pieces of the code to allow for more flexibility but haven't had the time to do so in the last month.

Let me get back to you on the RawQuerySet support in a week or so, it may turn out less trickier than I think.

@someidiot

This comment has been minimized.

Show comment
Hide comment
@someidiot

someidiot Nov 15, 2016

Thanks. It's no biggie, just trying to avoid having two different charting methods in my code, it would be nice to use this for everything.

Thanks. It's no biggie, just trying to avoid having two different charting methods in my code, it would be nice to use this for everything.

atodorov added a commit to MrSenko/django-chartit that referenced this issue Nov 24, 2016

atodorov added a commit to MrSenko/django-chartit that referenced this issue Nov 24, 2016

@atodorov

This comment has been minimized.

Show comment
Hide comment
@atodorov

atodorov Nov 24, 2016

Contributor

@someidiot I have good news for you. I've managed to get a working support for RawQuerySet for Chart type of charts. Haven't looked into PivotChart yet, bout should be similar. The main change was that I needed to get rid of QuerySet.values() internally and make use of objects instead of dictionaries. However this is something I've been wanting to do for a while now.

Can you checkout my fork + topic branch, give it a try and let me know how that works for you? Also see the demoproject/ for some usage examples. I'm planning to release to PyPI very soon if this works for you.

Contributor

atodorov commented Nov 24, 2016

@someidiot I have good news for you. I've managed to get a working support for RawQuerySet for Chart type of charts. Haven't looked into PivotChart yet, bout should be similar. The main change was that I needed to get rid of QuerySet.values() internally and make use of objects instead of dictionaries. However this is something I've been wanting to do for a while now.

Can you checkout my fork + topic branch, give it a try and let me know how that works for you? Also see the demoproject/ for some usage examples. I'm planning to release to PyPI very soon if this works for you.

atodorov added a commit to MrSenko/django-chartit that referenced this issue Nov 24, 2016

atodorov added a commit to MrSenko/django-chartit that referenced this issue Nov 24, 2016

@atodorov atodorov closed this in bbd7152 Dec 4, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment