[web2py] links to specific records in table

2014-05-05 Thread Kajetan Wardziński
Hello, my first app and I'm stuck.
I generate table with SQLTABLE in Views like this:
{{=SQLTABLE(query, headers='fieldname:capitalize', linkto='table_manage')}}
and links in generated table doesn't link directly to the specific record 
in the database, I have also "not authorized" message
It should be Digitally signed urls, but I don't kno how to use it
thanks

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: links to specific records in table

2014-05-07 Thread Kajetan Wardziński
thanks, 
works in the same way, I have table with links and when I click on it I 
have message "not authorized" and nothing happen.
I try to select some rows from table and display them in Views, with links 
to edit or view single record from table

SQLFORM is a good idea but there is another problem:
i have following query in model:
query = db((db.t_database.f_field == 'No') & (db.t_database.f_anotherField 
== 'Yes')).select()
and in Controllers:
def function():
table = SQLFORM.smartgrid(db.t_database, constraints = dict(t_database 
=query
))
return locals()
and View:
{{extend 'layout.html'}}

{{=table}}

and there is following error:
Query Not Supported: (1064, "You have an error in your SQL syntax; check 
the manual that corresponds to your MySQL server version for the right 
syntax to use near '9, at line 2")
when I run the same query with SQLTABLE it works fine







W dniu wtorek, 6 maja 2014 15:59:44 UTC+2 użytkownik Kyle Flanagan napisał:
>
> It's normally a good idea to construct your SQLTABLE in your controller 
> and then pass it to your view,
>
> e.g.:
>
> default.py
> def index():
>query = db().select()
>table = SQLTABLE(query,headers='fieldname:capitalize', linkto=
> 'table_manage')
>
> default/index.html
> {{extend 'layout.html'}}
>
> {{=table}}
>
> That being said, linkto is expecting a function to generate a URL. Is 
> table_manage a function?
>
> Also, I'm not exactly sure what you're trying to accomplish, but 
> SQLFORM.grid or SQLFORM.smartgrid may already do what you're looking for. 
> http://web2py.com/books/default/chapter/29/07/forms-and-validators?search=smartgrid#SQLFORM-grid-and-SQLFORM-smartgrid
>
>
>
> On Monday, May 5, 2014 6:15:00 PM UTC-5, Kajetan Wardziński wrote:
>>
>> Hello, my first app and I'm stuck.
>> I generate table with SQLTABLE in Views like this:
>> {{=SQLTABLE(query, headers='fieldname:capitalize', linkto='table_manage'
>> )}}
>> and links in generated table doesn't link directly to the specific record 
>> in the database, I have also "not authorized" message
>> It should be Digitally signed urls, but I don't kno how to use it
>> thanks
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.