Merge branch 'master' into bbmaster

This commit is contained in:
Helmut Merz 2012-03-01 17:30:28 +01:00
commit 25525133a2
3 changed files with 13 additions and 9 deletions

View file

@ -52,9 +52,10 @@ a[href]:hover {
} }
pre { pre {
padding: 0.2em;
font-size: 100%; font-size: 100%;
background-color: #f4f4f4; background-color: #f8f8f8;
overflow: scroll; overflow: auto;
max-height: 35em; max-height: 35em;
} }

View file

@ -137,9 +137,13 @@ class AdapterBase(object):
def __eq__(self, other): def __eq__(self, other):
if not isinstance(other, AdapterBase): if not isinstance(other, AdapterBase):
return self.context == other return self.context == other
#return False
return self.context == other.context return self.context == other.context
def __ne__(self, other):
if not isinstance(other, AdapterBase):
return self.context != other
return self.context != other.context
def getLoopsRoot(self): def getLoopsRoot(self):
return self.context.getLoopsRoot() return self.context.getLoopsRoot()
@ -443,8 +447,9 @@ class RelationSetProperty(object):
noSecurityCheck=self.noSecurityCheck) noSecurityCheck=self.noSecurityCheck)
def __set__(self, inst, value): def __set__(self, inst, value):
value = [baseObject(c) for c in value]
rs = self.factory(inst, self.predicateName) rs = self.factory(inst, self.predicateName)
current = list(rs) current = [baseObject(c) for c in rs]
for c in current: for c in current:
if c not in value: if c not in value:
rs.remove(c) rs.remove(c)

View file

@ -1,5 +1,5 @@
# #
# Copyright (c) 2007 Helmut Merz helmutm@cy55.de # Copyright (c) 2012 Helmut Merz helmutm@cy55.de
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@ -18,8 +18,6 @@
""" """
XML-RPC views. XML-RPC views.
$Id$
""" """
from zope.app.container.interfaces import INameChooser from zope.app.container.interfaces import INameChooser
@ -34,7 +32,7 @@ from zope.security.proxy import removeSecurityProxy
from zope.cachedescriptors.property import Lazy from zope.cachedescriptors.property import Lazy
from cybertools.typology.interfaces import IType from cybertools.typology.interfaces import IType
from loops.common import adapted from loops.common import adapted, AdapterBase
from loops.concept import Concept from loops.concept import Concept
from loops.i18n.browser import I18NView from loops.i18n.browser import I18NView
from loops.util import getUidForObject, getObjectForUid, toUnicode from loops.util import getUidForObject, getObjectForUid, toUnicode
@ -166,7 +164,7 @@ def objectAsDict(obj, langInfo=None):
'title': adapter.title, 'description': adapter.description, 'title': adapter.title, 'description': adapter.description,
'type': getUidForObject(objType.typeProvider)} 'type': getUidForObject(objType.typeProvider)}
ti = objType.typeInterface ti = objType.typeInterface
if ti is not None and adapter != obj: if ti is not None and isinstance(adapter, AdapterBase): #adapter != obj:
#for attr in (list(adapter._adapterAttributes) + list(ti)): #for attr in (list(adapter._adapterAttributes) + list(ti)):
for attr in list(ti): for attr in list(ti):
if attr not in ('__parent__', 'context', 'id', 'name', if attr not in ('__parent__', 'context', 'id', 'name',