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>