How can I force 2 fields in a Django model to share the same default value without repeating populating method? : <p>I have a Django model <code>MyModel</code> as shown below. </p>

<p>It has two fields of type DateTimeField: <code>my_field1</code>, <code>my_field2</code></p>

<pre><code>from django.db import models
from datetime import datetime

class MyModel(models.Model):
    my_field1 = models.DateTimeField(default=datetime.utcnow, editable=False)
    my_field2 = models.DateTimeField() 
</code></pre>

<p>I want both fields to default to the value of <code>datetime.utcnow()</code>. But I want to save <strong><em>the same</em></strong> value for both. It seems wasteful to call <code>utcnow()</code> twice.</p>

<p>How can I set the default value of <code>my_field2</code> so that it simply copies the default value of <code>my_field1</code>?</p>

<p>I tried adding an <code>__init__()</code> method to <code>MyModel</code> like this:</p>

<pre><code>def __init__(self, **kwargs):
    super(MyModel, self).__init__(**kwargs)
    if self.my_field2 is None:
        self.my_field2 = self.my_field1
</code></pre>

<p>But doing so broke the model as you can see here:</p>

<pre><code>&gt;&gt;&gt; MyModel.objects.all()
Traceback (most recent call last):
  File "&lt;console&gt;", line 1, in &lt;module&gt;
  File "MYvirtualenv/lib/python2.7/site-packages/django/db/models/query.py", line 138, in __repr__
    data = list(self[:REPR_OUTPUT_SIZE + 1])
  File "MYvirtualenv/lib/python2.7/site-packages/django/db/models/query.py", line 162, in __iter__
    self._fetch_all()
  File "MYvirtualenv/lib/python2.7/site-packages/django/db/models/query.py", line 965, in _fetch_all
    self._result_cache = list(self.iterator())
  File "MYvirtualenv/src/django-cache-machine-master/caching/base.py", line 118, in __iter__
    obj = iterator.next()
  File "MYvirtualenv/lib/python2.7/site-packages/django/db/models/query.py", line 255, in iterator
    obj = model_cls.from_db(db, init_list, row[model_fields_start:model_fields_end])
  File "MYvirtualenv/lib/python2.7/site-packages/django/db/models/base.py", line 489, in from_db
    new = cls(*values)
TypeError: __init__() takes exactly 1 argument (2 given)
</code></pre>

<p>What is the proper remedy? 
I need the value of <code>my_field2</code> to default to the value of <code>my_field1</code> (without calling the repeating the call to the default function that populated <code>my_field1</code>)</p>
