找出调度程序关系模型

发布于 2024-08-09 10:02:55 字数 174 浏览 6 评论 0原文

我正在尝试解决关系模型以便制作 Django 应用程序。

我不会成为麦当劳的员工调度员。我的意思是带有彩色别针的网格,标记谁将在给定工作日的给定时间工作。

我确实尝试用谷歌搜索一些例子,但我没有找到任何东西。我需要一些理论/参考书目才能构建我的模型并将其编码到我的应用程序中。

提前致谢

I'm trying to solve the relational model in order to make a Django app.

I't will be something like a McDonald's crew scheduler. I mean the grid with colored pins marking who will be working at a given hour a given weekday.

I did try to Google out some example, but I didn't find anything. I need some theory/bibliography in order to build up my model and code it into my app.

Thanks in advance

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

烦人精 2024-08-16 10:02:55

从简短的描述来看,您的应用程序中可能不会只有一种模型。

根据您的问题,我假设您对数据库没有太多经验...以下是一些建议:

从这里开始因为如果您不了解数据库设计、外键、一对一、一对多、多对多等基本原理ETC;你将很难设计 Django 模型。

如果也学习 SQL 那就太好了。 Django 模型应该让你免受它的影响,但实际上它在底层使用 SQL,了解 SQL 将使你能够在将来检查和修复性能问题。有一些资源 也在线。如果您使用 SQLite,也要学习它的语法

无论您最终使用什么 Web 框架,上面的内容都可以重复使用。 Django、Rails、下一个大事件……无论如何。

研究其他人的数据模型。 这里有几个不同的 - 也许您可以找到您正在寻找的那个(员工轮班?轮班安排?)。

然后阅读基本的 django 模型文档并真正理解它。 django 模型所做的是将 python 对象映射到关系数据库表(ORM 是缩写词;对象关系映射)和

不要灰心。每个人都必须从某个地方开始。

希望您找到您需要的一切。和姜戈一起玩吧。

From the short description, you probably wouldn't have just one model in your app.

From your question I'm assuming you don't have a lot of experience with databases... Here are a few suggestions:

Start here because if you don't understand the basic principles of database design, foreign keys, one-to-one, one-to-many, many-to-many, etc etc etc; you will have a hard time designing your Django models.

It would be nice to learn SQL too. Django models are supposed to insulate you from it, but in reality it is using SQL underneath and knowing SQL will enable you to check and fix performance issues in the future. There are some resources online too. And if you are using SQLite, learn its syntax too.

The above is stuff that you will be able to reuse regardless of the web framework you end up with. Django, Rails, the next big thing... whatever.

Study other people's data models. Here are several different ones - maybe you can find the one you are looking for (employee shifts? shift scheduling?).

Then read the basic django model documentation and really understand it. What django models are doing is mapping python objects to relational database tables (ORM is the acronym; Object Relational Mapping) and this article may very well help you in coming up with good designs.

Don't get discouraged. Everybody had to start somewhere.

Hope you find all you need. Have fun with Django.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文