<div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><div>Hi, guys:</div><div>     I find a non-coincidence definition in Oslo, </div><div><br></div><div>     oslo_utils.timeutils.utcnow is defined like this:</div><div><div>         <span style="font-family: 宋体; font-size: 13.5pt; white-space: pre-wrap; color: rgb(0, 0, 128); font-weight: bold;">def </span>utcnow(with_timezone=False):</div><div><br></div></div><div>    oslo_versonedobjects.fields.DateTimeField is defined like t<span style="font-family: 宋体; white-space: pre-wrap;">his</span></div><div><span style="font-family: 宋体; font-size: 13.5pt; white-space: pre-wrap; color: rgb(0, 0, 128); font-weight: bold;" class="">    class</span><font face="宋体"><span style="white-space: pre-wrap;"> DateTimeField(AutoTypedField):
        </span></font><span style="font-family: 宋体; font-size: 13.5pt; white-space: pre-wrap; color: rgb(0, 0, 128); font-weight: bold;" class="">def</span><font face="宋体"><span style="white-space: pre-wrap;"> __init__(self, tzinfo_aware=True, **kwargs):</span></font></div><div></div><div><br></div><div>    a = utcnow()</div><div>    class ABC(VersionedObject):</div><div>        fields = {</div><div>            created_at = fields.DateTimeField()</div><div>        }</div><div>    b = ABC(), and fill it by db record.</div><div><br></div><div>    If I compare a and b.created_at,  it will raise an exception like this:</div><div>       'TypeError: can't compare offset-naive and offset-aware datetimes'</div><div>    because a's value is like this:</div><div>        datetime.datetime(2017, 3, 7, 2, 34, 50, 859002)</div><div>    b.created_at 's value is like this:</div><div>         datetime.datetime(2017, 3, 7, 2, 35, 27, 400786,<span style="color: rgb(255, 0, 0);"><b> tzinfo=<iso8601.Utc></b></span>)</div><div><br></div><div><div>   Can these two kinds of time's definition be coincident? For example:</div><div>       <span style="font-family: 宋体; font-size: 13.5pt; white-space: pre-wrap; color: rgb(0, 0, 128); font-weight: bold;" class="">def</span> utcnow(with_timezone=<span style="color: rgb(255, 0, 0);"><b>False</b></span>):</div><div><br></div><div>       <span style="font-family: 宋体; font-size: 13.5pt; white-space: pre-wrap; color: rgb(0, 0, 128); font-weight: bold;" class="">class</span> DateTimeField(AutoTypedField):</div><div>            <span style="font-family: 宋体; font-size: 13.5pt; white-space: pre-wrap; color: rgb(0, 0, 128); font-weight: bold;" class="">def</span> __init__(self, tzinfo_aware=<span style="color: rgb(255, 0, 0);"><b>False</b></span>, **kwargs):</div></div><div><br></div><div>best wishes</div><div>zeng chen</div><div><pre style="font-family: 宋体; font-size: 13.5pt;"><span style="font-size: 14px;"><br></span></pre><pre style="font-family: 宋体; font-size: 13.5pt;"><span style="font-size: 14px;"><br></span></pre><pre style="font-family: 宋体; font-size: 13.5pt;"><span style="font-size: 14px;"><br></span></pre></div><div><font face="宋体"><span style="font-size: 18px; white-space: pre-wrap;"><br></span></font></div><div><span style="font-family: 宋体; font-size: 13.5pt; white-space: pre-wrap;"><br></span></div><div><br></div><div><br></div></div></div>