예제 #1
0
 def pg_update_or_create(self, context, values):
     pg_ref = db.pg_get_by_pgid(context, values['pgid'])
     if pg_ref:
         pg = db.pg_update(context, pg_ref['id'], values)
     else:
         pg = db.pg_create(context, values)
     return pg
 def pg_update_or_create(self, context, values):
     pg_ref = db.pg_get_by_pgid(context, values['pgid'])
     if pg_ref:
         pg = db.pg_update(context, pg_ref['id'], values)
     else:
         pg = db.pg_create(context, values)
     return pg