Monday 15 April 2013

How to make master-detail model / screen in Django? -


One thing that always strikes me is how to implement a master-extension application with Django. Example of customized invoices and invoice lines is.

Things to discuss are:

  • How to structure code for saving, loading etc. Master and expansion model
  • View: how to add files and templates, templates for detailed rows, dynamically
  • Autoclaimed fields (such as total on the original line), where this code goes?

    Edit / Addition:

    About the automated field, this is my first solution, will not it be better in the method of saving the model?

    The value needed from the master model is the expansion model (i.e. first to calculate yoga on each description, to save each line, and then to save and save the master) How is it made in more degenerations than calling the calling method?

    class = "post-text" itemprop = "text">
    • Master and detection models are two different models related to one. You must use model formatate (more) to include them in the same way.
    • To add dynamically to the rows you can think of
    • In the same field that applies to the automation, you can call it in pure javascript or an AJAX on "Action View" You can do this with a call (thus the code is in the template or in your thoughts, in the end the phone calls to other modules, like this, it really depends on you which calculation you are doing) < / Ul>

No comments:

Post a Comment