I believe your code should be
def index():
group_id=request.args(0)
group=db.auth_group[group_id] # group chouse table
members = db(db.auth_membership.group_id ==group.id).select()
notmembers = db(db.auth_membership.group_id !=group.id).select()
return DIV(members,notmembers)
In the last line you return a DIV (a helper) not a dict. If you return
a dict() instead
return dict(members=members, notmembers=notmembers)
the view will NOT be ignored, as with any other action.
You can do what you want without a view but, as you suggest, I would
use a view.
On Jan 2, 8:41 am, KMax <[email protected]> wrote:
> Hello
> Im working on plugin to manage group membership. Main idea is
> following:
> Some kind of view loading the manager (i guess this way):
> =LOAD('plugin_membershipmanager',args=Group_id,ajax=True)
>
> Plugin gets all members of group with id=Group_id, and gets all users
> are not in group.
> Im easyly show this lists by plugin.
> def index():
> group_id=request.args(0)
> group=db.auth_group[group_id] # group chouse table
> members = db(db.auth_membership.group_id ==
> group.id).auth_membership.select(db.auth_membership.user_id)
> notmembers = db(db.auth_membership.group_id !=
> group.id).auth_membership.select(db.auth_membership.user_id)
> return DIV(members,notmembers).xml()
>
> In some way I need to make each users as url in both of list one with
> 'remove' vars and second with 'add' vars.
> So, clicking on names and logins will add and remove respectively.
> (that the plan at least), I tryed to make this by view, BUT view in
> plugin are ignored.
>
> Now the question:
> How to from members.select() result, return table of urls A(str
> (db.auth_user[member.user_id].first_name)+' '+str(db.auth_user
> [member.user_id].last_name),URL
> (c='plugin_membershipmanager',f='index',args=group_id, vars=
> {'action':'remove'})
>
> Thank you, for advise. Sorry if this is too newbe, but I failed to
> find sample code or manual. Hope this code will be universal to post
> as a slice.
--
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en.