added XML-RPC method createConcept()

git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@1578 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
helmutm 2007-02-06 22:29:42 +00:00
parent bd1f1a69ce
commit 13087cd9cd
2 changed files with 6 additions and 3 deletions

View file

@ -152,7 +152,7 @@ Updating the concept map
>>> topicId = xrf.getObjectByName('topic')['id']
>>> xrf.createConcept(topicId, u'zope2', u'Zope 2')
'12'
{'title': u'Zope 2', 'type': '7', 'id': '12', 'name': u'zope2'}
Fin de partie

View file

@ -23,6 +23,8 @@ $Id$
"""
from zope.interface import implements
from zope.event import notify
from zope.app.event.objectevent import ObjectCreatedEvent, ObjectModifiedEvent
from zope.app.publisher.xmlrpc import XMLRPCView
from zope.app.publisher.xmlrpc import MethodPublisher
from zope.app.traversing.api import getName
@ -113,8 +115,9 @@ class LoopsMethods(MethodPublisher):
type = getObjectForUid(typeId)
c = self.concepts[name] = Concept(title)
c.conceptType = type
# notify
return getUidForObject(c)
notify(ObjectCreatedEvent(c))
notify(ObjectModifiedEvent(c))
return objectAsDict(c)
def objectAsDict(obj):