geofence setter def geofence self value self _check_target print -----

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
@geofence.setter
def geofence(self, value):
self._check_target()
print '----------------'
print 'GEOFENCE SETTER'
print 'value'
print value
data_geofence = {
'regionsets': value['regionsets'],
'campaign': GeofenceCampaign(**{
'date': GeofenceCampaignDate(**{
'from_date': value['campaign']['date']['from_date'],
'to_date': value['campaign']['date']['to_date'],
}),
'weekdays': value['campaign']['weekdays'],
'cap': GeofenceCampaignCap(**{
'limit': value['campaign']['cap']['limit'],
'period': value['campaign']['cap']['period']
})
})
}
print '----------------'
print 'data_geofence'
print data_geofence
print '----------------'
self.task.target.geofence = Geofence(**value)