Note that there are some explanatory texts on larger screens.

plurals
  1. POBest way to generate deadlines for milestones from template for different users in django
    primarykey
    data
    text
    <p>I want to generate the list of various milestones to accomplish something, and the deadline for each of them is calculated dynamically from a final date given by the user.</p> <p>I'm not sure about the best way to handle this. The first idea that came to my mind is to write some <strike>template</strike> (not django template here) file on the server containing the necessary informations for generating all the steps, which will be fetched once for every new user, and used to create a list of milestone objects from a milestone class (some generic model in django). Maybe something written in json :</p> <pre><code>{"some_step": { "start_date" = "final_date-10", "end_date" = "final_date-7", } } </code></pre> <p>and the corresponding model</p> <pre><code>class Milestone(models.Model): name = models.Charfield() start_date = models.DateField() end_date = models.DateField() def time_to_final(self,time): return self.final_date-time </code></pre> <p>strings like the "finaldate-10" would be converted by some routine and passed at the registration time to the time_to_final method, when initializing the data for the new user in the database.</p> <p>However I'm not sure it's the best approach. Though it won't be used by millions of people, I'm worried about possible negative impacts on the server performances ? Is there a better, maybe more pythonic way ? </p> <p><strong>EDIT for more clarification :</strong></p> <p>A user wants to do complete something at date D0.</p> <p>My app generates the steps like this :</p> <ul> <li>do step 1 from date D1i to date D1f</li> <li>do step 2 from date D2i to date D2f -...</li> <li>until date D0 is reached and all tasks are completed</li> </ul> <p>All the dates are calculated when D0 is provided. All the steps are generated for every user.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload