I have to update or create a Geolocation element in SMC.
In [4]: from smc.elements.other import Geolocation
In [5]: instance, updated, created = Geolocation.update_or_create(
...: with_status=True, name='Geo_Test', latitude='48.86', longitude='2.33')
...:
...: print('instance',instance)
...: print('updated',updated)
...: print('created',created)
instance Geolocation(name=Geo_Test)
updated False
created True
In [6]: instance, updated, created = Geolocation.update_or_create(
...: with_status=True, name='Geo_Test', latitude='48.86', longitude='2.33')
...:
...: print('instance',instance)
...: print('updated',updated)
...: print('created',created)
instance Geolocation(name=Geo_Test)
updated True
created False
In [7]: instance, updated, created = Geolocation.update_or_create(
...: with_status=True, name='Geo_Test', latitude='48.86', longitude='2.33')
...:
...: print('instance',instance)
...: print('updated',updated)
...: print('created',created)
instance Geolocation(name=Geo_Test)
updated True
created False
In [3]: smc.__version__
Out[3]: '0.7.0-b16'
Hi David,
I have to update or create a Geolocation element in SMC.
Using
ipython, I notice that the requestupdate_or_create( with_status=True )return alwaysupdated = Trueafter creation.This is the example :
I use this version of smc-python :
Did I miss a step?
Best regards,