Coder Social home page Coder Social logo

Comments (7)

Sh4kE avatar Sh4kE commented on July 27, 2024 1

In my case this would also be needed, because I want to compare two distinct querysets and show the computed diff. Or is there also another possibility to do this kind of tasks?

from django-chartit.

atodorov avatar atodorov commented on July 27, 2024

@krautnerds - formatting datetime fields should be possible on the DB level using extra(), please see the latest commits for examples.

Otherwise the possibility to chart using model properties is sounds great but it is not easy to implement at the moment. chartit relies heavily on QuerySet (in fact it uses QuerySet.values() to fetch the data) and this operates on the DB level. It may be possible to rewrite the model manager to allow for this but I'm not sure how well will that work.

from django-chartit.

ajurna avatar ajurna commented on July 27, 2024

My problem stems from it using raw data from the DB so all my times are in utc with no good way to convert them to local time.

from django-chartit.

atodorov avatar atodorov commented on July 27, 2024

@Sh4kE - can you elaborate more on your use case ? How do you imagine you will compare query sets with chartit ? Without any more info I think you can compute the diff between the two query sets and create a new one from it. Then pass the new QS to chartit for plotting on a chart.

from django-chartit.

atodorov avatar atodorov commented on July 27, 2024

@ajurna datetime conversions should be now possible by using extra() or annotate() fields, see changelog and the examples in demo project. Let me know if that works for you ? Maybe we only need to update the docs to make this more visible.

from django-chartit.

ajurna avatar ajurna commented on July 27, 2024

timezone and strftime conversions are two very separate things...
doing both makes it look messy and makes it depend on a DB type which doesn't really suit me.

from django-chartit.

atodorov avatar atodorov commented on July 27, 2024

@krautnerds @Sh4kE @ajurna - hey guys I know I've been late to respond to this but I think I have finally managed to fix it. Following my changes related to #44 (removal of .values()) chartit now operates on objects instead of dictionaries and it was very easy to call a model property instead of a field.

Can you check out my fork + topic branch and tell me how that works for you? Note that the changes are only for DataPool, not PivotDataPool, which I'm planning to phase out.

from django-chartit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.