Skip to content

Create MatchResult model #11

Description

@harryrigg

Create the MatchResult model on backend.

This model should be created inside the file server/api/models.py.

If you want an example of how this was done in previous projects, check out the event model from the co-exist project: https://github.com/codersforcauses/coexist/blob/main/server/api/event/models.py

Django documentation will also be very useful! https://docs.djangoproject.com/en/5.2/topics/db/models/
In particular, refer to the section on relationships (you will need this to create the foreign keys to Match and Team): https://docs.djangoproject.com/en/5.2/topics/db/models/#relationships

One thing to keep in mind is that in order to create this foreign keys, Django typically requires you to reference the related models. And, in this case these models won't exist until issues #8 and #9 have been completed! Instead, you can temporarily use a lazy relationship, specifying the related model as a string instead. For instance:
models.ForeignKey("Event", ...)

This model is little more involved than the Match and Team models, as it contains foreign keys and more fields:

Image

Metadata

Metadata

Assignees

Labels

backendTask must have a back end issuegood first issueGood for newcomers

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions