コード例 #1
0
ファイル: models.py プロジェクト: LifeCoaching/commcare-hq
 def wrap(cls, data):
     # If "Z" is missing because of the Aug 2014 migration, then add it.
     # cf. Group class
     last_modified = data.get('last_modified')
     if last_modified and dt_no_Z_re.match(last_modified):
         data['last_modified'] += 'Z'
     return super(Program, cls).wrap(data)
コード例 #2
0
ファイル: models.py プロジェクト: tobiasmcnulty/commcare-hq
 def wrap(cls, data):
     from corehq.apps.groups.models import dt_no_Z_re
     # If "Z" is missing because of the Aug 2014 migration, then add it.
     # cf. Group class
     last_modified = data.get('last_modified')
     if last_modified and dt_no_Z_re.match(last_modified):
         data['last_modified'] += 'Z'
     return super(Product, cls).wrap(data)
コード例 #3
0
 def wrap(cls, data):
     from corehq.apps.groups.models import dt_no_Z_re
     # If "Z" is missing because of the Aug 2014 migration, then add it.
     # cf. Group class
     last_modified = data.get('last_modified')
     if last_modified and dt_no_Z_re.match(last_modified):
         data['last_modified'] += 'Z'
     return super(Product, cls).wrap(data)
コード例 #4
0
ファイル: models.py プロジェクト: LifeCoaching/commcare-hq
 def wrap(cls, data):
     last_modified = data.get('last_modified')
     # if it's missing a Z because of the Aug. 2014 migration
     # that added this in iso_format() without Z, then add a Z
     # (See also Group class)
     from corehq.apps.groups.models import dt_no_Z_re
     if last_modified and dt_no_Z_re.match(last_modified):
         data['last_modified'] += 'Z'
     return super(Location, cls).wrap(data)
コード例 #5
0
 def wrap(cls, data):
     last_modified = data.get('last_modified')
     data.pop('location_type', None)  # Only store location type in SQL
     # if it's missing a Z because of the Aug. 2014 migration
     # that added this in iso_format() without Z, then add a Z
     # (See also Group class)
     from corehq.apps.groups.models import dt_no_Z_re
     if last_modified and dt_no_Z_re.match(last_modified):
         data['last_modified'] += 'Z'
     return super(Location, cls).wrap(data)
コード例 #6
0
ファイル: models.py プロジェクト: ekush/commcare-hq
    def wrap(cls, data):
        last_modified = data.get("last_modified")
        data.pop("location_type", None)  # Only store location type in SQL
        # if it's missing a Z because of the Aug. 2014 migration
        # that added this in iso_format() without Z, then add a Z
        # (See also Group class)
        from corehq.apps.groups.models import dt_no_Z_re

        if last_modified and dt_no_Z_re.match(last_modified):
            data["last_modified"] += "Z"
        return super(Location, cls).wrap(data)
コード例 #7
0
 def test_matches_seconds_no_z(self):
     matches = dt_no_Z_re.match("2019-11-25T09:26:19")
     self.assertIsNotNone(matches)
コード例 #8
0
 def test_not_matches_milliseconds_tz(self):
     matches = dt_no_Z_re.match("2019-11-25T09:26:19.357709+0530")
     self.assertIsNone(matches)