Commit 6a6e973
Alex
Implement schema_field_create/update/delete
We implement the create and update using a new internal helper called `_set_property`.
This new method will recursively search the passed current property dictionary and attempt to find all keys matching the key you pass in and update it's value to the value you have passed in.
If it cannot find the value in the current dictionary but it does find a "properties" dictionary, it will add a new entry in the "properties" dictionary.
This "properties" dictionary appears to only exist on the root of the properties dictionary.
A `schema_field_update` does a deep copy of the properties before updating them whereas the `schema_field_create` method starts from a base schema_field dictionary and updates it with what you pass in.
This does not deal with setting "editable" values in each of these keys. We are assuming, in Mockgun, that you are allowed to change anything in the schema.
Perhaps someone from the team at Shotgun will have some clear logic that will allow us to implement that.1 parent 0d306b9 commit 6a6e973
1 file changed
Lines changed: 60 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| 117 | + | |
117 | 118 | | |
118 | 119 | | |
119 | 120 | | |
| |||
227 | 228 | | |
228 | 229 | | |
229 | 230 | | |
230 | | - | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
231 | 262 | | |
232 | 263 | | |
233 | | - | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
234 | 268 | | |
235 | 269 | | |
236 | | - | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
237 | 273 | | |
238 | 274 | | |
239 | 275 | | |
| |||
422 | 458 | | |
423 | 459 | | |
424 | 460 | | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
425 | 465 | | |
426 | 466 | | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
427 | 484 | | |
428 | 485 | | |
429 | 486 | | |
| |||
0 commit comments