Re: [web2py] Re: Changelog for 2.6.3?
Thanks a lot for the info and fast updates guys. When I figure out what happened with my virtual field I will let you know. On Wed, Sep 18, 2013 at 8:02 PM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Yes. I will update the changelog. in 2.6.2 we added applications/admin/settings.cfg which is required for the new admin editor to work. in 2.6.3 we added additional checks to fix a possible security issue. We do not know for sure we were vulnerable to the security issue but we added those checks anyway. Massimo On Wednesday, 18 September 2013 12:37:50 UTC-5, Dave S wrote: On Wednesday, September 18, 2013 3:52:38 AM UTC-7, Niphlod wrote: http://web2py.com/init/**default/changeloghttp://web2py.com/init/default/changelog Mike might be wondering what changed between 2.6.1 and 2.6.3, which isn't yet visible at that URL. If I heard right, both .2 and .3 were small changes not related to sqlform; one of them was related to the django security issue, wasn't it? /dps -- 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 a topic in the Google Groups web2py-users group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/svkcM5k6s88/unsubscribe. To unsubscribe from this group and all its topics, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- 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/groups/opt_out.
Re: [web2py] Re: SQLFORM.Smartgrid and with parent table in Linked Tables
Yeah, been a long day it should be: db.define_table( 'contact', Field http://www.web2py.com/examples/global/vars/Field('name'), Field http://www.web2py.com/examples/global/vars/Field('address'), format = '%(name)s') db.define_table( 'courses' , Field http://www.web2py.com/examples/global/vars/Field('student_id',db.contact), Field http://www.web2py.com/examples/global/vars/Field('course_name'), Field http://www.web2py.com/examples/global/vars/Field('pass_mark', 'text'), format = '%(name)s') The reference in the table courses should be db.contact. On Mon, Apr 29, 2013 at 4:39 PM, Anthony abasta...@gmail.com wrote: Isn't that the same model? On Monday, April 29, 2013 11:31:17 AM UTC-4, Michael Hall wrote: My bad, the model in my example should be: db.define_table( 'contact', Field http://www.web2py.com/examples/global/vars/Field('name'), Field http://www.web2py.com/examples/global/vars/Field('address'), format = '%(name)s') db.define_table( 'courses', Field http://www.web2py.com/examples/global/vars/Field('student_id',db.person), Field http://www.web2py.com/examples/global/vars/Field('course_name'), Field http://www.web2py.com/examples/global/vars/Field('pass_mark', 'text'), format = '%(name)s') On Monday, 29 April 2013 13:32:10 UTC+1, Michael Hall wrote: I would like to have a smartgrid that references its parent table in linked_tables, what is the web2py way of doing this? I have found some help in this thread: https://groups.google.com/**forum/?fromgroups=#!topic/** web2py/vDGJdct550Qhttps://groups.google.com/forum/?fromgroups=#!topic/web2py/vDGJdct550Qbut the solution is a bit sketchy due to it modifying sqlhtml.py. Lets take this model: db.define_table( 'contact', Field http://www.web2py.com/examples/global/vars/Field('name'), Field http://www.web2py.com/examples/global/vars/Field('address'), format = '%(name)s') db.define_table( 'courses', Field http://www.web2py.com/examples/global/vars/Field('student_id',db.person), Field http://www.web2py.com/examples/global/vars/Field('course_name'), Field http://www.web2py.com/examples/global/vars/Field('pass_mark', 'text'), format = '%(name)s') I want a smartgrid for courses that shows all the courses records and has the contact table in linked tables. That way I have an easy way to view all course data and easily check out the contact data of the person doing the course. This smartgrid is used by people who mark courses and require quick access to the data in the courses table without having to go via the contact table. In a perfect world I would create this smartgrid like so: def courseview(): form = SQLFORM.smartgrid(db.courses,**linked_tables=['contact']) return locals() However this does not work because the contact table is the parent. What is the best way of achieving my required result? -- --- You received this message because you are subscribed to a topic in the Google Groups web2py-users group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/yWXaGpbH28M/unsubscribe?hl=en. To unsubscribe from this group and all its topics, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- --- 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/groups/opt_out.
Re: [web2py] Re: Extracting row id from url using request.args
Wow Cliff thank you for this superb bit of info. Like all the best problems it seems glaringly obvious to me now. Thank you everyone for your help. Mike On Wed, Nov 21, 2012 at 2:40 AM, Cliff Kachinske cjk...@gmail.com wrote: It's been a while since I've played with smartgrid, but I seem to recall that the ID of the record being edited was always the final arg. And you can treat request.args as a list, so the ID of the record being edited is request.args[-1], or so it seems to me. On Tuesday, November 20, 2012 7:44:09 AM UTC-5, Michael Hall wrote: In the end I have used a different slightly more messy approach. I am getting the record id from the args by using a conditional to test if it is in one of 2 possible positions. @auth.requires_login() def contact_manage(): form = SQLFORM.smartgrid(db.t_**contact,linked_tables=['t_** courses','t_membership','t_**paypal'], onupdate=auth.archive, formname=Contact Manager) if request.args(2) == 't_contact': memberId = request.args(3) else: memberId = request.args(2) return locals() I looked into fetching it using similar code to your link function but it seems you can only request the id of the current record using db.t_contact.id from within the parameters of your SQLFORM.smartgrid request. Its a dirty hack but it seems to work. Mike On Tuesday, 20 November 2012 07:15:22 UTC, Johann Spies wrote: On 19 November 2012 14:58, Michael Hall pix...@gmail.com wrote: Hi Villas I like the idea of using a var instead of args but I am still uncertain of how I get the ID of the current record I am viewing/editing in smartgrid. Here is an example of code I am using where 'auid' represents the id of the author record: links = [lambda row: (A(B(T('Edit')), _target = _blank, _href = URL(r = request, ** c = 'authors', ** f = 'edit_author', ** vars = dict(auid = str(row[ db.akb_authors.id]**)] query = ... fields = [list of fields] I then call the grid with SQLFORM.grid(query, fields=fields, links=links) Regards Johann -- Because experiencing your loyal love is better than life itself, my lips will praise you. (Psalm 63:3) -- --