[Schevo-devel] Field name in field-spec
Patrick K. O'Brien
pobrien at orbtech.com
Fri Dec 9 08:47:39 EST 2005
Tom Locke wrote:
> Hi
>
> I notice the field-spec does not contain the name of the field.
>
>>>> db.PhoneNumber.field_spec["person"].name
> AttributeError: type object 'Entity' has no attribute 'name'
>
> Would it make sense to add that info? I have a situation where that
> would be useful.
The field_spec is an ordered dictionary of field_name : FieldClass
pairs. So field_spec.keys() would get you a list of field names.
> If the field-spec also referenced the extent to which it belongs, it
> would be a complete , self-contained representation of a field, which
> would be useful thing for apps doing reflection.
You might have to provide a more detailed use-case. We do quite a lot
of reflection in our apps and haven't had a need for what you describe
yet. So either we've already got ways of getting what you want that
aren't immediately obvious, or we have baggage that we are used to
carrying around and things need to be made easier. At this point I'm
not sure which is the case.
--
Patrick K. O'Brien
Orbtech http://www.orbtech.com
Schevo http://www.schevo.org
More information about the Schevo-devel
mailing list