Skip to content

Allow IntervalSchedule to use a custom schedule type. #697

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sdrabblescripta
Copy link

No description provided.

Copy link
Member

@auvipy auvipy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we will need tests to verify the proposed changes

@sdrabblescripta
Copy link
Author

Of course, and I planned on adding them but I'm unable to run the current test suite so if you could provide advice on how to do that successfully (tox -e py38 returns a bunch of errors) then I'll be happy to add new tests.

Copy link
Member

@auvipy auvipy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please describe why we actually need this?

@auvipy auvipy requested a review from Copilot March 30, 2025 07:42
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enables the IntervalSchedule model to support a custom schedule type by allowing a dynamic assignment of the schedule class.

  • Introduces a new attribute (schedule_cls) to hold the schedule class
  • Modifies the schedule property to use schedule_cls instead of a hardcoded schedule
  • Updates the from_schedule class method to assign schedule_cls based on the provided schedule
Comments suppressed due to low confidence (1)

django_celery_beat/models.py:149

  • [nitpick] The attribute 'schedule_cls' could be misleading due to its leading and trailing underscores, which are typically reserved for special methods. Consider renaming it to 'schedule_cls' for clarity.
+    _schedule_cls_ = schedules.schedule

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants