Problem with URL helper inside component view

44 views
Skip to first unread message

Pavel

unread,
Jan 7, 2015, 3:25:26 PM1/7/15
to web...@googlegroups.com
Hallo,
I have problem with component. I am newbe too...

I have component view my.load with this content:

<h3>Events:</h3>
{{for row in users_and_events(db.registrations.registered_user==auth.user_id).select():}}
{{=A(row.s_events.title, _href=URL('show', args=row.s_events.id))}}
<br>
{{pass}}

In view where I can use component I have:

{{if session.auth:}}
{{=LOAD('event','my.load',ajax=True)}}
{{pass}}


I want to show URL like this: http://127.0.0.1:8000/events/event/show/16

But results is http://127.0.0.1:8000/events/event/show.load/16

How to achieve right URL?

Thanks

Anthony

unread,
Jan 7, 2015, 3:51:03 PM1/7/15
to web...@googlegroups.com
If you don't specify the extension in URL(), it will default to the extension of the current request, which is .load in this case. So, instead, do this:

URL('show', args=row.s_events.id, extension=False)

Anthony

Pavel

unread,
Jan 7, 2015, 3:55:37 PM1/7/15
to web...@googlegroups.com
Really thanks Anthony. It works now:).
Reply all
Reply to author
Forward
0 new messages