I want to create a table in database which will store the holidays of three months that are August, September and October. I am planning to create this array because different months will have different list of holidays which we cant store in postgres database. This table "Holidays" will have only one row with array in each column for August, September and October. Later when I have to check a date from psql query, I can check the arrays in this table for a particular month to find whether it is a holiday or not. So I have two questions. First how can we define this model in Django models.py file. Actually I am creating a populating script which fills the data in the tables created by Django models. And second, is there a better way of doing this ?
-
1Why arrays? Why not a row per holiday, with separate columns for day and month - or even a single date column?Daniel Roseman– Daniel Roseman2018-11-08 12:42:39 +00:00Commented Nov 8, 2018 at 12:42
-
Thanks. That would be better.Gaurav Mishra– Gaurav Mishra2018-11-08 12:57:12 +00:00Commented Nov 8, 2018 at 12:57
Add a comment
|