Handling deferred attributes automatically
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 268
- Fork
- 100
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
Right now if an entity has a navigation property, the object must be completely reloaded (as below) to load in deferred data in navigation properties. For example:
orders = service.orders.get_entities()
for o in orders:
do_some_stuff_with(o.Customers) # This is an empty list right now so nothing will get done.
# The data must be reloaded as per the below for anything to happen.
orders = service.orders.get_entities().expand("Customers")
I propose that we use the OData __deferred attribute to fire a request on demand to load these attributes in. This would allow the API to look like this:
orders = service.orders.get_entities()
for o in orders:
do_some_stuff_with(o.Customers) # Request is automatically made using the `__deferred` attribute which transparently offers the missing data back to the class.
WDYT: @filak-sap
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia tracciando service.orders.get_entities(), le proprietà di navigazione come Customers e il comportamento esistente di expand("Customers"). Determina come l’attributo OData __deferred potrebbe attivare il caricamento su richiesta preservando l’API dell’entità; il risultato è raggiunto quando l’accesso a o.Customers fornisce in modo trasparente i dati differiti senza chiamare esplicitamente expand.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- api
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100