I am trying to figure out the best way to go about this. Here is the
scenario:

I have five fields in my model that the user will set from the admin.
When they save the model I want to insert a value into another field
of the model based on these values.

Where/How is the best place to handle this.

Here are the specifics:

class Job(models.Model):
                job_id = models.AutoField(primary_key=True)
                job_name = models.CharField(max_length=50)
                server = models.CharField(max_length=25)
                minute = models.CharField(max_length=10, choices = 
u.min_choices())
                hour = models.CharField(max_length=10, choices = 
u.hour_choices())
                day_of_month = models.CharField(max_length=10, choices =
u.dom_choices())
                month = models.CharField(max_length=10, choices = 
u.mon_choices())
                day_of_week = models.CharField(max_length=10, choices = 
u.dow_choices
())
                next_run_time = models.DateTimeField(blank=True)

What I want to do is based on the values of minute, hour,
day_of_month, month and day_of_week I want to calculate the
next_run_time and save that to the Job model.

thanks



--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.


Reply via email to