Re: Set two fields to the same value

2012-07-21 Thread Melvyn Sopacua
On 12-7-2012 15:51, Jaroslav Dobrek wrote: > Users may create Test objects in order to run their own tests. A test > always starts at some date time and it always ends at some date time. Each > test has a time which is increased until it equals the end time. When a > user creates a new test (an

Re: Set two fields to the same value

2012-07-12 Thread luthur
you could only assign a Field variable in the Model, "time" absolutely not a Field, the error appears. -- luthur On Thursday, July 12, 2012 at 9:51 PM, Jaroslav Dobrek wrote: > Hello, > > how can I design a model such that two fields are set to the same value when > a new object of the ty

RE: Set two fields to the same value

2012-07-12 Thread lacrymol...@gmail.com
You could override .save... -Mensaje original- De: Jaroslav Dobrek Enviados: 12/07/2012 10:51:08 Asunto: Set two fields to the same value Hello, how can I design a model such that two fields are set to the same value when a new object of the type defined by the model is created

Set two fields to the same value

2012-07-12 Thread Jaroslav Dobrek
Hello, how can I design a model such that two fields are set to the same value when a new object of the type defined by the model is created? Example: class Test(models.Model): start_time = models.DateTimeField() end_time = models.DateTimeField() time = start_time Users may create