Issue 2: I would like to create a new EntityType
Status:  New
Owner: ----
Reported by remarkability@gmail.com, Oct 19, 2010
Imagine that I'd like to add an EntityType, such as an Image...

What I'd like to do, in code, is to use CalaisDocuments as my base objects, almost as my entire DB layer. I'm happy hacking a src row into the Entity class (after having created an Image EntityType) but I don't know how important are urlhashes?

I'm trying this...

from apps.djangocalais.models import *
data = {'name':'Whatever', '_type':'Image', '_typeReference':'http://image.com'
obj = make_entity(data, 'http://static.guim.co.uk/sys-images/Guardian/Pix/pictures/2010/9/24/1285353439842/Labours-London-mayoral-ca-006.jpg')

... but now i can't use...


document = CalaisDocument.objects.all()[0] #get the first one...
CalaisDocumentManager().add_entities(document, obj)

>>AttributeError: 'Entity' object has no attribute 'get'

Obviously, because add_entities expects a result dict from the API. Is there a way to just simply fake the urlhashes (are they for uniqueness?) and to programmatically add Entities to CalaisDocuments,

thanks

Tom