Python 2.7 ha raggiunto la fine del supporto
e verrà ritirato
il 31 gennaio 2026. Dopo il ritiro, non potrai eseguire il deployment di applicazioni Python 2.7, anche se la tua organizzazione ha utilizzato in precedenza un criterio dell'organizzazione per riattivare i deployment di runtime legacy. Le tue applicazioni Python 2.7 esistenti continueranno a essere eseguite e a ricevere traffico dopo la
data di ritiro. Ti consigliamo di eseguire la migrazione all'ultima versione supportata di Python.
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Questa API si trova nel modulo google.appengine.ext.ndb.metadata, solitamente utilizzata tramite from google.appengine.ext.ndb import metadata.
Funzioni
get_entity_group_version(chiave)
Restituisce la versione del gruppo di entità contenente la chiave.
Questa versione è garantita per aumentare a ogni modifica del gruppo di entità. La versione può essere incrementata anche in assenza di modifiche visibili all'utente al gruppo di entità. Può restituire None
se non è mai stata eseguita una scrittura nel gruppo di entità.
Avviso: il comportamento dei metadati del gruppo di entità ora è diverso. La versione del gruppo di entità può aumentare indipendentemente dagli aggiornamenti degli utenti. In precedenza, la versione del gruppo di entità aumentava solo in caso di aggiornamento dell'utente. Per mantenere il comportamento precedente, utilizza la soluzione alternativa per la versione del gruppo di entità.
Argomenti
chiave
per un gruppo di entità.
get_namespaces(start=None, end=None)
Restituisce un elenco di nomi di spazi dei nomi.
Argomenti
start
Non restituire i nomi degli spazi dei nomi precedenti in ordine alfabetico.
end
Non restituire i nomi dello spazio dei nomi dopo questo in ordine alfabetico.
get_kinds(start=None, end=None):
Restituisce un elenco di nomi di tipo nello spazio dei nomi corrente.
Argomenti
start
Non restituire i nomi di tipo precedenti in ordine alfabetico.
end
Non restituire i nomi di tipo dopo questo in ordine alfabetico.
Restituisce un dict che mappa i nomi delle proprietà per il nome del tipo specificato
ad elenchi di nomi di rappresentazioni come "STRING", "BOOLEAN" o "INT64".
Cerca solo nello spazio dei nomi corrente.
Per un elenco completo di questi tipi, consulta
Tipi di rappresentazione
Restituisce un elenco di nomi di proprietà per il nome kind specificato.
Argomenti
kind
Quali proprietà elencare.
start
Non restituire i nomi delle proprietà precedenti in ordine alfabetico.
end
Non restituire i nomi delle proprietà dopo questo in ordine alfabetico.
Tipi di rappresentazione
Classe di proprietà
Rappresentazione
StringProperty
STRING
BooleanProperty
BOOLEANO
IntegerProperty
INT64
FloatProperty
DOPPIO
DateTimeProperty
DateProperty
TimeProperty
INT64
UserProperty
UTENTE
BlobProperty
STRING
BlobKeyProperty
STRING
TextProperty
STRING
GeoPtProperty
POINT
GenericProperty
(dipende dal valore memorizzato).
ComputedProperty
(dipende dal valore memorizzato).
JsonProperty
STRING
PickleProperty
STRING
StructuredProperty
Quando ricevi i tipi di rappresentazione, le proprietà StructuredProperty
non vengono restituite. ma mostra i valori per le proprietà secondarie corrispondenti ai loro tipi di proprietà.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-04 UTC."],[[["\u003cp\u003eThis API, located in the \u003ccode\u003egoogle.appengine.ext.ndb.metadata\u003c/code\u003e module, is designed for use in first-generation runtimes within the App Engine standard environment, and users migrating to Python 3 should consult the migration guide.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eget_entity_group_version(key)\u003c/code\u003e function retrieves the version of an entity group, which increases with every change, potentially even without user-visible updates, and a workaround is available for maintaining legacy behavior.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eget_namespaces(start=None, end=None)\u003c/code\u003e, \u003ccode\u003eget_kinds(start=None, end=None)\u003c/code\u003e, \u003ccode\u003eget_properties_of_kind(kind, start=None, end=None)\u003c/code\u003e and \u003ccode\u003eget_representations_of_kind(kind, start=None, end=None)\u003c/code\u003e functions are used to list namespace names, kind names, property names and representation names respectively, with options for specifying alphabetical start and end boundaries.\u003c/p\u003e\n"],["\u003cp\u003eThe document outlines the various property classes and their corresponding representation types, such as \u003ccode\u003eStringProperty\u003c/code\u003e to \u003ccode\u003eSTRING\u003c/code\u003e and \u003ccode\u003eIntegerProperty\u003c/code\u003e to \u003ccode\u003eINT64\u003c/code\u003e, for different data types.\u003c/p\u003e\n"]]],[],null,["# NDB Metadata Reference\n\n| This page describes how to use the legacy bundled services and APIs. This API can only run in first-generation runtimes in the App Engine standard environment. If you are updating to the App Engine Python 3 runtime, refer to the [migration guide](/appengine/migration-center/standard/migrate-to-second-gen/python-differences) to learn about your migration options for legacy bundled services.\n\nThis API is in the `google.appengine.ext.ndb.metadata` module,\ntypically used via\n`from google.appengine.ext.ndb import metadata`.\n\nFunctions\n---------\n\nget_entity_group_version(key)\n: Return the version of the entity group containing key.\n This version is\n guaranteed to increase on every change to the entity group. The version may\n increase even in the absence of user-visible changes to the entity\n group. May return `None`\n if the entity group was never written to.\n\n **Warning** : The behavior of entity group metadata is now different. The entity\n group version can increase independently of user updates. Previously, the entity\n group version increased only on user update. To maintain legacy behavior, use the\n [entity group version workaround](https://support.google.com/cloud/answer/9133787#zippy=python-ndb).\n\n **Arguments**\n\n key\n : key for an entity group.\n\n\nget_namespaces(start=None, end=None)\n\n: Returns a list of namespace names. **Arguments**\n\n start\n : Don't return namespace names before this in alphabetical order.\n\n end\n : Don't return namespace names after this in alphabetical order.\n\nget_kinds(start=None, end=None):\n\n: Returns a list of kind names in the current namespace. **Arguments**\n\n start\n : Don't return kind names before this in alphabetical order.\n\n end\n : Don't return kind names after this in alphabetical order.\n\nget_properties_of_kind(kind, start=None,\nend=None):\n: Returns a list of property names for the given \u003cvar translate=\"no\"\u003ekind\u003c/var\u003e name\n in the current namespace.\n\n **Arguments**\n\n kind\n : Which kind's properties to list.\n\n start\n : Don't return property names before this in alphabetical order.\n\n end\n : Don't return property names after this in alphabetical order.\n\n\nget_representations_of_kind(kind, start=None,\nend=None)\n: Returns a `dict` mapping property names for the given kind name\n to lists of representation names such as 'STRING', 'BOOLEAN' or 'INT64'.\n Only looks in the current namespace.\n For a complete list of these types, see\n [Representation Types](#representations)\n\n: Returns a list of property names for the given \u003cvar translate=\"no\"\u003ekind\u003c/var\u003e name.\n\n **Arguments**\n\n kind\n : Which kind's properties to list.\n\n start\n : Don't return property names before this in alphabetical order.\n\n end\n : Don't return property names after this in alphabetical order.\n\nRepresentation Types\n--------------------"]]