Package amplee :: Package handler :: Class MemberHandler
[show private | hide private]
[frames | no frames]

Type MemberHandler

object --+
         |
        MemberHandler


Main member hander that HTTP method handler can call to perform CRUD operations on the member and resource.
Method Summary
  create_from_stream(cls, collection, member_type, fileobj, length, slug)
Create a new a collection and attach it. (Class method)
  delete(cls, collection, member)
Delete the media resource and its meta data from the collection. (Class method)
  get_atom(cls, collection, member)
Get the content of an atom entry which identifier is 'rid' (Class method)
  get_content(cls, collection, member)
Get the content of a resource which identifier is 'rid' (Class method)
  update_content_from_stream(cls, collection, member_type, member, fileobj, length)
Update a resource identified by 'rid' Returns the updated member. (Class method)
    Inherited from object
  __init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __repr__(x)
x.__repr__() <==> repr(x)
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)

Class Method Details

create_from_stream(cls, collection, member_type, fileobj, length, slug=None)

Create a new a collection and attach it. Returns the new member.

If member_type.on_create is set to a callable and that callable raises an error or an exception, the member will not be attached to the collection and not returned by the class method.

Keyword arguments collection -- collection which will host the member member_type -- a MemberType instance for the mime type of the resource fileobj -- a file object containg the content. It only needs a read(length) method length -- how much content to read from the file object slug -- SLUG header value sent end decoded

delete(cls, collection, member)

Delete the media resource and its meta data from the collection.

Keyword arguments collection -- collection which will host the member member -- member instance

get_atom(cls, collection, member)

Get the content of an atom entry which identifier is 'rid'

Raise a amplee.error.UnknownResource error if it could not be found.

Keyword arguments collection -- collection which will host the member member -- member instance

get_content(cls, collection, member)

Get the content of a resource which identifier is 'rid'

Raise a amplee.error.UnknownResource error if it could not be found.

Keyword arguments collection -- collection which will host the member member -- member instance

update_content_from_stream(cls, collection, member_type, member, fileobj, length)

Update a resource identified by 'rid' Returns the updated member.

If member_type.on_update is set to a callable and that callable raises an error or an exception, the member will not be attached to the collection and not returned by the class method.

Keyword arguments collection -- collection which will host the member member_type -- a MemberType instance for the mime type of the resource member -- member instance fileobj -- a file object containg the content. It only needs a read(length) method length -- how much content to read from the file object

Generated by Epydoc 2.1 on Thu Jul 19 15:32:16 2007 http://epydoc.sf.net