nevermind I fixed it. Not sure why, but if it was named 'equipment' the
controller showed up...any other name it doesnt. I just renamed
On Monday, August 27, 2012 5:05:44 PM UTC-6, SeamusSeamus wrote:
>
> ah, yes, all is well now...however, this is strange.
> Now, when I click the link on the table to take me to the
> 'equipment.html' page (I renamed it from details.html), it shows the
> controller in the URL:
> www.mysite.com/default/equipment/id/title
>
> how do I make it so the 'default' does not show up? It didnt show up
> before it looked like this:
>
> links = [lambda row: A('Details',_href=URL('default', 'details', args=[
> row.id, row.slug]))]
> I changed to
> links = [lambda row: A('Details',_href=URL('default', 'equipment',
> args=[row.id, row.slug]))]
>
> I also changed the controller from def default to def equipment, and also
> changed default.html to equipment.html in views...
>
> now it shows the controller in the URL...
>
> my routes looks like this
>
> routers = dict(
> BASE = dict(default_application='equipment',
> default_controller = 'default',),
> )
>
>
> On Monday, August 27, 2012 4:38:41 PM UTC-6, Limedrop wrote:
>>
>>
>> I don't know if you picked this up, but you don't seem to have row.id as
>> part of the sqlfrom url.
>>
>> Perhaps try:
>> links = [lambda row: A('Details',_href=URL('default','equipment',
>> args=[row.id, row.slug]))]
>>
>>
>> On Tuesday, August 28, 2012 10:28:39 AM UTC+12, SeamusSeamus wrote:
>>>
>>> Okay, but do I leave everything else alone? All I want to do is make it
>>> www.mysite.com/equipment/id/title
>>> currently, title is set up as slug in the DB. What am I doing wrong.
>>>
>>> In my view:
>>>
>>> equipment_id = request.args(0)
>>> equipment_slug = request.args(1)
>>> query = (db.equipment.id == item_id) & (db.equipment.slug ==
>>> item_slug)
>>> item = db(query).select().first()
>>>
>>> try:
>>> equipment = db.equipment[int(request.args(0))]
>>> except:
>>> equipment = db.equipment(request.args(0)) or
>>> db(db.equipment.slug == request.args(0)).select().first()
>>>
>>>
>>> and then my link in sqlform:
>>>
>>> links = [lambda row: A('Details',_href=URL('default','equipment',
>>> args=[row.slug]))]
>>>
>>>
>>>
>>>
--