Home | Trees | Indices | Help |
|
---|
|
object --+ | RESTBase
The baseclass for all our domain-objects/resources.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from |
|
|||
|
|||
|
|||
|
|||
|
|
|||
REGISTRY =
|
|||
ALL_DOMAIN_CLASSES =
|
|||
ALIASES =
|
|||
KIND = None
|
|
|||
Inherited from |
|
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
|
This method is used to set a property, a resource or a list of resources as property of the resource the method is invoked on. For example, to set a comment on a track, do >>> sca = scapi.Scope(connector) >>> track = scapi.Track.new(title='bar', sharing="private") >>> comment = scapi.Comment.create(body="This is the body of my comment", timestamp=10) >>> track.comments = comment To set a list of users as permissions, do >>> sca = scapi.Scope(connector) >>> me = sca.me() >>> track = scapi.Track.new(title='bar', sharing="private") >>> users = sca.users() >>> users_to_set = [user for user in users[:10] if user != me] >>> track.permissions = users_to_set And finally, to simply change the title of a track, do >>> sca = scapi.Scope(connector) >>> track = sca.Track.get(track_id) >>> track.title = "new_title"
|
This is a convenience-method for creating an object that will be passed as parameter - e.g. a comment. A usage would look like this: >>> sca = scapi.Scope(connector) >>> track = sca.Track.new(title='bar', sharing="private") >>> comment = sca.Comment.create(body="This is the body of my comment", timestamp=10) >>> track.comments = comment |
Create a new resource inside a given Scope. The actual values are in data. So for creating new resources, you have two options:
|
Fetch a resource by id. Simply pass a known id as argument. For example >>> sca = scapi.Scope(connector) >>> track = sca.Track.get(id) |
Return the scope this resource lives in, which is the KIND and id
|
This method will take a resource name like "users" and return the single-case, in the example "user". Currently, it's not very sophisticated, only strips a trailing s. |
repr(x)
|
hash(x)
|
Test for equality. Resources are considered equal if the have the same kind and id. |
|
REGISTRY
|
ALL_DOMAIN_CLASSES
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Thu Sep 10 00:58:49 2009 | http://epydoc.sourceforge.net |