Uhm, I don't know if it is a wrong indentation issue but it looks to me
that you are simply assigning a "value" class property to user class.
What you have to do is add a _do_get_provider_count_and_objs method to the
table_filler_type class you just declared.
That method is in charge of returning the data you want to show.
The default implementation looks like:
class TableFiller(FillerBase):
def _do_get_provider_count_and_objs(self, **kw): limit =
kw.pop('limit', None) offset = kw.pop('offset', None)
order_by = kw.pop('order_by', None) desc = kw.pop('desc',
False) substring_filters = kw.pop('substring_filters', [])
count, objs = self.__provider__.query(self.__entity__, limit,
offset, self.__limit_fields__,
order_by, desc, substring_filters=substring_filters,
filters=kw) self.__count__ =
count return count, objs
On Mon, Nov 4, 2013 at 7:43 PM, Stuart Zurcher <[email protected]>wrote:
> Alesandro, thanks your for your quick reply. You are correct. I need a
> subset of the collection.
> I have the following and would like all users displayed who have
> groupname in groups from User in auth.py:
>
> class user(CrudRestControllerConfig):
> class table_type(TableBase):
> __entity__ = User
> __limit_fields__ = ['display_name', 'email_address']
> __url__ = '../user.json' #this just tidies up the URL a bit
>
> class table_filler_type(TableFiller):
> __entity__ = User
> __limit_fields__ = ['_id', 'display_name', 'email_address']
> value = table_filler_type.get_value(table_filler_type(DBSession),
> values={}, limit=20, offset=0, display_name='*SZURCHER')
>
> I'm still trying to find out how to use it semantically. The get_value
> runs thru _do_get_provider_count_and_objs and the entity is queried in
> sprox.mg.provider.py line 305 with the filter display_name. The count
> for the query is 1. However, the values are being filled from somewhere
> else as the all the users still get displayed.
>
>
>
--
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/turbogears.
For more options, visit https://groups.google.com/groups/opt_out.