使用您自己的模型Django调度程序 [英] Using the Django scheduler app with your own models

查看:98
本文介绍了使用您自己的模型Django调度程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 https://github.com/llazzaro/django-scheduler 我会喜欢在日历中使用自己的模型,他们也有一个开始和结束日期。

Using the https://github.com/llazzaro/django-scheduler I'd like to use my own models in the calendar, they also have a start and end date.

我认为有多种方法可以解决这个问题:

I think there are multiple ways to solve this problem:



  1. 在创建模型时使用save()覆盖创建默认事件模式。

  2. 使用django-scheduler应用程序的事件关系到通用对象功能。

  3. 扩展默认事件模式以满足我自己的要求。

  1. Hack the current schedule app to make it interact with my models.
  2. Creating default event modals when creating my models, using the save() override.
  3. Use the "relations of events to generic objects" feature of the django-scheduler app.
  4. Extend the default event modals to meet my own requirements.

我想使用第三个选项,但是我不知道如何使用它,因为日历链接到单个对象。

I would like to use the third option but I wouldn't know how to use it since a calendar is linked to a single object.

我是新来的python和django,所以有人可以给我建议吗?

I'm new to both python and django, so could someone give me advice?

推荐答案

要实现选项3,您的通用对象将具有链接到该日历应用程序的 Event 对象的外键。

To achieve option 3, your generic object would have a foreign key linking to an Event object from that calendar app.

这篇关于使用您自己的模型Django调度程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆