A
Size: a a a
A
𝕬
Reserved.objects.create(
workspace=Workspace.objects.get(pk=id), # workspace__id=id
...
)
A
𝕬
𝕬
A
𝕬
class Workspace(models.Model):
pass
class Reserved(models.Model):
workspace = models.ForeignKey(
to=Workspace,
related_name=”reserved”,
on_delete=models.CASCADE
)
БГ
БГ
POST /workspaces/reservate
from: int, to: int
GET /workspaces/view
workspace: int
GET /workspaces/free
datetime_from: str,
datetime_to: str
users:
id int (primary)
tokens:
token (uniq),
user (FK users.id)
workspaces:
id int (primary),
reservations:
id int (primary),
user int (FK users.id),
workspace int (FK workspaces.id),
from_time,
to_time
БГ
БГ
БГ
G
AD
import this
G
AD
G
G
from __future__ import barry_as_FLUFL
G
M