Commit 9a02ba6b authored by Denis Laxalde's avatar Denis Laxalde
Browse files

Drop deprecated CWCache entity type

parent 114b05d48c44
......@@ -125,25 +125,3 @@ class CWProperty(AnyEntity):
return self._cw._(self._cw.vreg.property_info(self.pkey)['help'])
except UnknownProperty:
return u''
class CWCache(AnyEntity):
"""Cache"""
__regid__ = 'CWCache'
fetch_attrs, cw_fetch_order = fetch_config(['name'])
def __init__(self, *args, **kwargs):
warn('[3.19] CWCache entity type is going away soon. '
'Other caching mechanisms can be used more reliably '
'to the same effect.',
DeprecationWarning)
super(CWCache, self).__init__(*args, **kwargs)
def touch(self):
self._cw.execute('SET X timestamp %(t)s WHERE X eid %(x)s',
{'t': datetime.now(), 'x': self.eid})
def valid(self, date):
if date:
return date > self.timestamp
return False
......@@ -259,12 +259,6 @@ msgstr "Attribut"
msgid "CWAttribute_plural"
msgstr "Attribute"
msgid "CWCache"
msgstr "Cache"
msgid "CWCache_plural"
msgstr "Caches"
msgid "CWComputedRType"
msgstr ""
......@@ -546,9 +540,6 @@ msgstr "Neues Lesezeichen"
msgid "New CWAttribute"
msgstr "Neue finale Relationsdefinition"
msgid "New CWCache"
msgstr "Neuer Anwendungs-Cache"
msgid "New CWComputedRType"
msgstr ""
......@@ -767,9 +758,6 @@ msgstr "Dieses Lesezeichen:"
msgid "This CWAttribute:"
msgstr "diese finale Relationsdefinition:"
msgid "This CWCache:"
msgstr "Dieser Anwendungs-Cache:"
msgid "This CWComputedRType:"
msgstr ""
......@@ -974,13 +962,6 @@ msgstr "Eine Dezimalzahl (float) wird erwartet."
msgid "a number (in seconds) or 20s, 10min, 24h or 4d are expected"
msgstr ""
msgid ""
"a simple cache entity characterized by a name and a validity date. The "
"target application is responsible for updating timestamp when necessary to "
"invalidate the cache (typically in hooks). Also, checkout the AppObject."
"get_cache() method."
msgstr ""
msgid "abstract base class for transitions"
msgstr "abstrakte Basisklasse für Übergänge"
......@@ -1107,9 +1088,6 @@ msgstr ""
msgid "add a CWAttribute"
msgstr ""
msgid "add a CWCache"
msgstr ""
msgid "add a CWComputedRType"
msgstr ""
......@@ -3199,10 +3177,6 @@ msgctxt "BaseTransition"
msgid "name"
msgstr "Name"
msgctxt "CWCache"
msgid "name"
msgstr "Name"
msgctxt "CWComputedRType"
msgid "name"
msgstr ""
......@@ -3247,9 +3221,6 @@ msgctxt "WorkflowTransition"
msgid "name"
msgstr "Name"
msgid "name of the cache"
msgstr "Name des Caches"
msgid ""
"name of the main variables which should be used in the selection if "
"necessary (comma separated)"
......@@ -4064,13 +4035,6 @@ msgstr "cette ressource est introuvable"
msgid "thursday"
msgstr "Donnerstag"
msgid "timestamp"
msgstr "Datum"
msgctxt "CWCache"
msgid "timestamp"
msgstr "gültig seit"
msgid "timetable"
msgstr "Zeitplan"
......@@ -4570,9 +4534,21 @@ msgstr "Sie sollten diese Eigenschaft wahrscheinlich löschen."
#~ msgid "Browse by category"
#~ msgstr "nach Kategorien navigieren"
#~ msgid "CWCache"
#~ msgstr "Cache"
#~ msgid "CWCache_plural"
#~ msgstr "Caches"
#~ msgid "New CWCache"
#~ msgstr "Neuer Anwendungs-Cache"
#~ msgid "No account? Try public access at %s"
#~ msgstr "Kein Konto? Zur öffentlichen Website: %s"
#~ msgid "This CWCache:"
#~ msgstr "Dieser Anwendungs-Cache:"
#~ msgid "anonymous"
#~ msgstr "anonym"
......@@ -4596,6 +4572,13 @@ msgstr "Sie sollten diese Eigenschaft wahrscheinlich löschen."
#~ msgid "generic plot"
#~ msgstr "generischer Plot"
#~ msgctxt "CWCache"
#~ msgid "name"
#~ msgstr "Name"
#~ msgid "name of the cache"
#~ msgstr "Name des Caches"
#~ msgid "no edited fields specified for entity %s"
#~ msgstr "kein Eingabefeld spezifiziert Für Entität %s"
......@@ -4612,3 +4595,10 @@ msgstr "Sie sollten diese Eigenschaft wahrscheinlich löschen."
#~ msgid "timeline"
#~ msgstr "Zeitleiste"
#~ msgid "timestamp"
#~ msgstr "Datum"
#~ msgctxt "CWCache"
#~ msgid "timestamp"
#~ msgstr "gültig seit"
......@@ -248,12 +248,6 @@ msgstr "Attribute"
msgid "CWAttribute_plural"
msgstr "Attributes"
msgid "CWCache"
msgstr "CubicWeb Cache"
msgid "CWCache_plural"
msgstr "CubicWeb Caches"
msgid "CWComputedRType"
msgstr "Virtual relation"
......@@ -524,9 +518,6 @@ msgstr "New bookmark"
msgid "New CWAttribute"
msgstr "New attribute"
msgid "New CWCache"
msgstr "New cache"
msgid "New CWComputedRType"
msgstr "New virtual relation"
......@@ -744,9 +735,6 @@ msgstr "This bookmark:"
msgid "This CWAttribute:"
msgstr "This attribute:"
msgid "This CWCache:"
msgstr "This cache:"
msgid "This CWComputedRType:"
msgstr "This virtual relation:"
......@@ -937,13 +925,6 @@ msgstr ""
msgid "a number (in seconds) or 20s, 10min, 24h or 4d are expected"
msgstr ""
msgid ""
"a simple cache entity characterized by a name and a validity date. The "
"target application is responsible for updating timestamp when necessary to "
"invalidate the cache (typically in hooks). Also, checkout the AppObject."
"get_cache() method."
msgstr ""
msgid "abstract base class for transitions"
msgstr ""
......@@ -1070,9 +1051,6 @@ msgstr ""
msgid "add a CWAttribute"
msgstr ""
msgid "add a CWCache"
msgstr ""
msgid "add a CWComputedRType"
msgstr ""
......@@ -3120,10 +3098,6 @@ msgctxt "BaseTransition"
msgid "name"
msgstr "name"
msgctxt "CWCache"
msgid "name"
msgstr "name"
msgctxt "CWComputedRType"
msgid "name"
msgstr "name"
......@@ -3168,9 +3142,6 @@ msgctxt "WorkflowTransition"
msgid "name"
msgstr "name"
msgid "name of the cache"
msgstr ""
msgid ""
"name of the main variables which should be used in the selection if "
"necessary (comma separated)"
......@@ -3968,13 +3939,6 @@ msgstr ""
msgid "thursday"
msgstr ""
msgid "timestamp"
msgstr ""
msgctxt "CWCache"
msgid "timestamp"
msgstr "timestamp"
msgid "timetable"
msgstr ""
......@@ -4454,3 +4418,23 @@ msgstr ""
msgid "you should probably delete that property"
msgstr ""
#~ msgid "CWCache"
#~ msgstr "CubicWeb Cache"
#~ msgid "CWCache_plural"
#~ msgstr "CubicWeb Caches"
#~ msgid "New CWCache"
#~ msgstr "New cache"
#~ msgid "This CWCache:"
#~ msgstr "This cache:"
#~ msgctxt "CWCache"
#~ msgid "name"
#~ msgstr "name"
#~ msgctxt "CWCache"
#~ msgid "timestamp"
#~ msgstr "timestamp"
......@@ -262,12 +262,6 @@ msgstr "Atributo"
msgid "CWAttribute_plural"
msgstr "Atributos"
msgid "CWCache"
msgstr "Cache"
msgid "CWCache_plural"
msgstr "Caches"
msgid "CWComputedRType"
msgstr ""
......@@ -550,9 +544,6 @@ msgstr "Agregar a Favoritos"
msgid "New CWAttribute"
msgstr "Nueva definición de relación final"
msgid "New CWCache"
msgstr "Agregar Caché"
msgid "New CWComputedRType"
msgstr ""
......@@ -772,9 +763,6 @@ msgstr "Este favorito:"
msgid "This CWAttribute:"
msgstr "Esta definición de relación final:"
msgid "This CWCache:"
msgstr "Este Caché:"
msgid "This CWComputedRType:"
msgstr ""
......@@ -983,18 +971,6 @@ msgstr "un número flotante es requerido"
msgid "a number (in seconds) or 20s, 10min, 24h or 4d are expected"
msgstr "se espera un número (en segundos) ó 20s, 10min, 24h ó 4d "
msgid ""
"a simple cache entity characterized by a name and a validity date. The "
"target application is responsible for updating timestamp when necessary to "
"invalidate the cache (typically in hooks). Also, checkout the AppObject."
"get_cache() method."
msgstr ""
"un caché simple caracterizado por un nombre y una fecha de validez. Es\n"
"el código de la instancia quién es responsable de actualizar la fecha de\n"
"validez mientras el caché debe ser invalidado (en general en un hook).\n"
"Para recuperar un caché, hace falta utilizar el método\n"
"get_cache(cachename)."
msgid "abstract base class for transitions"
msgstr "Clase de base abstracta para la transiciones"
......@@ -1121,9 +1097,6 @@ msgstr ""
msgid "add a CWAttribute"
msgstr ""
msgid "add a CWCache"
msgstr ""
msgid "add a CWComputedRType"
msgstr ""
......@@ -3245,10 +3218,6 @@ msgctxt "BaseTransition"
msgid "name"
msgstr "Nombre"
msgctxt "CWCache"
msgid "name"
msgstr "Nombre"
msgctxt "CWComputedRType"
msgid "name"
msgstr ""
......@@ -3293,9 +3262,6 @@ msgctxt "WorkflowTransition"
msgid "name"
msgstr "Nombre"
msgid "name of the cache"
msgstr "Nombre del Caché"
msgid ""
"name of the main variables which should be used in the selection if "
"necessary (comma separated)"
......@@ -4115,13 +4081,6 @@ msgstr "Este recurso no existe"
msgid "thursday"
msgstr "Jueves"
msgid "timestamp"
msgstr "Fecha"
msgctxt "CWCache"
msgid "timestamp"
msgstr "Válido desde"
msgid "timetable"
msgstr "Tablero de tiempos"
......@@ -4648,6 +4607,12 @@ msgstr "probablamente debería suprimir esta propriedad"
#~ msgid "Browse by category"
#~ msgstr "Busca por categoría"
#~ msgid "CWCache"
#~ msgstr "Cache"
#~ msgid "CWCache_plural"
#~ msgstr "Caches"
#~ msgid "CWSourceSchemaConfig"
#~ msgstr "Configuraciones de Esquema de Fuente"
......@@ -4660,18 +4625,36 @@ msgstr "probablamente debería suprimir esta propriedad"
#~ msgid "Entity and relation supported by this source"
#~ msgstr "Entidades y relaciones aceptadas por esta fuente"
#~ msgid "New CWCache"
#~ msgstr "Agregar Caché"
#~ msgid "New CWSourceSchemaConfig"
#~ msgstr "Nueva parte de mapeo de fuente"
#~ msgid "No account? Try public access at %s"
#~ msgstr "No esta registrado? Use el acceso público en %s"
#~ msgid "This CWCache:"
#~ msgstr "Este Caché:"
#~ msgid "This CWSourceSchemaConfig:"
#~ msgstr "Esta parte de mapeo de fuente:"
#~ msgid "You can't change this relation"
#~ msgstr "Usted no puede modificar esta relación"
#~ msgid ""
#~ "a simple cache entity characterized by a name and a validity date. The "
#~ "target application is responsible for updating timestamp when necessary "
#~ "to invalidate the cache (typically in hooks). Also, checkout the "
#~ "AppObject.get_cache() method."
#~ msgstr ""
#~ "un caché simple caracterizado por un nombre y una fecha de validez. Es\n"
#~ "el código de la instancia quién es responsable de actualizar la fecha de\n"
#~ "validez mientras el caché debe ser invalidado (en general en un hook).\n"
#~ "Para recuperar un caché, hace falta utilizar el método\n"
#~ "get_cache(cachename)."
#~ msgid "allowed options depends on the source type"
#~ msgstr "las opciones permitidas dependen del tipo de fuente"
......@@ -4765,6 +4748,13 @@ msgstr "probablamente debería suprimir esta propriedad"
#~ "la relación %(rtype)s del tipo de entidad %(etype)s debe ser aceptada "
#~ "('inlined')"
#~ msgctxt "CWCache"
#~ msgid "name"
#~ msgstr "Nombre"
#~ msgid "name of the cache"
#~ msgstr "Nombre del Caché"
#~ msgid "no edited fields specified for entity %s"
#~ msgstr "Ningún campo editable especificado para la entidad %s"
......@@ -4816,6 +4806,13 @@ msgstr "probablamente debería suprimir esta propriedad"
#~ msgid "timeline"
#~ msgstr "Escala de Tiempo"
#~ msgid "timestamp"
#~ msgstr "Fecha"
#~ msgctxt "CWCache"
#~ msgid "timestamp"
#~ msgstr "Válido desde"
#~ msgid "unknown option(s): %s"
#~ msgstr "opcion(es) desconocida(s): %s"
......
......@@ -258,12 +258,6 @@ msgstr "Attribut"
msgid "CWAttribute_plural"
msgstr "Attributs"
msgid "CWCache"
msgstr "Cache applicatif"
msgid "CWCache_plural"
msgstr "Caches applicatifs"
msgid "CWComputedRType"
msgstr "Relation virtuelle"
......@@ -548,9 +542,6 @@ msgstr "Nouveau signet"
msgid "New CWAttribute"
msgstr "Nouvelle définition de relation finale"
msgid "New CWCache"
msgstr "Nouveau cache applicatif"
msgid "New CWComputedRType"
msgstr "Nouvelle relation virtuelle"
......@@ -774,9 +765,6 @@ msgstr "Ce signet :"
msgid "This CWAttribute:"
msgstr "Cette définition de relation finale :"
msgid "This CWCache:"
msgstr "Ce cache applicatif :"
msgid "This CWComputedRType:"
msgstr "Cette relation virtuelle :"
......@@ -985,18 +973,6 @@ msgstr "un nombre flottant est attendu"
msgid "a number (in seconds) or 20s, 10min, 24h or 4d are expected"
msgstr "un nombre (en seconde) ou 20s, 10min, 24h ou 4d sont attendus"
msgid ""
"a simple cache entity characterized by a name and a validity date. The "
"target application is responsible for updating timestamp when necessary to "
"invalidate the cache (typically in hooks). Also, checkout the AppObject."
"get_cache() method."
msgstr ""
"un cache simple caractérisé par un nom et une date de validité. C'est\n"
"le code de l'instance qui est responsable de mettre à jour la date de\n"
"validité lorsque le cache doit être invalidé (en général dans un hook).\n"
"Pour récupérer un cache, il faut utiliser utiliser la méthode\n"
"get_cache(cachename)."
msgid "abstract base class for transitions"
msgstr "classe de base abstraite pour les transitions"
......@@ -1123,9 +1099,6 @@ msgstr ""
msgid "add a CWAttribute"
msgstr ""
msgid "add a CWCache"
msgstr ""
msgid "add a CWComputedRType"
msgstr ""
......@@ -3248,10 +3221,6 @@ msgctxt "BaseTransition"
msgid "name"
msgstr "nom"
msgctxt "CWCache"
msgid "name"
msgstr "nom"
msgctxt "CWComputedRType"
msgid "name"
msgstr "nom"
......@@ -3296,9 +3265,6 @@ msgctxt "WorkflowTransition"
msgid "name"
msgstr "nom"
msgid "name of the cache"
msgstr "nom du cache applicatif"
msgid ""
"name of the main variables which should be used in the selection if "
"necessary (comma separated)"
......@@ -4121,13 +4087,6 @@ msgstr "cette ressource est introuvable"
msgid "thursday"
msgstr "jeudi"
msgid "timestamp"
msgstr "date"
msgctxt "CWCache"
msgid "timestamp"
msgstr "valide depuis"
msgid "timetable"
msgstr "emploi du temps"
......@@ -4627,9 +4586,40 @@ msgstr "vous avez été déconnecté"
msgid "you should probably delete that property"
msgstr "vous devriez probablement supprimer cette propriété"
#~ msgid "CWCache"
#~ msgstr "Cache applicatif"
#~ msgid "CWCache_plural"
#~ msgstr "Caches applicatifs"
#~ msgid "New CWCache"
#~ msgstr "Nouveau cache applicatif"
#~ msgid "This CWCache:"
#~ msgstr "Ce cache applicatif :"
#~ msgid ""
#~ "a simple cache entity characterized by a name and a validity date. The "
#~ "target application is responsible for updating timestamp when necessary "
#~ "to invalidate the cache (typically in hooks). Also, checkout the "
#~ "AppObject.get_cache() method."
#~ msgstr ""
#~ "un cache simple caractérisé par un nom et une date de validité. C'est\n"
#~ "le code de l'instance qui est responsable de mettre à jour la date de\n"
#~ "validité lorsque le cache doit être invalidé (en général dans un hook).\n"
#~ "Pour récupérer un cache, il faut utiliser utiliser la méthode\n"
#~ "get_cache(cachename)."
#~ msgid "generic plot"
#~ msgstr "tracé de courbes standard"
#~ msgctxt "CWCache"
#~ msgid "name"
#~ msgstr "nom"
#~ msgid "name of the cache"
#~ msgstr "nom du cache applicatif"
#~ msgid "no repository sessions found"
#~ msgstr "aucune session trouvée"
......@@ -4639,3 +4629,10 @@ msgstr "vous devriez probablement supprimer cette propriété"
#~ msgid "the system source has its configuration stored on the file-system"
#~ msgstr ""
#~ "la source système a sa configuration stockée sur le système de fichier"
#~ msgid "timestamp"
#~ msgstr "date"
#~ msgctxt "CWCache"
#~ msgid "timestamp"
#~ msgstr "valide depuis"
change_attribute_type('CWCache', 'timestamp', 'TZDatetime')
change_attribute_type('CWUser', 'last_login_time', 'TZDatetime')
change_attribute_type('CWSource', 'latest_retrieval', 'TZDatetime')
drop_attribute('CWSource', 'synchronizing')
......
option_removed('host')
option_removed('uid')
option_removed('webserver-threadpool-size')
drop_entity_type('CWCache')
......@@ -95,7 +95,7 @@ WORKFLOW_TYPES = set(('Transition', 'State', 'TrInfo', 'Workflow',
'WorkflowTransition', 'BaseTransition',
'SubWorkflowExitPoint'))
INTERNAL_TYPES = set(('CWProperty', 'CWCache', 'ExternalUri', 'CWDataImport',
INTERNAL_TYPES = set(('CWProperty', 'ExternalUri', 'CWDataImport',
'CWSource', 'CWSourceHostConfig', 'CWSession'))
UNIQUE_CONSTRAINTS = ('SizeConstraint', 'FormatConstraint',
......
......@@ -209,29 +209,6 @@ class same_as(RelationType):
object = 'ExternalUri'
class CWCache(EntityType):
"""a simple cache entity characterized by a name and
a validity date.
The target application is responsible for updating timestamp
when necessary to invalidate the cache (typically in hooks).
Also, checkout the AppObject.get_cache() method.
"""
# XXX only handle by hooks, shouldn't be readable/editable at all through
# the ui and so no permissions should be granted, no?
__permissions__ = {
'read': ('managers', 'users', 'guests'),
'add': ('managers',),
'update': ('managers', 'users',), # XXX
'delete': ('managers',),
}
name = String(required=True, unique=True, maxsize=128,
description=_('name of the cache'))
timestamp = TZDatetime(default='NOW')
class CWSource(EntityType):
__permissions__ = {
'read': ('managers', 'users', 'guests'),
......
......@@ -38,7 +38,6 @@ from cubicweb.server.edition import EditedEntity
NO_UNDO_TYPES = schema.SCHEMA_TYPES.copy()
NO_UNDO_TYPES.add('CWCache')
NO_UNDO_TYPES.add('CWSession')
NO_UNDO_TYPES.add('CWDataImport')
# is / is_instance_of are usually added by sql hooks except when using
......
......@@ -176,7 +176,7 @@ class UtilsTC(BaseQuerierTC):
'ET': 'CWEType', 'ETN': 'String'}])
rql, solutions = partrqls[1]
self.assertRQLEqual(rql, 'Any ETN,X WHERE X is ET, ET name ETN, ET is CWEType, '
'X is IN(BaseTransition, Bookmark, CWAttribute, CWCache, CWComputedRType, '
'X is IN(BaseTransition, Bookmark, CWAttribute, CWComputedRType, '
' CWConstraint, CWConstraintType, CWEType, CWGroup, CWPermission, CWProperty, '
' CWRType, CWRelation, CWSource, CWUniqueTogetherConstraint, CWUser, Card, '
' Comment, Division, Email, EmailPart, EmailThread, ExternalUri, File, Folder, '
......@@ -188,7 +188,6 @@ class UtilsTC(BaseQuerierTC):
{'X': 'Card', 'ETN': 'String', 'ET': 'CWEType'},
{'X': 'Comment', 'ETN': 'String', 'ET': 'CWEType'},
{'X': 'Division', 'ETN': 'String', 'ET': 'CWEType'},