My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 2: I would like to create a new EntityType
1 person starred this issue and may be notified of changes. Back to list
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

Powered by Google Project Hosting