python - A django page which controls a numerical model -


i creating webpage going used interface numerical model (controlled python wrapper). idea user can input parameters form on page, creates object necessary information run numerical model. forms.py

from django import forms models import chemrun  class chemrunform(forms.modelform):     class meta:             model = chemrun             fields = ('owner', 'title', 'times_max','temperature_min', 'temperature_max') 

my models.py

from django.db import models django.utils import timezone  class chemrun(models.model):     owner           =       models.foreignkey('auth.user')     title           =       models.charfield(max_length=200)     created_date    =       models.datetimefield(default=timezone.now)     times_max       =       models.decimalfield(max_digits=99, decimal_places=20, null=true)     temperature_min =       models.decimalfield(max_digits=99, decimal_places=20, null=true)     temperature_max =       models.decimalfield(max_digits=99, decimal_places=20, null=true)      def __unicode__(self):             return self.title 

and html code form start new model

<header>     <h2>start new model</h2> </header> <section>     <form action='/chemrun/create/' method='post'>{% csrf_token %}         <table>             {{form.as_table}}         </table>          <input type="submit" name="submit" value="new run">     </form> </section> 

now first question: how catch object contains model parameters , put queue these objects sent numerical model, , want able handle multiple cores (e.g. can specify x of these models running simultaneously). how handle this?

second question: afterwards numerical code create sqlite database results. how can make webapp alerted when models finish , send email user let them know data ready?

if can, please explain steps, since still bit of newbie on django, , prefer understand doing , why :)

many help!


Comments