Giter Club home page Giter Club logo

Comments (3)

tab-cmd avatar tab-cmd commented on July 30, 2024

This is clearly a bug, thank you for bringing it to our attention @dorianamouroux . I think we should fix instead of just removing ability to sort @ihoru. This is useful feature when it works!

from django-cron.

dorianamouroux avatar dorianamouroux commented on July 30, 2024

I looked a little bit into it, the simplest way would be to create a duration field and store it, otherwise, you can't make it sortable, because the value has to come from the database.

I tried to use queryset.extra() and create the duration value in the SQL query, but depends on the database, the function to calculate the duration is different (DATEDIFF(end_date, start_date) in Mysql, julianday(end_date) - julianday(start_date) in sqlite).

If we create the duration value when we save the model, it wouldn't work for the existing cron log entries, we can create a management command to migrate those.

I can do it and send a PR if you think that's good

from django-cron.

tab-cmd avatar tab-cmd commented on July 30, 2024

@dorianamouroux I think that's a good idea and could be useful elsewhere. Go ahead with it and I'll review the PR. Thanks!

from django-cron.

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.