| Component | Naming style (snake_case) |
Example |
|---|---|---|
| Table | plural | posts, session, events, speakers |
| Model file | <singular of table name>.py |
event.py, session.py |
| Column | 1. <name> - singular if it represent a single data. Else plural. 2. If date only column: <name>_date3. If date-time column: <name>_date_time 4. If the column contains an image url, or any type of url, it should be suffixed with _url |
1. name, description 2. start_date, end_date 3. start_date_time, end_date_time 4. image_url, logo_url, event_url, ticket_url |
| Foreign Key id column | <singular of table name>_id |
session_id, speaker_id |
| Relationship | 1. <name> - singular for one-to-one2. <name> - plural for one-to-many3. <name> - singular for many-to-one3. <name> - singular for many-to-many |
1. An event model can have a call_for_speakers relation 2. Each track model will have a sessions relation 3. Each session model will have a track relation 4. Each session model will have a speakers relation. Each speaker model will have a sessions relation. |
| many-to-many intermediate table | The name is derived from the alphabetical order of the related model names. <name_of_model_one>_<name_of_model_two> (model one and two in alphabetical order) |
A table that holds the relation between events and users will be called. event_user |