Code to turn yaml document into query string
cache_decorator: fixed @memoized decorator to use a global cache

Even though @memoized is supposed to cache the constructed class variables
when used applied to V1Meta.asset_class(), it doesn't, because
the data variable only contains a single instance, thus the cache
only lasts until the next differing asset type is instantiated. This
caused a lot of extra round-trips between the client and server in
complex processing.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
.gitignore: added further patterns to ignore

Some files are generated during installation, ignore those.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
v1meta: handle relations in returned data properly

When relations and attributes related to relations are returned by a
REST query, they should be used to construct the associated instances, so
that no extra round trips are necessary when these relations are then
used by the querying code.

For instance, this code:

for actual in  v1meta.Actual.select('Workitem.Parent.Name'):
	actual.Workitem.Parent.Name

caused an extra round trip at the time of the reference, since
actual.Workitem.Parent is a relation that wasn't properly parsed into
the "actual" asset.

With these changes, this is now done, so the loop above got a whole lot
faster.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
V1Query.select: add containing relations automatically to the select set

In case a select contains an attribute of a relation, automatically include
a reference to the container in the select set.

For example this patch makes this work:

for actual in v1.Actual.select("Workitem.Parent.Name"):
	print actual.Workitem.Parent.Name

Without this patch, Workitem, Workitem.Parent would have to be added to
the argument list manually.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
Merge pull request #4 from bazsi/master

please pull my patches to greatly speed up v1pysdk
base_asset: fixed AsOf member

The historic date a given object refers to was added to an object using
with_data(), however as it is missing from the meta information returned
by V1, it is not registered as an attribute, thus unavailable through
the object.

The solution is to use a normal instance variable, which can be set to
None when we are not querying the history.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
query: make it possible to query the actual state by passing None to asof()

Earlier if asof() was specified, it was impossible to list an entry to
represent the current state. This patch makes it possible to use
None to represent "NOW".

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
adds HTTPCookieProcessor to URL opener handlers

Provides auth ticket cookie after first successful request per Best
Practice advice in Data API documentation.

[fixes versionone/VersionOne.SDK.Python#6]
Merge pull request #7 from jeremy-w/http-cookies

adds HTTPCookieProcessor to URL opener handlers
Merge remote-tracking branch 'origin/pr/5'
Include AsOf data item in data dict as well as attribute
ntlm: raise HTTPErrors when appropriate. Fixes issue #3

It turns out that the ntlm auth handler provided by python-ntlm
doesn't handle http error codes. To work around this I created a
subclass of HTTPNtlmAuthHandler that calls the 'error' method of
it's parent if a non-200 status code is returned.