Skip to content
This repository was archived by the owner on Oct 19, 2023. It is now read-only.
This repository was archived by the owner on Oct 19, 2023. It is now read-only.

Geolocation update #70

@fgazelot

Description

@fgazelot

Hi David,

I have to update or create a Geolocation element in SMC.

Using ipython, I notice that the request update_or_create( with_status=True ) return always updated = True after creation.

This is the example :

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

I use this version of smc-python :

In [3]:  smc.__version__                                                                                
Out[3]: '0.7.0-b16'

Did I miss a step?

Best regards,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions