Jsonify is specific to each backend object - it allows me to control how an
object represe te itself in json.  Traversal of sqlalchemy objects in a
generic fashion is exceptionally difficult (cos SA itself overloads
introspection itself, I have found no sensible ways on the googles or docs)

Anyway, keeping t simple, jsonify returns json of an object in its
hierarchy.

Todict is part of that call - and does the obvious thing.  But iirr I use a
dict later on in the call so converting to json at that point would be
premature

Paul Brian
07540 456 115
paul@mikadosoftware.com
Guiding you towards Continuous Delivery of software and business value.

On 18 Mar 2013, at 18:38, Philip Schatz <notifications@github.com> wrote:

In rhaptos2/repo/cnxbase.py:

> +        self.from_dict(d)
> +
> +    def from_dict(self, userprofile_dict):
> +        """
> +        SHould test for schema validity etc.
> +
> +        """
> +        idnames = ['id_', ]
> +        d = userprofile_dict
> +        for k in d:
> +            if k in idnames and d[k] is None:
> +                continue  # do not assign a id of None to the internal id
> +            else:
> +                setattr(self, k, d[k])
> +
> +    def to_dict(self):

is this used outside of jsonify? (I'd recommend calling it toJSON() to line
up with JavaScript's .toJSON()

—
Reply to this email directly or view it on
GitHub<https://github.com/Connexions/rhaptos2.repo/pull/91/files#r3417965>
.

-- 


www.mikadosoftware.com

See your software improve with every change.