Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Essa API está no módulo google.appengine.ext.ndb.metadata,
normalmente usado por meio de
from google.appengine.ext.ndb import metadata.
Funções
get_entity_group_version(key)
Retorna a versão do grupo de entidades que contém a chave.
Essa versão certamente aumenta a cada alteração feita no grupo de entidades. A versão pode aumentar mesmo na ausência de alterações visíveis ao usuário feitas no grupo de entidades. Poderá retornar None
se o grupo de entidades jamais tiver sido gravado.
Aviso: agora, o comportamento dos metadados do grupo de entidades é diferente. A versão do grupo de entidades
pode aumentar independentemente das atualizações do usuário. Anteriormente, a versão do grupo de entidades aumentava apenas quando o usuário fazia uma atualização. Para manter o comportamento legado, use a
solução alternativa da versão de grupo de entidades (link em inglês).
Argumentos
key
chave de um grupo de entidades.
get_namespaces(start=None, end=None)
Retorna uma lista de nomes de namespace.
Argumentos
start
Não retornar nomes de namespace antes deste em ordem alfabética.
end
Não retornar nomes de namespace depois deste em ordem alfabética.
get_kinds(start=None, end=None):
Retorna uma lista de nomes de tipo no namespace atual.
Argumentos
start
Não retornar nomes de tipo antes deste em ordem alfabética.
end
Não retornar nomes de tipo depois deste em ordem alfabética.
Retorna um nome de propriedade de mapeamento dict para o nome do tipo fornecido
para listas de nomes de representação, como "STRING", "BOOLEAN" ou "INT64".
Examina apenas o namespace atual.
Para ver uma lista completa desses tipos, consulte
Tipos de representação
Retorna uma lista de nomes de propriedade para o nome kind fornecido.
Argumentos
kind
O tipo do qual as propriedades serão listadas.
start
Não retornar nomes de propriedade antes deste em ordem alfabética.
end
Não retornar nomes de propriedade depois deste em ordem alfabética.
Tipos de representação
Classe de propriedade
Representação
StringProperty
STRING
BooleanProperty
BOOLEAN
IntegerProperty
INT64
FloatProperty
DOUBLE
DateTimeProperty
DateProperty
TimeProperty
INT64
UserProperty
USER
BlobProperty
STRING
BlobKeyProperty
STRING
TextProperty
STRING
GeoPtProperty
POINT
GenericProperty
Depende do valor armazenado.
ComputedProperty
Depende do valor armazenado.
JsonProperty
STRING
PickleProperty
STRING
StructuredProperty
Quando você recebe tipos de representação, as propriedades StructuredProperty
não são retornadas. Em vez disso, ele mostra valores para as
subpropriedades correspondentes aos tipos de propriedade delas.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 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--------------------"]]