Re: [web2py] Re: Pass/Receive args contains "&" in the value
>So, are you trying to pass a company name through a URL? Seems to me that would be problematic. Yes, that's what I'm trying and I was hoping there is a easy fix. Thank you for your help! I think I will stop here for now. On Wednesday, January 20, 2021 at 3:52:04 PM UTC-6 Jim S wrote: > So, are you trying to pass a company name through a URL? Seems to me that > would be problematic. > > If that is what you're doing maybe you need to look at urllib > unquote_plus. I use that in some cases to build valid URLs where the text > can be unpredictable. > > Is there anything else you could pass other than a name to uniquely > identify the company in your url? > > Or, maybe I'm not following what you're trying to do here. > > -Jim > > > On Wed, Jan 20, 2021 at 3:36 PM Omi Chiba wrote: > >> ok, so this is four parameters I'm passing.. >> >> J2831 >> >> AL04 >> >> 36105 >> >> HYUNDAI MOTOR MANUFACTURI >> >> then list.xxx or XML(list.xxx) actually shows the same result. It >> replaced blank with "_"... that's why I failed to get the data from the >> database because the original value doesn't have "_". I also tried the with >> "&" in the company name and it failed to display the page because of "&" >> >> J2831 >> >> AL04 >> >> 36105 >> >> HYUNDAI_MOTOR_MANUFACTURI >> >> >> >> On Wednesday, January 20, 2021 at 2:35:56 PM UTC-6 Jim S wrote: >> >>> So, if you would do a for look around 'lists' and print out the field >>> values, what would that look like? Also, is there a difference if you also >>> print it out with the XML function wrapped around it? >>> >>> On Wed, Jan 20, 2021 at 2:03 PM Omi Chiba wrote: >>> >>>> here's the controller for enduser_index view. It's like I have this >>>> index view to list and lick "View" button to pass the variable and go to >>>> enduser_view page. >>>> >>>> def enduser_index(): >>>> response.title = 'List' >>>> response.subtitle = 'End User Code' >>>> >>>> form=SQLFORM.factory(Field('search')) >>>> form.custom.widget.search['_class'] = 'input-medium search-query' >>>> form.custom.submit['_value'] = 'Search' >>>> form.custom.submit['_class'] = 'btn' >>>> >>>> if form.accepts(request): >>>> key=form.vars.search.upper() + "%" >>>> query = (db.EDXUSF00.USDIID.like(key)) | >>>> (db.EDXUSF00.USDICD.like(key)) | (db.EDXUSF00.USTSKJ.like(key)) >>>> else: >>>> query = db.EDXUSF00.USDIID!="" >>>> >>>> # Paging plugin >>>> paginate_selector = PaginateSelector(anchor='main') >>>> paginator = Paginator(paginate=paginate_selector.paginate, >>>> extra_vars={'v':1}, anchor='main', >>>> renderstyle=True) >>>> paginator.records = db(query).count() >>>> paginate_info = PaginateInfo(paginator.page, paginator.paginate, >>>> paginator.records) >>>> # End Paging plugin... >>>> >>>> >>>> lists=db(query).select(db.EDXUSF00.USDIID,db.EDXUSF00.USDICD,db.EDXUSF00.USYUB5,db.EDXUSF00.USTSKJ,db.EDXUSF00.USUSCD,orderby=[db.EDXUSF00.USDIID,db.EDXUSF00.USDICD,db.EDXUSF00.USYUB5,db.EDXUSF00.USTSKJ],limitby=paginator.limitby()) >>>> return >>>> dict(form=form,lists=lists,paginator=paginator,paginate_selector=paginate_selector, >>>> >>>> paginate_info=paginate_info) >>>> >>>> >>>> >>>> On Wednesday, January 20, 2021 at 2:01:07 PM UTC-6 Jim S wrote: >>>> >>>>> I thought you were trying to get it working in this html tag: >>>>> >>>>> >>>> href="{{=URL('customer_view',args=[list.TKDIID,list.TKDICD])}}" >>>>> class="btn"> View< >>>>> >>>>> I don't see the 'list' variable in the controller... >>>>> >>>>> Where is that coming from? >>>>> >>>>> -Jim >>>>> >>>>> On Wed, Jan 20, 2021 at 1:49 PM Omi Chiba wrote: >>>>> >>>>>> I'm not sure how to check... >>>>>> >>>>>> This is my controller for view page >>>
Re: [web2py] Re: Pass/Receive args contains "&" in the value
ok, so this is four parameters I'm passing.. J2831 AL04 36105 HYUNDAI MOTOR MANUFACTURI then list.xxx or XML(list.xxx) actually shows the same result. It replaced blank with "_"... that's why I failed to get the data from the database because the original value doesn't have "_". I also tried the with "&" in the company name and it failed to display the page because of "&" J2831 AL04 36105 HYUNDAI_MOTOR_MANUFACTURI On Wednesday, January 20, 2021 at 2:35:56 PM UTC-6 Jim S wrote: > So, if you would do a for look around 'lists' and print out the field > values, what would that look like? Also, is there a difference if you also > print it out with the XML function wrapped around it? > > On Wed, Jan 20, 2021 at 2:03 PM Omi Chiba wrote: > >> here's the controller for enduser_index view. It's like I have this index >> view to list and lick "View" button to pass the variable and go to >> enduser_view page. >> >> def enduser_index(): >> response.title = 'List' >> response.subtitle = 'End User Code' >> >> form=SQLFORM.factory(Field('search')) >> form.custom.widget.search['_class'] = 'input-medium search-query' >> form.custom.submit['_value'] = 'Search' >> form.custom.submit['_class'] = 'btn' >> >> if form.accepts(request): >> key=form.vars.search.upper() + "%" >> query = (db.EDXUSF00.USDIID.like(key)) | >> (db.EDXUSF00.USDICD.like(key)) | (db.EDXUSF00.USTSKJ.like(key)) >> else: >> query = db.EDXUSF00.USDIID!="" >> >> # Paging plugin >> paginate_selector = PaginateSelector(anchor='main') >> paginator = Paginator(paginate=paginate_selector.paginate, >> extra_vars={'v':1}, anchor='main', >> renderstyle=True) >> paginator.records = db(query).count() >> paginate_info = PaginateInfo(paginator.page, paginator.paginate, >> paginator.records) >> # End Paging plugin... >> >> >> lists=db(query).select(db.EDXUSF00.USDIID,db.EDXUSF00.USDICD,db.EDXUSF00.USYUB5,db.EDXUSF00.USTSKJ,db.EDXUSF00.USUSCD,orderby=[db.EDXUSF00.USDIID,db.EDXUSF00.USDICD,db.EDXUSF00.USYUB5,db.EDXUSF00.USTSKJ],limitby=paginator.limitby()) >> return >> dict(form=form,lists=lists,paginator=paginator,paginate_selector=paginate_selector, >> >> paginate_info=paginate_info) >> >> >> >> On Wednesday, January 20, 2021 at 2:01:07 PM UTC-6 Jim S wrote: >> >>> I thought you were trying to get it working in this html tag: >>> >>> >> href="{{=URL('customer_view',args=[list.TKDIID,list.TKDICD])}}" >>> class="btn"> View< >>> >>> I don't see the 'list' variable in the controller... >>> >>> Where is that coming from? >>> >>> -Jim >>> >>> On Wed, Jan 20, 2021 at 1:49 PM Omi Chiba wrote: >>> >>>> I'm not sure how to check... >>>> >>>> This is my controller for view page >>>> >>>> def enduser_view(): >>>> response.title = 'View' >>>> response.subtitle = 'End User Code' >>>> >>>> request.args(0) or redirect (URL('enduser_index')) >>>> record = db.EDXUSF00(db.EDXUSF00.USDIID==request.args(0) and >>>> db.EDXUSF00.USDICD==request.args(1) and >>>> db.EDXUSF00.USYUB5==request.args(2) >>>> and db.EDXUSF00.USTSKJ==request.args(3)) >>>> >>>> if record != None: >>>> form = SQLFORM(db.EDXUSF00,record, readonly=True) >>>> else: >>>> redirect(URL('enduser_index')) >>>> >>>> return dict(form=form) >>>> >>>> >>>> >>>> On Wednesday, January 20, 2021 at 11:47:17 AM UTC-6 Jim S wrote: >>>> >>>>> I don't think it will help to change the controller side. >>>>> >>>>> In the controller can you print out the values and also print out the >>>>> XML(value) and see what the difference is? >>>>> >>>>> -Jim >>>>> >>>>> On Wed, Jan 20, 2021 at 10:36 AM Omi Chiba wrote: >>>>> >>>>>> I added XML. It doesn't show the error but cannot get the value and >>>>>> shows the records... should we changed the controller side too? >>>>>> >>>
Re: [web2py] Re: Pass/Receive args contains "&" in the value
here's the controller for enduser_index view. It's like I have this index view to list and lick "View" button to pass the variable and go to enduser_view page. def enduser_index(): response.title = 'List' response.subtitle = 'End User Code' form=SQLFORM.factory(Field('search')) form.custom.widget.search['_class'] = 'input-medium search-query' form.custom.submit['_value'] = 'Search' form.custom.submit['_class'] = 'btn' if form.accepts(request): key=form.vars.search.upper() + "%" query = (db.EDXUSF00.USDIID.like(key)) | (db.EDXUSF00.USDICD.like(key)) | (db.EDXUSF00.USTSKJ.like(key)) else: query = db.EDXUSF00.USDIID!="" # Paging plugin paginate_selector = PaginateSelector(anchor='main') paginator = Paginator(paginate=paginate_selector.paginate, extra_vars={'v':1}, anchor='main', renderstyle=True) paginator.records = db(query).count() paginate_info = PaginateInfo(paginator.page, paginator.paginate, paginator.records) # End Paging plugin... lists=db(query).select(db.EDXUSF00.USDIID,db.EDXUSF00.USDICD,db.EDXUSF00.USYUB5,db.EDXUSF00.USTSKJ,db.EDXUSF00.USUSCD,orderby=[db.EDXUSF00.USDIID,db.EDXUSF00.USDICD,db.EDXUSF00.USYUB5,db.EDXUSF00.USTSKJ],limitby=paginator.limitby()) return dict(form=form,lists=lists,paginator=paginator,paginate_selector=paginate_selector, paginate_info=paginate_info) On Wednesday, January 20, 2021 at 2:01:07 PM UTC-6 Jim S wrote: > I thought you were trying to get it working in this html tag: > > href="{{=URL('customer_view',args=[list.TKDIID,list.TKDICD])}}" > class="btn"> View< > > I don't see the 'list' variable in the controller... > > Where is that coming from? > > -Jim > > On Wed, Jan 20, 2021 at 1:49 PM Omi Chiba wrote: > >> I'm not sure how to check... >> >> This is my controller for view page >> >> def enduser_view(): >> response.title = 'View' >> response.subtitle = 'End User Code' >> >> request.args(0) or redirect (URL('enduser_index')) >> record = db.EDXUSF00(db.EDXUSF00.USDIID==request.args(0) and >> db.EDXUSF00.USDICD==request.args(1) and db.EDXUSF00.USYUB5==request.args(2) >> and db.EDXUSF00.USTSKJ==request.args(3)) >> >> if record != None: >> form = SQLFORM(db.EDXUSF00,record, readonly=True) >> else: >> redirect(URL('enduser_index')) >> >> return dict(form=form) >> >> >> >> On Wednesday, January 20, 2021 at 11:47:17 AM UTC-6 Jim S wrote: >> >>> I don't think it will help to change the controller side. >>> >>> In the controller can you print out the values and also print out the >>> XML(value) and see what the difference is? >>> >>> -Jim >>> >>> On Wed, Jan 20, 2021 at 10:36 AM Omi Chiba wrote: >>> >>>> I added XML. It doesn't show the error but cannot get the value and >>>> shows the records... should we changed the controller side too? >>>> >>>> View >>>> >>> href="{{=URL('enduser_view',args=[XML(list.USDIID),XML(list.USDICD),XML(list.USYUB5),XML(list.USTSKJ)])}}" >>>> >>>> class="btn"> View >>>> >>>> Controller >>>> record = db.EDXUSF00(db.EDXUSF00.USDIID==request.args(0) and >>>> db.EDXUSF00.USDICD==request.args(1) and >>>> db.EDXUSF00.USYUB5==request.args(2) >>>> and db.EDXUSF00.USTSKJ==request.args(3)) >>>> >>>> On Monday, January 18, 2021 at 4:16:04 PM UTC-6 Omi Chiba wrote: >>>> >>>>> JIm, >>>>> >>>>> Thank you for your reply! I will test it later this week and let you >>>>> guys know. >>>>> >>>>> On Monday, January 18, 2021 at 12:58:43 PM UTC-6 Jim S wrote: >>>>> >>>>>> Can you wrap it in an XML function? >>>>>> >>>>>> >>>>> class="icon-search"> View >>>>>> >>>>>> On Wednesday, January 13, 2021 at 4:03:54 PM UTC-6 Omi Chiba wrote: >>>>>> >>>>>>> In another word, how I can encode and decode the value including >>>>>>> special characters such as "&". >>>>>>> >>>>>>> https://help.marklogic.com/Knowledgebase/Article/View/using-url-encoding-to-handle-special-characters-in-a-document-uri >>>>>>> >>>>>&g
Re: [web2py] Re: Pass/Receive args contains "&" in the value
I'm not sure how to check... This is my controller for view page def enduser_view(): response.title = 'View' response.subtitle = 'End User Code' request.args(0) or redirect (URL('enduser_index')) record = db.EDXUSF00(db.EDXUSF00.USDIID==request.args(0) and db.EDXUSF00.USDICD==request.args(1) and db.EDXUSF00.USYUB5==request.args(2) and db.EDXUSF00.USTSKJ==request.args(3)) if record != None: form = SQLFORM(db.EDXUSF00,record, readonly=True) else: redirect(URL('enduser_index')) return dict(form=form) On Wednesday, January 20, 2021 at 11:47:17 AM UTC-6 Jim S wrote: > I don't think it will help to change the controller side. > > In the controller can you print out the values and also print out the > XML(value) and see what the difference is? > > -Jim > > On Wed, Jan 20, 2021 at 10:36 AM Omi Chiba wrote: > >> I added XML. It doesn't show the error but cannot get the value and shows >> the records... should we changed the controller side too? >> >> View >> > href="{{=URL('enduser_view',args=[XML(list.USDIID),XML(list.USDICD),XML(list.USYUB5),XML(list.USTSKJ)])}}" >> >> class="btn"> View >> >> Controller >> record = db.EDXUSF00(db.EDXUSF00.USDIID==request.args(0) and >> db.EDXUSF00.USDICD==request.args(1) and db.EDXUSF00.USYUB5==request.args(2) >> and db.EDXUSF00.USTSKJ==request.args(3)) >> >> On Monday, January 18, 2021 at 4:16:04 PM UTC-6 Omi Chiba wrote: >> >>> JIm, >>> >>> Thank you for your reply! I will test it later this week and let you >>> guys know. >>> >>> On Monday, January 18, 2021 at 12:58:43 PM UTC-6 Jim S wrote: >>> >>>> Can you wrap it in an XML function? >>>> >>>> >>> class="icon-search"> View >>>> >>>> On Wednesday, January 13, 2021 at 4:03:54 PM UTC-6 Omi Chiba wrote: >>>> >>>>> In another word, how I can encode and decode the value including >>>>> special characters such as "&". >>>>> >>>>> https://help.marklogic.com/Knowledgebase/Article/View/using-url-encoding-to-handle-special-characters-in-a-document-uri >>>>> >>>>> On Wednesday, January 13, 2021 at 8:24:22 AM UTC-6 Omi Chiba wrote: >>>>> >>>>>> Hi, the following works fine when there is no symbol such as "&" in >>>>>> the field value. How can we pass and receive the parameters which >>>>>> contains >>>>>> "&"..etc.? >>>>>> >>>>>> View - customer_index >>>>>> >>>>>> >>>>>> View >>>>>> >>>>>> Controller - default.py >>>>>> >>>>>> def customer_index(): >>>>>> response.title = 'List' >>>>>> response.subtitle = 'Customer Code' >>>>>> >>>>>> form=SQLFORM.factory(Field('search')) >>>>>> form.custom.widget.search['_class'] = 'input-medium search-query' >>>>>> form.custom.submit['_value'] = 'Search' >>>>>> form.custom.submit['_class'] = 'btn' >>>>>> >>>>>> if form.accepts(request): >>>>>> key=form.vars.search.upper() + "%" >>>>>> query = (db.EDXTKF00.TKDIID.like(key)) | >>>>>> (db.EDXTKF00.TKDICD.like(key)) >>>>>> else: >>>>>> query = db.EDXTKF00.TKDIID!="" >>>>>> >>>>>> # Paging plugin >>>>>> paginate_selector = PaginateSelector(anchor='main') >>>>>> paginator = Paginator(paginate=paginate_selector.paginate, >>>>>> extra_vars={'v':1}, anchor='main', >>>>>> renderstyle=True) >>>>>> paginator.records = db(query).count() >>>>>> paginate_info = PaginateInfo(paginator.page, paginator.paginate, >>>>>> paginator.records) >>>>>> # End Paging plugin... >>>>>> >>>>>> >>>>>> lists=db(query).select(db.EDXTKF00.TKDIID,db.EDXTKF00.TKDICD,db.EDXTKF00.TKTKSC,db.EDXTKF00.TKTKCD,db.EDXTKF00.TKDMCD,orderby=[db.EDXTKF00.TKDIID,db.EDXTKF00.TKDICD],limitby=paginator.limitby()) >>>>>> return >>&g
[web2py] Re: Pass/Receive args contains "&" in the value
I added XML. It doesn't show the error but cannot get the value and shows the records... should we changed the controller side too? View View Controller record = db.EDXUSF00(db.EDXUSF00.USDIID==request.args(0) and db.EDXUSF00.USDICD==request.args(1) and db.EDXUSF00.USYUB5==request.args(2) and db.EDXUSF00.USTSKJ==request.args(3)) On Monday, January 18, 2021 at 4:16:04 PM UTC-6 Omi Chiba wrote: > JIm, > > Thank you for your reply! I will test it later this week and let you guys > know. > > On Monday, January 18, 2021 at 12:58:43 PM UTC-6 Jim S wrote: > >> Can you wrap it in an XML function? >> >> > class="icon-search"> View >> >> On Wednesday, January 13, 2021 at 4:03:54 PM UTC-6 Omi Chiba wrote: >> >>> In another word, how I can encode and decode the value including special >>> characters such as "&". >>> >>> https://help.marklogic.com/Knowledgebase/Article/View/using-url-encoding-to-handle-special-characters-in-a-document-uri >>> >>> On Wednesday, January 13, 2021 at 8:24:22 AM UTC-6 Omi Chiba wrote: >>> >>>> Hi, the following works fine when there is no symbol such as "&" in the >>>> field value. How can we pass and receive the parameters which contains >>>> "&"..etc.? >>>> >>>> View - customer_index >>>> >>>> >>>> View >>>> >>>> Controller - default.py >>>> >>>> def customer_index(): >>>> response.title = 'List' >>>> response.subtitle = 'Customer Code' >>>> >>>> form=SQLFORM.factory(Field('search')) >>>> form.custom.widget.search['_class'] = 'input-medium search-query' >>>> form.custom.submit['_value'] = 'Search' >>>> form.custom.submit['_class'] = 'btn' >>>> >>>> if form.accepts(request): >>>> key=form.vars.search.upper() + "%" >>>> query = (db.EDXTKF00.TKDIID.like(key)) | >>>> (db.EDXTKF00.TKDICD.like(key)) >>>> else: >>>> query = db.EDXTKF00.TKDIID!="" >>>> >>>> # Paging plugin >>>> paginate_selector = PaginateSelector(anchor='main') >>>> paginator = Paginator(paginate=paginate_selector.paginate, >>>> extra_vars={'v':1}, anchor='main', >>>> renderstyle=True) >>>> paginator.records = db(query).count() >>>> paginate_info = PaginateInfo(paginator.page, paginator.paginate, >>>> paginator.records) >>>> # End Paging plugin... >>>> >>>> >>>> lists=db(query).select(db.EDXTKF00.TKDIID,db.EDXTKF00.TKDICD,db.EDXTKF00.TKTKSC,db.EDXTKF00.TKTKCD,db.EDXTKF00.TKDMCD,orderby=[db.EDXTKF00.TKDIID,db.EDXTKF00.TKDICD],limitby=paginator.limitby()) >>>> return >>>> dict(form=form,lists=lists,paginator=paginator,paginate_selector=paginate_selector, >>>> >>>> paginate_info=paginate_info) >>>> >>>> def customer_view(): >>>> response.title = 'View' >>>> response.subtitle = 'Customer Code' >>>> >>>> request.args(0) or redirect (URL('customer_index')) >>>> record = db.EDXTKF00(db.EDXTKF00.TKDIID==request.args(0) and >>>> db.EDXTKF00.TKDICD==request.args(1)) >>>> >>>> if record != None: >>>> form = SQLFORM(db.EDXTKF00,record, readonly=True) >>>> else: >>>> redirect(URL('customer_index')) >>>> >>>> return dict(form=form) >>>> >>>> >>>> >>>> -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/93e8a999-e0be-4e33-bc91-43e5451edee7n%40googlegroups.com.
[web2py] Re: Pass/Receive args contains "&" in the value
JIm, Thank you for your reply! I will test it later this week and let you guys know. On Monday, January 18, 2021 at 12:58:43 PM UTC-6 Jim S wrote: > Can you wrap it in an XML function? > > class="icon-search"> View > > On Wednesday, January 13, 2021 at 4:03:54 PM UTC-6 Omi Chiba wrote: > >> In another word, how I can encode and decode the value including special >> characters such as "&". >> >> https://help.marklogic.com/Knowledgebase/Article/View/using-url-encoding-to-handle-special-characters-in-a-document-uri >> >> On Wednesday, January 13, 2021 at 8:24:22 AM UTC-6 Omi Chiba wrote: >> >>> Hi, the following works fine when there is no symbol such as "&" in the >>> field value. How can we pass and receive the parameters which contains >>> "&"..etc.? >>> >>> View - customer_index >>> >>> >>> View >>> >>> Controller - default.py >>> >>> def customer_index(): >>> response.title = 'List' >>> response.subtitle = 'Customer Code' >>> >>> form=SQLFORM.factory(Field('search')) >>> form.custom.widget.search['_class'] = 'input-medium search-query' >>> form.custom.submit['_value'] = 'Search' >>> form.custom.submit['_class'] = 'btn' >>> >>> if form.accepts(request): >>> key=form.vars.search.upper() + "%" >>> query = (db.EDXTKF00.TKDIID.like(key)) | >>> (db.EDXTKF00.TKDICD.like(key)) >>> else: >>> query = db.EDXTKF00.TKDIID!="" >>> >>> # Paging plugin >>> paginate_selector = PaginateSelector(anchor='main') >>> paginator = Paginator(paginate=paginate_selector.paginate, >>> extra_vars={'v':1}, anchor='main', >>> renderstyle=True) >>> paginator.records = db(query).count() >>> paginate_info = PaginateInfo(paginator.page, paginator.paginate, >>> paginator.records) >>> # End Paging plugin... >>> >>> >>> lists=db(query).select(db.EDXTKF00.TKDIID,db.EDXTKF00.TKDICD,db.EDXTKF00.TKTKSC,db.EDXTKF00.TKTKCD,db.EDXTKF00.TKDMCD,orderby=[db.EDXTKF00.TKDIID,db.EDXTKF00.TKDICD],limitby=paginator.limitby()) >>> return >>> dict(form=form,lists=lists,paginator=paginator,paginate_selector=paginate_selector, >>> >>> paginate_info=paginate_info) >>> >>> def customer_view(): >>> response.title = 'View' >>> response.subtitle = 'Customer Code' >>> >>> request.args(0) or redirect (URL('customer_index')) >>> record = db.EDXTKF00(db.EDXTKF00.TKDIID==request.args(0) and >>> db.EDXTKF00.TKDICD==request.args(1)) >>> >>> if record != None: >>> form = SQLFORM(db.EDXTKF00,record, readonly=True) >>> else: >>> redirect(URL('customer_index')) >>> >>> return dict(form=form) >>> >>> >>> >>> -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/e24ae6ca-8baa-4cee-8960-44f200c8500cn%40googlegroups.com.
[web2py] Re: Pass/Receive args contains "&" in the value
In another word, how I can encode and decode the value including special characters such as "&". https://help.marklogic.com/Knowledgebase/Article/View/using-url-encoding-to-handle-special-characters-in-a-document-uri On Wednesday, January 13, 2021 at 8:24:22 AM UTC-6 Omi Chiba wrote: > Hi, the following works fine when there is no symbol such as "&" in the > field value. How can we pass and receive the parameters which contains > "&"..etc.? > > View - customer_index > > > View > > Controller - default.py > > def customer_index(): > response.title = 'List' > response.subtitle = 'Customer Code' > > form=SQLFORM.factory(Field('search')) > form.custom.widget.search['_class'] = 'input-medium search-query' > form.custom.submit['_value'] = 'Search' > form.custom.submit['_class'] = 'btn' > > if form.accepts(request): > key=form.vars.search.upper() + "%" > query = (db.EDXTKF00.TKDIID.like(key)) | > (db.EDXTKF00.TKDICD.like(key)) > else: > query = db.EDXTKF00.TKDIID!="" > > # Paging plugin > paginate_selector = PaginateSelector(anchor='main') > paginator = Paginator(paginate=paginate_selector.paginate, > extra_vars={'v':1}, anchor='main', > renderstyle=True) > paginator.records = db(query).count() > paginate_info = PaginateInfo(paginator.page, paginator.paginate, > paginator.records) > # End Paging plugin... > > > lists=db(query).select(db.EDXTKF00.TKDIID,db.EDXTKF00.TKDICD,db.EDXTKF00.TKTKSC,db.EDXTKF00.TKTKCD,db.EDXTKF00.TKDMCD,orderby=[db.EDXTKF00.TKDIID,db.EDXTKF00.TKDICD],limitby=paginator.limitby()) > return > dict(form=form,lists=lists,paginator=paginator,paginate_selector=paginate_selector, > > paginate_info=paginate_info) > > def customer_view(): > response.title = 'View' > response.subtitle = 'Customer Code' > > request.args(0) or redirect (URL('customer_index')) > record = db.EDXTKF00(db.EDXTKF00.TKDIID==request.args(0) and > db.EDXTKF00.TKDICD==request.args(1)) > > if record != None: > form = SQLFORM(db.EDXTKF00,record, readonly=True) > else: > redirect(URL('customer_index')) > > return dict(form=form) > > > > -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/47d6a561-3c6d-46a9-a77b-4049d97c0952n%40googlegroups.com.
[web2py] Pass/Receive args contains "&" in the value
Hi, the following works fine when there is no symbol such as "&" in the field value. How can we pass and receive the parameters which contains "&"..etc.? View - customer_index View Controller - default.py def customer_index(): response.title = 'List' response.subtitle = 'Customer Code' form=SQLFORM.factory(Field('search')) form.custom.widget.search['_class'] = 'input-medium search-query' form.custom.submit['_value'] = 'Search' form.custom.submit['_class'] = 'btn' if form.accepts(request): key=form.vars.search.upper() + "%" query = (db.EDXTKF00.TKDIID.like(key)) | (db.EDXTKF00.TKDICD.like(key)) else: query = db.EDXTKF00.TKDIID!="" # Paging plugin paginate_selector = PaginateSelector(anchor='main') paginator = Paginator(paginate=paginate_selector.paginate, extra_vars={'v':1}, anchor='main', renderstyle=True) paginator.records = db(query).count() paginate_info = PaginateInfo(paginator.page, paginator.paginate, paginator.records) # End Paging plugin... lists=db(query).select(db.EDXTKF00.TKDIID,db.EDXTKF00.TKDICD,db.EDXTKF00.TKTKSC,db.EDXTKF00.TKTKCD,db.EDXTKF00.TKDMCD,orderby=[db.EDXTKF00.TKDIID,db.EDXTKF00.TKDICD],limitby=paginator.limitby()) return dict(form=form,lists=lists,paginator=paginator,paginate_selector=paginate_selector, paginate_info=paginate_info) def customer_view(): response.title = 'View' response.subtitle = 'Customer Code' request.args(0) or redirect (URL('customer_index')) record = db.EDXTKF00(db.EDXTKF00.TKDIID==request.args(0) and db.EDXTKF00.TKDICD==request.args(1)) if record != None: form = SQLFORM(db.EDXTKF00,record, readonly=True) else: redirect(URL('customer_index')) return dict(form=form) -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/a8442abb-62cf-47fc-aa32-826bbe571af0n%40googlegroups.com.
Re: [web2py] Re: Web2py won't start with getLogger error
Massimo, thank you. Everything is ok now after reinstalling python. Yes, I'm still on chicago : ) On Oct 18, 2017 9:57 PM, "Massimo Di Pierro" <massimo.dipie...@gmail.com> wrote: > All I can offer is help you debug. Are you still in Chicago? Stop by my > office on Tuesday afternoon. > > > On Friday, 6 October 2017 18:32:51 UTC-5, Omi Chiba wrote: >> >> My Python version is 2.7.4. and My Web2py is Version >> 2.4.7-stable+timestamp.2013.05.24.17.48.47 >> >> Nothing changed since I setup my server in 2013 but it looks like >> something happened at 10/2 per error log. Remote Access to the server was >> down. My hosting company told me they did some kind of update and working >> fine now but my web2py doesn't work... >> >> >> On Friday, October 6, 2017 at 5:26:14 PM UTC-5, Omi Chiba wrote: >>> >>> Help! >>> >>> I was running old version (2015) of web2py on my hosting server as our >>> company's portal site and it stopped working suddenly. It's Windows 2012 >>> server with Uniserver(Apache). Apache start fine but shows error message. >>> >>> http://thksupport.com >>> >>> >>> Here's some related files including error log. >>> https://drive.google.com/drive/folders/0B3I1Y31Dk4GqTjRSZHFE >>> WlU0Mk0?usp=sharing >>> >>> I also tried if I can just start up web2py with rocket server by >>> excuting web2py.py but I got a following error. I really don't know what to >>> do... this is production server for our customer and need to be fixed as >>> soon as possible.I restored the entire folder for Uniserver and web2py but >>> same error. >>> >>> C:\web2py>web2py.py >>> Traceback (most recent call last): >>> File "C:\web2py\web2py.py", line 18, in >>> import gluon.widget >>> File "C:\web2py\gluon\__init__.py", line 15, in >>> from globals import current >>> File "C:\web2py\gluon\globals.py", line 17, in >>> from storage import Storage, List >>> File "C:\web2py\gluon\storage.py", line 16, in >>> import portalocker >>> File "C:\web2py\gluon\portalocker.py", line 46, in >>> logger = logging.getLogger("web2py") >>> AttributeError: 'module' object has no attribute 'getLogger' >>> >> -- > 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/6vmk64T1810/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/d/optout. > -- 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.
Re: [web2py] Re: Web2py won't start with getLogger error
Thank you for checking! It's working now after reinstalling python. On Wed, Oct 11, 2017 at 11:55 AM, Massimo Di Pierro < massimo.dipie...@gmail.com> wrote: > This is what I get: > > Python 2.7.13 |Anaconda 2.2.0 (x86_64)| (default, Dec 20 2016, 23:05:08) > > [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin > > Type "help", "copyright", "credits" or "license" for more information. > > Anaconda is brought to you by Continuum Analytics. > > Please check out: http://continuum.io/thanks and https://anaconda.org > > >>> import logging > > >>> import platform > > >>> logger = logging.getLogger("web2py") > > > python 2.7.4 is 4 years old. I suspect they installed a "logging" module > that conflicts with the standard logging one. This is not a web2py issue. > > On Friday, 6 October 2017 19:20:00 UTC-5, Omi Chiba wrote: >> >> But I realized the same error happen when I follow the code in python >> console... I don't understand because nothing changed python, web2py... >> since 2013. >> >> C:\>python >> Python 2.7.4 (default, Apr 6 2013, 19:54:46) [MSC v.1500 32 bit (Intel)] >> on win >> 32 >> Type "help", "copyright", "credits" or "license" for more information. >> >>> import logging >> >>> import platform >> >>> logger = logging.getLogger("web2py") >> Traceback (most recent call last): >> File "", line 1, in >> AttributeError: 'module' object has no attribute 'getLogger' >> >>> >> >> On Friday, October 6, 2017 at 6:54:53 PM UTC-5, Omi Chiba wrote: >>> >>> Python comand console? >>> >>> Yes, it looks ok I think. >>> http://prntscr.com/gu94ns >>> >>> On Friday, October 6, 2017 at 6:50:44 PM UTC-5, Dave S wrote: >>>> >>>> >>>> >>>> On Friday, October 6, 2017 at 4:43:18 PM UTC-7, Omi Chiba wrote: >>>>> >>>>> I have C:\Python27 in my "Path" System variables and I can run the >>>>> pyson module (*.py) from command prompt. >>>>> >>>> >>>> >>>> can you, at that prompt, do >>>> import logging >>>> dir(logging) >>>> >>>> >>>> >>>> ? >>>> >>>> /dps >>>> >>>> >>>>> >>>>> On Friday, October 6, 2017 at 6:15:56 PM UTC-5, Dave S wrote: >>>>>> >>>>>> >>>>>> >>>>>> On Friday, October 6, 2017 at 3:56:24 PM UTC-7, Dave S wrote: >>>>>>> >>>>>>> >>>>>>> >>>>>>> On Friday, October 6, 2017 at 3:26:14 PM UTC-7, Omi Chiba wrote: >>>>>>>> >>>>>>>> Help! >>>>>>>> >>>>>>>> I was running old version (2015) of web2py on my hosting server as >>>>>>>> our company's portal site and it stopped working suddenly. It's Windows >>>>>>>> 2012 server with Uniserver(Apache). Apache start fine but shows error >>>>>>>> message. >>>>>>>> [...] >>>>>>>> >>>>>>> AttributeError: 'module' object has no attribute 'getLogger' >>>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> The logging module is standard python for 2.7 and earlier ... what >>>>>>> version of python are you using, and has that changed recently? >>>>>>> >>>>>>> >>>>>> Or did your PYTHONPATH variable change. >>>>>> >>>>>> import logging >>>>>> dir(logging) >>>>>> >>>>>> >>>>>> >>>>>> shows getLogger in python 3.6.2, also. >>>>>> >>>>>> /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/6vmk64T1810/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/d/optout. > -- 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.
(Solved): [web2py] Re: Web2py won't start with getLogger error
Just let you guys know it's solved after re-installing Python!! Thank you for your help again! On Friday, October 6, 2017 at 8:40:36 PM UTC-5, Omi Chiba wrote: > > I don't think my hosting company did something on python but it looks like > my python is broken just like you ahowd me... I will reinstall python and > add in modules next Monday. Thank you for your help!!! > > On Oct 6, 2017 7:48 PM, "Dave S" <snidely@gmail.com> wrote: > >> >> >> On Friday, October 6, 2017 at 5:21:22 PM UTC-7, Omi Chiba wrote: >>> >>> Really >>> >> >> And even more entries for the 3.6 version. >> >> >>> >>> Do you think I should uninstall and reinstall the same version of python? >>> >>> >> Worth looking at. Was that touched when your hosts were updated? >> >> /dps >> >> >>> On Friday, October 6, 2017 at 7:19:10 PM UTC-5, Dave S wrote: >>>> >>>> >>>> >>>> On Friday, October 6, 2017 at 4:54:53 PM UTC-7, Omi Chiba wrote: >>>>> >>>>> Python comand console? >>>>> >>>>> Yes, it looks ok I think. >>>>> http://prntscr.com/gu94ns >>>>> >>>> >>>> Not so good. >>>> >>>> It should be more like >>>> >>>> >> dir(logging) >>>> ['BASIC_FORMAT', 'BufferingFormatter', 'CRITICAL', 'DEBUG', 'ERROR', >>>> 'FATAL', 'FileHandler', 'Filter', 'Filterer', 'Formatter', 'Handler', >>>> 'INFO', 'LogRecord', 'Logger', 'LoggerAdapter', 'Manager', 'NOTSET', >>>> 'NullHandler', 'PlaceHolder', 'RootLogger', 'StreamHandler', 'WARN', >>>> 'WARNING', '__all__', '__author__', '__builtins__', '__date__', >>>> '__doc__', '__file__', '__name__', '__package__', '__path__', >>>> '__status__', '__version__', '_acquireLock', '_addHandlerRef', >>>> '_checkLevel', '_defaultFormatter', '_handlerList', '_handlers', >>>> '_levelNames', '_lock', '_loggerClass', '_releaseLock', >>>> '_removeHandlerRef', '_showwarning', '_srcfile', '_startTime', >>>> '_unicode', '_warnings_showwarning', 'addLevelName', 'atexit', >>>> 'basicConfig', 'cStringIO', 'captureWarnings', 'codecs', 'critical', >>>> 'currentframe', 'debug', 'disable', 'error', 'exception', 'fatal', >>>> 'getLevelName', 'getLogger', 'getLoggerClass', 'info', 'log', >>>> 'logMultiprocessing', 'logProcesses', 'logThreads', 'makeLogRecord', >>>> 'os', 'raiseExceptions', 'root', 'setLoggerClass', 'shutdown', 'sys', >>>> 'thread', 'threading', 'time', 'traceback', 'warn', 'warning', >>>> 'warnings', 'weakref'] >>>> >>> >>>> >>>> >>>> /dps >>>> >>>> >>>>> >>>>> On Friday, October 6, 2017 at 6:50:44 PM UTC-5, Dave S wrote: >>>>>> >>>>>> >>>>>> >>>>>> On Friday, October 6, 2017 at 4:43:18 PM UTC-7, Omi Chiba wrote: >>>>>>> >>>>>>> I have C:\Python27 in my "Path" System variables and I can run the >>>>>>> pyson module (*.py) from command prompt. >>>>>>> >>>>>> >>>>>> >>>>>> can you, at that prompt, do >>>>>> import logging >>>>>> dir(logging) >>>>>> >>>>>> >>>>>> >>>>>> ? >>>>>> >>>>>> /dps >>>>>> >>>>>> >>>>>>> >>>>>>> On Friday, October 6, 2017 at 6:15:56 PM UTC-5, Dave S wrote: >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> On Friday, October 6, 2017 at 3:56:24 PM UTC-7, Dave S wrote: >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> On Friday, October 6, 2017 at 3:26:14 PM UTC-7, Omi Chiba wrote: >>>>>>>>>> >>>>>>>>>> Help! >>>>>>>>>> >>>>>>>>>> I was running old version (2015) of web2py on my hosting server >>>>>>>>>> as our company's portal site and it stopped working suddenly. It's >>>>>>>>>> Windows >>>>>>>>>> 2012 server with Uniserver(Apache). Apa
Re: [web2py] Re: Web2py won't start with getLogger error
I don't think my hosting company did something on python but it looks like my python is broken just like you ahowd me... I will reinstall python and add in modules next Monday. Thank you for your help!!! On Oct 6, 2017 7:48 PM, "Dave S" <snidely@gmail.com> wrote: > > > On Friday, October 6, 2017 at 5:21:22 PM UTC-7, Omi Chiba wrote: >> >> Really >> > > And even more entries for the 3.6 version. > > >> >> Do you think I should uninstall and reinstall the same version of python? >> >> > Worth looking at. Was that touched when your hosts were updated? > > /dps > > >> On Friday, October 6, 2017 at 7:19:10 PM UTC-5, Dave S wrote: >>> >>> >>> >>> On Friday, October 6, 2017 at 4:54:53 PM UTC-7, Omi Chiba wrote: >>>> >>>> Python comand console? >>>> >>>> Yes, it looks ok I think. >>>> http://prntscr.com/gu94ns >>>> >>> >>> Not so good. >>> >>> It should be more like >>> >>> >> dir(logging) >>> ['BASIC_FORMAT', 'BufferingFormatter', 'CRITICAL', 'DEBUG', 'ERROR', >>> 'FATAL', 'FileHandler', 'Filter', 'Filterer', 'Formatter', 'Handler', >>> 'INFO', 'LogRecord', 'Logger', 'LoggerAdapter', 'Manager', 'NOTSET', >>> 'NullHandler', 'PlaceHolder', 'RootLogger', 'StreamHandler', 'WARN', >>> 'WARNING', '__all__', '__author__', '__builtins__', '__date__', >>> '__doc__', '__file__', '__name__', '__package__', '__path__', >>> '__status__', '__version__', '_acquireLock', '_addHandlerRef', >>> '_checkLevel', '_defaultFormatter', '_handlerList', '_handlers', >>> '_levelNames', '_lock', '_loggerClass', '_releaseLock', >>> '_removeHandlerRef', '_showwarning', '_srcfile', '_startTime', >>> '_unicode', '_warnings_showwarning', 'addLevelName', 'atexit', >>> 'basicConfig', 'cStringIO', 'captureWarnings', 'codecs', 'critical', >>> 'currentframe', 'debug', 'disable', 'error', 'exception', 'fatal', >>> 'getLevelName', 'getLogger', 'getLoggerClass', 'info', 'log', >>> 'logMultiprocessing', 'logProcesses', 'logThreads', 'makeLogRecord', >>> 'os', 'raiseExceptions', 'root', 'setLoggerClass', 'shutdown', 'sys', >>> 'thread', 'threading', 'time', 'traceback', 'warn', 'warning', >>> 'warnings', 'weakref'] >>> >>> >>> >>> >>> /dps >>> >>> >>>> >>>> On Friday, October 6, 2017 at 6:50:44 PM UTC-5, Dave S wrote: >>>>> >>>>> >>>>> >>>>> On Friday, October 6, 2017 at 4:43:18 PM UTC-7, Omi Chiba wrote: >>>>>> >>>>>> I have C:\Python27 in my "Path" System variables and I can run the >>>>>> pyson module (*.py) from command prompt. >>>>>> >>>>> >>>>> >>>>> can you, at that prompt, do >>>>> import logging >>>>> dir(logging) >>>>> >>>>> >>>>> >>>>> ? >>>>> >>>>> /dps >>>>> >>>>> >>>>>> >>>>>> On Friday, October 6, 2017 at 6:15:56 PM UTC-5, Dave S wrote: >>>>>>> >>>>>>> >>>>>>> >>>>>>> On Friday, October 6, 2017 at 3:56:24 PM UTC-7, Dave S wrote: >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> On Friday, October 6, 2017 at 3:26:14 PM UTC-7, Omi Chiba wrote: >>>>>>>>> >>>>>>>>> Help! >>>>>>>>> >>>>>>>>> I was running old version (2015) of web2py on my hosting server as >>>>>>>>> our company's portal site and it stopped working suddenly. It's >>>>>>>>> Windows >>>>>>>>> 2012 server with Uniserver(Apache). Apache start fine but shows error >>>>>>>>> message. >>>>>>>>> [...] >>>>>>>>> >>>>>>>> AttributeError: 'module' object has no attribute 'getLogger' >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> The logging module is standard python for 2.7 and earlier ... what >>>>>>>> version of python are you using, and has that changed recently? >>>>>>>> >>>>>>>> >>>>>>> Or did your PYTHONPATH variable change. >>>>>>> >>>>>>> import logging >>>>>>> dir(logging) >>>>>>> >>>>>>> >>>>>>> >>>>>>> shows getLogger in python 3.6.2, also. >>>>>>> >>>>>>> /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/6vmk64T1810/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/d/optout. > -- 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: Web2py won't start with getLogger error
Really Do you think I should uninstall and reinstall the same version of python? On Friday, October 6, 2017 at 7:19:10 PM UTC-5, Dave S wrote: > > > > On Friday, October 6, 2017 at 4:54:53 PM UTC-7, Omi Chiba wrote: >> >> Python comand console? >> >> Yes, it looks ok I think. >> http://prntscr.com/gu94ns >> > > Not so good. > > It should be more like > > >> dir(logging) > ['BASIC_FORMAT', 'BufferingFormatter', 'CRITICAL', 'DEBUG', 'ERROR', > 'FATAL', 'FileHandler', 'Filter', 'Filterer', 'Formatter', 'Handler', > 'INFO', 'LogRecord', 'Logger', 'LoggerAdapter', 'Manager', 'NOTSET', > 'NullHandler', 'PlaceHolder', 'RootLogger', 'StreamHandler', 'WARN', > 'WARNING', '__all__', '__author__', '__builtins__', '__date__', '__doc__', > '__file__', '__name__', '__package__', '__path__', '__status__', > '__version__', '_acquireLock', '_addHandlerRef', '_checkLevel', > '_defaultFormatter', '_handlerList', '_handlers', '_levelNames', '_lock', > '_loggerClass', '_releaseLock', '_removeHandlerRef', '_showwarning', > '_srcfile', '_startTime', '_unicode', '_warnings_showwarning', > 'addLevelName', 'atexit', 'basicConfig', 'cStringIO', 'captureWarnings', > 'codecs', 'critical', 'currentframe', 'debug', 'disable', 'error', > 'exception', 'fatal', 'getLevelName', 'getLogger', 'getLoggerClass', > 'info', 'log', 'logMultiprocessing', 'logProcesses', 'logThreads', > 'makeLogRecord', 'os', 'raiseExceptions', 'root', 'setLoggerClass', > 'shutdown', 'sys', 'thread', 'threading', 'time', 'traceback', 'warn', > 'warning', 'warnings', 'weakref'] > >>> > > > /dps > > >> >> On Friday, October 6, 2017 at 6:50:44 PM UTC-5, Dave S wrote: >>> >>> >>> >>> On Friday, October 6, 2017 at 4:43:18 PM UTC-7, Omi Chiba wrote: >>>> >>>> I have C:\Python27 in my "Path" System variables and I can run the >>>> pyson module (*.py) from command prompt. >>>> >>> >>> >>> can you, at that prompt, do >>> import logging >>> dir(logging) >>> >>> >>> >>> ? >>> >>> /dps >>> >>> >>>> >>>> On Friday, October 6, 2017 at 6:15:56 PM UTC-5, Dave S wrote: >>>>> >>>>> >>>>> >>>>> On Friday, October 6, 2017 at 3:56:24 PM UTC-7, Dave S wrote: >>>>>> >>>>>> >>>>>> >>>>>> On Friday, October 6, 2017 at 3:26:14 PM UTC-7, Omi Chiba wrote: >>>>>>> >>>>>>> Help! >>>>>>> >>>>>>> I was running old version (2015) of web2py on my hosting server as >>>>>>> our company's portal site and it stopped working suddenly. It's Windows >>>>>>> 2012 server with Uniserver(Apache). Apache start fine but shows error >>>>>>> message. >>>>>>> [...] >>>>>>> >>>>>> AttributeError: 'module' object has no attribute 'getLogger' >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> The logging module is standard python for 2.7 and earlier ... what >>>>>> version of python are you using, and has that changed recently? >>>>>> >>>>>> >>>>> Or did your PYTHONPATH variable change. >>>>> >>>>> import logging >>>>> dir(logging) >>>>> >>>>> >>>>> >>>>> shows getLogger in python 3.6.2, also. >>>>> >>>>> /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 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: Web2py won't start with getLogger error
But I realized the same error happen when I follow the code in python console... I don't understand because nothing changed python, web2py... since 2013. C:\>python Python 2.7.4 (default, Apr 6 2013, 19:54:46) [MSC v.1500 32 bit (Intel)] on win 32 Type "help", "copyright", "credits" or "license" for more information. >>> import logging >>> import platform >>> logger = logging.getLogger("web2py") Traceback (most recent call last): File "", line 1, in AttributeError: 'module' object has no attribute 'getLogger' >>> On Friday, October 6, 2017 at 6:54:53 PM UTC-5, Omi Chiba wrote: > > Python comand console? > > Yes, it looks ok I think. > http://prntscr.com/gu94ns > > On Friday, October 6, 2017 at 6:50:44 PM UTC-5, Dave S wrote: >> >> >> >> On Friday, October 6, 2017 at 4:43:18 PM UTC-7, Omi Chiba wrote: >>> >>> I have C:\Python27 in my "Path" System variables and I can run the pyson >>> module (*.py) from command prompt. >>> >> >> >> can you, at that prompt, do >> import logging >> dir(logging) >> >> >> >> ? >> >> /dps >> >> >>> >>> On Friday, October 6, 2017 at 6:15:56 PM UTC-5, Dave S wrote: >>>> >>>> >>>> >>>> On Friday, October 6, 2017 at 3:56:24 PM UTC-7, Dave S wrote: >>>>> >>>>> >>>>> >>>>> On Friday, October 6, 2017 at 3:26:14 PM UTC-7, Omi Chiba wrote: >>>>>> >>>>>> Help! >>>>>> >>>>>> I was running old version (2015) of web2py on my hosting server as >>>>>> our company's portal site and it stopped working suddenly. It's Windows >>>>>> 2012 server with Uniserver(Apache). Apache start fine but shows error >>>>>> message. >>>>>> [...] >>>>>> >>>>> AttributeError: 'module' object has no attribute 'getLogger' >>>>>> >>>>> >>>>> >>>>> >>>>> The logging module is standard python for 2.7 and earlier ... what >>>>> version of python are you using, and has that changed recently? >>>>> >>>>> >>>> Or did your PYTHONPATH variable change. >>>> >>>> import logging >>>> dir(logging) >>>> >>>> >>>> >>>> shows getLogger in python 3.6.2, also. >>>> >>>> /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 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: Web2py won't start with getLogger error
Python comand console? Yes, it looks ok I think. http://prntscr.com/gu94ns On Friday, October 6, 2017 at 6:50:44 PM UTC-5, Dave S wrote: > > > > On Friday, October 6, 2017 at 4:43:18 PM UTC-7, Omi Chiba wrote: >> >> I have C:\Python27 in my "Path" System variables and I can run the pyson >> module (*.py) from command prompt. >> > > > can you, at that prompt, do > import logging > dir(logging) > > > > ? > > /dps > > >> >> On Friday, October 6, 2017 at 6:15:56 PM UTC-5, Dave S wrote: >>> >>> >>> >>> On Friday, October 6, 2017 at 3:56:24 PM UTC-7, Dave S wrote: >>>> >>>> >>>> >>>> On Friday, October 6, 2017 at 3:26:14 PM UTC-7, Omi Chiba wrote: >>>>> >>>>> Help! >>>>> >>>>> I was running old version (2015) of web2py on my hosting server as our >>>>> company's portal site and it stopped working suddenly. It's Windows 2012 >>>>> server with Uniserver(Apache). Apache start fine but shows error message. >>>>> [...] >>>>> >>>> AttributeError: 'module' object has no attribute 'getLogger' >>>>> >>>> >>>> >>>> >>>> The logging module is standard python for 2.7 and earlier ... what >>>> version of python are you using, and has that changed recently? >>>> >>>> >>> Or did your PYTHONPATH variable change. >>> >>> import logging >>> dir(logging) >>> >>> >>> >>> shows getLogger in python 3.6.2, also. >>> >>> /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 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: Web2py won't start with getLogger error
I have C:\Python27 in my "Path" System variables and I can run the pyson module (*.py) from command prompt. On Friday, October 6, 2017 at 6:15:56 PM UTC-5, Dave S wrote: > > > > On Friday, October 6, 2017 at 3:56:24 PM UTC-7, Dave S wrote: >> >> >> >> On Friday, October 6, 2017 at 3:26:14 PM UTC-7, Omi Chiba wrote: >>> >>> Help! >>> >>> I was running old version (2015) of web2py on my hosting server as our >>> company's portal site and it stopped working suddenly. It's Windows 2012 >>> server with Uniserver(Apache). Apache start fine but shows error message. >>> [...] >>> >> AttributeError: 'module' object has no attribute 'getLogger' >>> >> >> >> >> The logging module is standard python for 2.7 and earlier ... what >> version of python are you using, and has that changed recently? >> >> > Or did your PYTHONPATH variable change. > > import logging > dir(logging) > > > > shows getLogger in python 3.6.2, also. > > /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 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: Web2py won't start with getLogger error
My Python version is 2.7.4. and My Web2py is Version 2.4.7-stable+timestamp.2013.05.24.17.48.47 Nothing changed since I setup my server in 2013 but it looks like something happened at 10/2 per error log. Remote Access to the server was down. My hosting company told me they did some kind of update and working fine now but my web2py doesn't work... On Friday, October 6, 2017 at 5:26:14 PM UTC-5, Omi Chiba wrote: > > Help! > > I was running old version (2015) of web2py on my hosting server as our > company's portal site and it stopped working suddenly. It's Windows 2012 > server with Uniserver(Apache). Apache start fine but shows error message. > > http://thksupport.com > > > Here's some related files including error log. > > https://drive.google.com/drive/folders/0B3I1Y31Dk4GqTjRSZHFEWlU0Mk0?usp=sharing > > I also tried if I can just start up web2py with rocket server by excuting > web2py.py but I got a following error. I really don't know what to do... > this is production server for our customer and need to be fixed as soon as > possible.I restored the entire folder for Uniserver and web2py but same > error. > > C:\web2py>web2py.py > Traceback (most recent call last): > File "C:\web2py\web2py.py", line 18, in > import gluon.widget > File "C:\web2py\gluon\__init__.py", line 15, in > from globals import current > File "C:\web2py\gluon\globals.py", line 17, in > from storage import Storage, List > File "C:\web2py\gluon\storage.py", line 16, in > import portalocker > File "C:\web2py\gluon\portalocker.py", line 46, in > logger = logging.getLogger("web2py") > AttributeError: 'module' object has no attribute 'getLogger' > -- 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] Web2py won't start with getLogger error
Help! I was running old version (2015) of web2py on my hosting server as our company's portal site and it stopped working suddenly. It's Windows 2012 server with Uniserver(Apache). Apache start fine but shows error message. http://thksupport.com I also tried if I can just start up web2py with rocket server by excuting web2py.py but I got a following error. I really don't know what to do... this is production server for our customer and need to be fixed as soon as possible.I restored the entire folder for Uniserver and web2py but same error. C:\web2py>web2py.py Traceback (most recent call last): File "C:\web2py\web2py.py", line 18, in import gluon.widget File "C:\web2py\gluon\__init__.py", line 15, in from globals import current File "C:\web2py\gluon\globals.py", line 17, in from storage import Storage, List File "C:\web2py\gluon\storage.py", line 16, in import portalocker File "C:\web2py\gluon\portalocker.py", line 46, in logger = logging.getLogger("web2py") AttributeError: 'module' object has no attribute 'getLogger' -- 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.
Re: [web2py] Re: web2py for windows server. IIS or Nginx?
OK! I failed last time but it worth try again. I will follow the book try it later. http://www.web2py.com/books/default/chapter/29/13/deployment-recipes?search=iis#IIS On Wednesday, November 2, 2016 at 3:43:37 AM UTC-5, Niphlod wrote: > > *nix --> nginx with uwsgi > windows --> iis with fastcgi > > > BTW: iis is perfectly fine running production envs. And it's NOT difficult. > > > On Tuesday, November 1, 2016 at 8:01:22 PM UTC+1, Omi Chiba wrote: >> >> Thank you! I will stick to Apache/wsgi for now. >> >> On Tuesday, November 1, 2016 at 1:54:37 PM UTC-5, Jim S wrote: >>> >>> I think the thread you referenced was one discussing deployment on >>> Ubuntu where yes, nginx/uwsgi is preferred. But, the Windows environment >>> is different (in my opinion) since the Windows nginx is still considered >>> 'beta'. I wouldn't feel that comfortable using it. (that said, I do use >>> many other 'beta' projects) >>> >>> If Apache/mod_wsgi is really frowned upon, should it be noted in the >>> book? >>> >>> @omi - I migrated from Windows/Apache/mod_wsgi a while back to >>> Ubuntu/nginx/uwsgi. I think that at that time I switched from using pyodbc >>> to pypyodbc. I too access MS SQL servers from my ubuntu box using ODBC >>> (along with IBM AS/400 databases). It works very well for me. >>> >>> -Jim >>> >>> >>> On Tuesday, November 1, 2016 at 1:33:53 PM UTC-5, Richard wrote: >>>> >>>> I would say, we don't not don't support it, we just don't maintain a >>>> web2py setup script with Apache... I think the decision was to reduce the >>>> number of setup script to the bare minium to only the one web2py-devs are >>>> willing to maintain... >>>> >>>> That been said, I am sure that if you or someone else take owner ship >>>> to update and maintain Apache setup script because it important for you we >>>> will bring it back in the scripts folder... But I wouldn't take that path >>>> before someone demonstrate commitment to the task as we don't want to get >>>> back stuff that will not be maintain in years in the repo... I guess you >>>> can set your own github repo to demonstrate your commitment and help the >>>> community though, and it could be reference somewhere appropriate in the >>>> book. >>>> >>>> Richard >>>> >>>> On Tue, Nov 1, 2016 at 2:22 PM, Dave S <snide...@gmail.com> wrote: >>>> >>>>> >>>>> >>>>> On Tuesday, November 1, 2016 at 7:51:26 AM UTC-7, Omi Chiba wrote: >>>>>> >>>>>> Thank you. I thought the Massimo's comment below and he also >>>>>> mentioned somewhere we don't want to support Apache anymore... that's >>>>>> why I >>>>>> was nervous. I was thinking to your direction (Moving to Ubuntu) but I >>>>>> use >>>>>> pyodbc to connect Microsoft SQL Server and DB2, also python-ldap.. so >>>>>> not >>>>>> sure if it works the same way. >>>>>> >>>>>> >>>>>> "P.S. I stand by Niphlod. He did not say anything offending and his >>>>>> comment was insightful. We do not recommend apache+mod_wsgi because >>>>>> there >>>>>> are better ways (nginx+uwsgi)." >>>>>> >>>>>> >>>>> If you have a working Apache configuration, that's an argument for >>>>> staying with it [caveats follow]. Part of the deprecating is because >>>>> Apache configuration is delicate, complicated, and [reportedly] the >>>>> documentation isn't always helpful. If you're beyond that stage, that's >>>>> one objection overcome. The caveats: there is some concern that Apache >>>>> security updates may be frequent and patching may be delicate and >>>>> complicated [it's been around long enough that may have an "organic" >>>>> structure]. >>>>> >>>>> I think Niphlod has run both IIS and nginx on Windows, and nginx on >>>>> his linux systems, but I'd have to go back through his posts to be sure >>>>> of >>>>> that. >>>>> >>>>> /dps >>>>> >>>>> >>>>> >>>>>> On Tuesday, November 1, 2016 at 9:39:17 AM UTC-5, J
Re: [web2py] Re: web2py for windows server. IIS or Nginx?
Thank you! I will stick to Apache/wsgi for now. On Tuesday, November 1, 2016 at 1:54:37 PM UTC-5, Jim S wrote: > > I think the thread you referenced was one discussing deployment on Ubuntu > where yes, nginx/uwsgi is preferred. But, the Windows environment is > different (in my opinion) since the Windows nginx is still considered > 'beta'. I wouldn't feel that comfortable using it. (that said, I do use > many other 'beta' projects) > > If Apache/mod_wsgi is really frowned upon, should it be noted in the book? > > @omi - I migrated from Windows/Apache/mod_wsgi a while back to > Ubuntu/nginx/uwsgi. I think that at that time I switched from using pyodbc > to pypyodbc. I too access MS SQL servers from my ubuntu box using ODBC > (along with IBM AS/400 databases). It works very well for me. > > -Jim > > > On Tuesday, November 1, 2016 at 1:33:53 PM UTC-5, Richard wrote: >> >> I would say, we don't not don't support it, we just don't maintain a >> web2py setup script with Apache... I think the decision was to reduce the >> number of setup script to the bare minium to only the one web2py-devs are >> willing to maintain... >> >> That been said, I am sure that if you or someone else take owner ship to >> update and maintain Apache setup script because it important for you we >> will bring it back in the scripts folder... But I wouldn't take that path >> before someone demonstrate commitment to the task as we don't want to get >> back stuff that will not be maintain in years in the repo... I guess you >> can set your own github repo to demonstrate your commitment and help the >> community though, and it could be reference somewhere appropriate in the >> book. >> >> Richard >> >> On Tue, Nov 1, 2016 at 2:22 PM, Dave S <snide...@gmail.com> wrote: >> >>> >>> >>> On Tuesday, November 1, 2016 at 7:51:26 AM UTC-7, Omi Chiba wrote: >>>> >>>> Thank you. I thought the Massimo's comment below and he also mentioned >>>> somewhere we don't want to support Apache anymore... that's why I was >>>> nervous. I was thinking to your direction (Moving to Ubuntu) but I use >>>> pyodbc to connect Microsoft SQL Server and DB2, also python-ldap.. so not >>>> sure if it works the same way. >>>> >>>> >>>> "P.S. I stand by Niphlod. He did not say anything offending and his >>>> comment was insightful. We do not recommend apache+mod_wsgi because there >>>> are better ways (nginx+uwsgi)." >>>> >>>> >>> If you have a working Apache configuration, that's an argument for >>> staying with it [caveats follow]. Part of the deprecating is because >>> Apache configuration is delicate, complicated, and [reportedly] the >>> documentation isn't always helpful. If you're beyond that stage, that's >>> one objection overcome. The caveats: there is some concern that Apache >>> security updates may be frequent and patching may be delicate and >>> complicated [it's been around long enough that may have an "organic" >>> structure]. >>> >>> I think Niphlod has run both IIS and nginx on Windows, and nginx on his >>> linux systems, but I'd have to go back through his posts to be sure of that. >>> >>> /dps >>> >>> >>> >>>> On Tuesday, November 1, 2016 at 9:39:17 AM UTC-5, Jim S wrote: >>>>> >>>>> I haven't seen anything about Apache no longer supported. Did I miss >>>>> something? >>>>> >>>>> To my knowledge, nginx is not considered 'production ready' on >>>>> Windows. See the first paragraph here: >>>>> http://nginx.org/en/docs/windows.html >>>>> >>>>> I think Apache is the way to go. >>>>> http://web2py.com/books/default/chapter/29/13/deployment-recipes#Apache-and-mod_wsgi >>>>> >>>>> For me though, I've moved all of my production servers to Ubuntu with >>>>> nginx / uwsgi. >>>>> >>>>> -Jim >>>>> >>>>> On Monday, October 31, 2016 at 5:31:06 PM UTC-5, Omi Chiba wrote: >>>>>> >>>>>> I'm running production site with Apache but it sounds like we don't >>>>>> support apache anymore... which is one is better/easy option for me? I >>>>>> tried IIS long time ago but didn't success... maybe it was too >>>>>> complicated >>>>>> for
[web2py] Re: web2py for windows server. IIS or Nginx?
Thank you. I thought the Massimo's comment below and he also mentioned somewhere we don't want to support Apache anymore... that's why I was nervous. I was thinking to your direction (Moving to Ubuntu) but I use pyodbc to connect Microsoft SQL Server and DB2, also python-ldap.. so not sure if it works the same way. "P.S. I stand by Niphlod. He did not say anything offending and his comment was insightful. We do not recommend apache+mod_wsgi because there are better ways (nginx+uwsgi)." On Tuesday, November 1, 2016 at 9:39:17 AM UTC-5, Jim S wrote: > > I haven't seen anything about Apache no longer supported. Did I miss > something? > > To my knowledge, nginx is not considered 'production ready' on Windows. > See the first paragraph here: http://nginx.org/en/docs/windows.html > > I think Apache is the way to go. > http://web2py.com/books/default/chapter/29/13/deployment-recipes#Apache-and-mod_wsgi > > For me though, I've moved all of my production servers to Ubuntu with > nginx / uwsgi. > > -Jim > > On Monday, October 31, 2016 at 5:31:06 PM UTC-5, Omi Chiba wrote: >> >> I'm running production site with Apache but it sounds like we don't >> support apache anymore... which is one is better/easy option for me? I >> tried IIS long time ago but didn't success... maybe it was too complicated >> for me. >> > -- 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] web2py for windows server. IIS or Nginx?
I'm running production site with Apache but it sounds like we don't support apache anymore... which is one is better/easy option for me? I tried IIS long time ago but didn't success... maybe it was too complicated for me. -- 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.
Re: [web2py] Re: Session folder size
Yes, I know it's available on admin but trying to automate the process. I'm running web2py on windows so it sounds like I can create a .bat file to run the sessions2trash.py command. On Monday, February 23, 2015 at 7:28:13 AM UTC-6, 黄祥 wrote: i think web2py admin already have it when you press the clean on admin interface it said : cache, errors and sessions cleaned best regards, stifan On Monday, February 23, 2015 at 4:50:44 PM UTC+7, Ramos wrote: there should be an admin button to clean that session garbage, as we already have to clean errors. 2015-02-23 9:33 GMT+00:00 Annet anne...@googlemail.com: Hi, I had an issue with the sessions2trash.py file which Niphlod fixed last week. The sessions2trash.py script posted here works: https://www.dropbox.com/s/4080g390sa5byw6/sessions2trash.py?dl=0 Kind regards, Annet -- 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+un...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- 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: Session folder size
Tnanks! Good to know. On Friday, February 20, 2015 at 2:20:53 PM UTC-6, Niphlod wrote: there's sessions2trash.py for that http://web2py.com/books/default/chapter/29/13/deployment-recipes#Cleaning-up-sessions On Friday, February 20, 2015 at 8:47:46 PM UTC+1, Omi Chiba wrote: I'm running web2py website about 2 years. Not much transactions maybe 10 per day but # of files under sessions are enormous and total size for the folder is around 100MB but the Size on disk shows about 10GB. I found it because it takes too long time to copy the folder... I run the clean up. It takes 15-30 min and finally removed all the files. Do you guys have a similar problem? Maybe we can automatically delete the exipired sessions. -- 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] Session folder size
I'm running web2py website about 2 years. Not much transactions maybe 10 per day but # of files under sessions are enormous and total size for the folder is around 100MB but the Size on disk shows about 10GB. I found it because it takes too long time to copy the folder... I run the clean up. It takes 15-30 min and finally removed all the files. Do you guys have a similar problem? Maybe we can automatically delete the exipired sessions. -- 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.
Re: [web2py] Re: form.custom.dspval and IS_IN_DB
OK, I don't like this but this is only way to do. I can look up the table in the view. What a mess tr td class=w2p_fwlabelGrade/label/td td class=w2p_fw : {{grade = db.KR_GradeLabel(db.KR_GradeLabel.Name==form.custom.dspval.Grade)}} {{if grade:}} {{=grade.Label}} {{else:}} {{=form.custom.dspval.Grade}} {{pass}}/td /tr On Thursday, February 5, 2015 at 2:37:10 PM UTC-6, Omi Chiba wrote: Thank you for the reply. I'm not really sure how to use lamda. The problem is IS_IN_DB doesn't work when it's readonly and I found requires only works for Create/Edit and need to use represent for readonly view. I think this is a bug and should be it's already fixed but doen't matter to me because I'm stuck in my web2py version. So I'm trying to rewrite db.KR_Product.Grade.requires=IS_IN_DB(db,'KR_GradeLabel.Name','%(Label)s') for represent. I need to make this work In worst case, I need to lookup this KR_GradeLabel table in view using the value P and get the Label P = Precision On Thursday, February 5, 2015 at 2:23:09 PM UTC-6, Richard wrote: Omi, In this : db.KR_Product.Grade.represent = lambda Name: SPAN(db.KR_GradeLabel[Name].Label) I don't understand where you are going... You try to set a represent over table KR_Product for field Grade right? But you get you represent value from another table KR_GradeLabel... In case of a represent the lambda value is the field content for a given record... So you Name lambda passed variable may sure not containing what you think or want it contains... I don't see in your model definition that KR_Product.Grade to be actually a reference field... Model not saying so and field name neither... Richard On Thu, Feb 5, 2015 at 3:09 PM, Omi Chiba ochi...@gmail.com wrote: I'm using 2.4.7 released 2013.05.24 so it could be bug and fixed now but I need to work on this version for now because I have issue with the latest web2py. Anyway, I found this https://groups.google.com/forum/#!searchin/web2py/IS_IN_DB$20readonly/web2py/uBBcvthCDl8/Z7s872JW47IJ and tried something db.KR_Product.Grade.represent = lambda Name: SPAN(db.KR_GradeLabel[Name].Label) but I got a error says type 'exceptions.AttributeError'('Table' object has no attribute 'P') Which P is the key value. And I want to shop P = Precision from another table. On Thursday, February 5, 2015 at 1:48:48 PM UTC-6, Omi Chiba wrote: I tried edit mode and put the following script in the view which works but feels so stupid and user cannot copy the values which I have to allow them top copy and paste. script jQuery(document).ready(function(){ jQuery('#main').find('input, select').attr(readonly, true); }); /script On Thursday, February 5, 2015 at 11:22:49 AM UTC-6, Omi Chiba wrote: In another word, it shows fine when I use {{=form.custom.widget.Grade}} with edit mode ( form = SQLFORM(db.KR_Product,record, readonly=False)) but not when I do readonly=True -- 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+un...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- 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] form.custom.dspval and IS_IN_DB
I want to display the value from IS_IN_DB. I have P as value and display P = Precision from the table. It's working fine on Edit mode in admin. But when I display the values, form.custom.dspval and form.custom.inpval shows the same value P. Any idea? *My View* {{=form.custom.begin}} table tbody tr td class=w2p_fwlabelGrade/label/td td class=w2p_fw : {{=form.custom.widget.Grade}}/td /tr /table {{=form.custom.end}} *My model* db.define_table('KR_Product', Field('ProductCode', length=15), Field('PartNumber', length=50), Field('Grade', length=1), Field('Cover', length=1), Field('Sensor', length=1), Field('Housing', length=1), Field('Flange', length=1), Field('Description', length=500) ) db.KR_Product.Grade.requires=IS_IN_DB(db,'KR_GradeLabel.Name','%(Label)s') db.define_table('KR_GradeLabel', Field('Name', length=1), Field('Label', length=50), primarykey=['Name'] ) -- 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: form.custom.dspval and IS_IN_DB
In another word, it shows fine when I use {{=form.custom.widget.Grade}} with edit mode ( form = SQLFORM(db.KR_Product,record, readonly=False)) but not when I do readonly=True -- 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] form.custom.dspval and IS_IN_DB
I'm trying to display (P = Precision) instead of P. I tired both form.custom.dspval and form.custom.inpval but both shows P. It looks fine when see the field in Edit mode in Admin. Any idea? *My View* {{=form.custom.begin}} table tbody tr td class=w2p_fwlabelCover/label/td td class=w2p_fw : {{=form.custom.dspval.Cover}}/td /tr /table {{=form.custom.end}} My Model db.define_table('KR_Product', Field('ProductCode', length=15), Field('PartNumber', length=50), Field('Grade', length=1) ) db.KR_Product.Grade.requires=IS_IN_DB(db,'KR_GradeLabel.Name','%(Label)s') db.define_table('KR_GradeLabel', Field('Name', length=1), Field('Label', length=50), primarykey=['Name'] ) -- 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: form.custom.dspval and IS_IN_DB
I'm using 2.4.7 released 2013.05.24 so it could be bug and fixed now but I need to work on this version for now because I have issue with the latest web2py. Anyway, I found this https://groups.google.com/forum/#!searchin/web2py/IS_IN_DB$20readonly/web2py/uBBcvthCDl8/Z7s872JW47IJ and tried something db.KR_Product.Grade.represent = lambda Name: SPAN(db.KR_GradeLabel[Name].Label) but I got a error says type 'exceptions.AttributeError'('Table' object has no attribute 'P') Which P is the key value. And I want to shop P = Precision from another table. On Thursday, February 5, 2015 at 1:48:48 PM UTC-6, Omi Chiba wrote: I tried edit mode and put the following script in the view which works but feels so stupid and user cannot copy the values which I have to allow them top copy and paste. script jQuery(document).ready(function(){ jQuery('#main').find('input, select').attr(readonly, true); }); /script On Thursday, February 5, 2015 at 11:22:49 AM UTC-6, Omi Chiba wrote: In another word, it shows fine when I use {{=form.custom.widget.Grade}} with edit mode ( form = SQLFORM(db.KR_Product,record, readonly=False)) but not when I do readonly=True -- 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: form.custom.dspval and IS_IN_DB
I tried edit mode and put the following script in the view which works but feels so stupid and user cannot copy the values which I have to allow them top copy and paste. script jQuery(document).ready(function(){ jQuery('#main').find('input, select').attr(readonly, true); }); /script On Thursday, February 5, 2015 at 11:22:49 AM UTC-6, Omi Chiba wrote: In another word, it shows fine when I use {{=form.custom.widget.Grade}} with edit mode ( form = SQLFORM(db.KR_Product,record, readonly=False)) but not when I do readonly=True -- 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.
Re: [web2py] Re: form.custom.dspval and IS_IN_DB
Thank you for the reply. I'm not really sure how to use lamda. The problem is IS_IN_DB doesn't work when it's readonly and I found requires only works for Create/Edit and need to use represent for readonly view. I think this is a bug and should be it's already fixed but doen't matter to me because I'm stuck in my web2py version. So I'm trying to rewrite db.KR_Product.Grade.requires=IS_IN_DB(db,'KR_GradeLabel.Name','%(Label)s') for represent. I need to make this work In worst case, I need to lookup this KR_GradeLabel table in view using the value P and get the Label P = Precision On Thursday, February 5, 2015 at 2:23:09 PM UTC-6, Richard wrote: Omi, In this : db.KR_Product.Grade.represent = lambda Name: SPAN(db.KR_GradeLabel[Name].Label) I don't understand where you are going... You try to set a represent over table KR_Product for field Grade right? But you get you represent value from another table KR_GradeLabel... In case of a represent the lambda value is the field content for a given record... So you Name lambda passed variable may sure not containing what you think or want it contains... I don't see in your model definition that KR_Product.Grade to be actually a reference field... Model not saying so and field name neither... Richard On Thu, Feb 5, 2015 at 3:09 PM, Omi Chiba ochi...@gmail.com javascript: wrote: I'm using 2.4.7 released 2013.05.24 so it could be bug and fixed now but I need to work on this version for now because I have issue with the latest web2py. Anyway, I found this https://groups.google.com/forum/#!searchin/web2py/IS_IN_DB$20readonly/web2py/uBBcvthCDl8/Z7s872JW47IJ and tried something db.KR_Product.Grade.represent = lambda Name: SPAN(db.KR_GradeLabel[Name].Label) but I got a error says type 'exceptions.AttributeError'('Table' object has no attribute 'P') Which P is the key value. And I want to shop P = Precision from another table. On Thursday, February 5, 2015 at 1:48:48 PM UTC-6, Omi Chiba wrote: I tried edit mode and put the following script in the view which works but feels so stupid and user cannot copy the values which I have to allow them top copy and paste. script jQuery(document).ready(function(){ jQuery('#main').find('input, select').attr(readonly, true); }); /script On Thursday, February 5, 2015 at 11:22:49 AM UTC-6, Omi Chiba wrote: In another word, it shows fine when I use {{=form.custom.widget.Grade}} with edit mode ( form = SQLFORM(db.KR_Product,record, readonly=False)) but not when I do readonly=True -- 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+un...@googlegroups.com javascript:. For more options, visit https://groups.google.com/d/optout. -- 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: mssql connection URGENT!
Thank you for the reply. I found that that problem was why it doesn't accept IP Address instead of Named Instance and fixed the SQL Server configuration to use static IP to connect SQL Server. I can't connect to my servers SQL database via an IP Address http://dba.stackexchange.com/questions/62165/i-cant-connect-to-my-servers-sql-database-via-an-ip-address Problem Solved! On Monday, February 2, 2015 at 1:33:35 PM UTC-6, Massimo Di Pierro wrote: The problem is that since you did not specify a name for the .table files you get default (nobody does). default is a hash of the db uri so if you change it the .table files break. If this is just a change in the name but the tables are already in the database, the you should enable a fake_migration ( http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#migrate--fake_migrate) so that new .table files are created. If this is a new database, you need to enable migrations (I see they are disabled for you). Make sure you do not change the database schema until this is resolved else there is no way for me to tell in which state you db and your .table are. Massimo On Monday, 2 February 2015 08:29:23 UTC-6, Omi Chiba wrote: The below connection statement was working fine and the SQL Servers's instance was HELPDESK/HELPDESK. dbh = DAL(mssql2://username:password@HELPDESK/HS2000CS, migrate_enabled=False) Now, our vendor change the name of instance to HELPDESK/HELPDESK_VM. I tried, dbh = DAL(mssql2://username:password@[HELPDESK/HELPDESK_VM]/HS2000CS, migrate_enabled=False) dbh = DAL(mssql2://username:password@10.30.6.222/HS2000CS, migrate_enabled=False) SQL Server is in our local network and 10.30.6.222 is the local ip address. but both doesn't work. It's in production and I need to fix in a few hours. Please help! -- 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: Default value (Not in table) in Dropdown
Thanks. It worked great!!! On Monday, February 2, 2015 at 4:07:36 PM UTC-6, Niphlod wrote: that's pretty obvious. look at what you're trying to render in the view! {{for model in models:}} option value={{=model.Name}} {{= selected='selected' if model.Name==request.vars.model_name else }} {{=model.Name}} /option {{pass}} at the very least, if you want to keep the same code in the view, you should have the controller pass a list with a Storage() that has a Name attribute from gluon.storage import Storage models = [ Storage(Name='SELECT Model') ] -- 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] Default value (Not in table) in Dropdown
For example, I have a list models table and build a dropdown list from it but I want dropdown show something like SELECT Model, then pick the model. I don't want to register the SELECT Model record in table. What's the easiest and clean way to do? I have 5 drop down list so ideally when I change the first dropdown, other 4 should show SELECT on the dropdown's default. *my controller* models = db().select(db.KR_Model.ALL) *my view* tdselect name='model_name' {{for model in models:}} option value={{=model.Name}} {{= selected='selected' if model.Name==request.vars.model_name else }} {{=model.Name}} /option {{pass}} /select/td -- 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: mssql connection URGENT!
Thanks! On Monday, February 2, 2015 at 3:06:05 PM UTC-6, Niphlod wrote: uhm. Technically having more than one instance of mssql running on the same ip is possible (multiple named instances) but it involves a totally different connection handshake. If you don't specify different port numbers, you can still have them dynamic but you have to resort to have SQL Server Browser running on the server and specifying a connection using the odbc connectionstring notation (mssql://{Driver={SQL Server};Server=hostname\instancename;..}), that will trigger that new handshakeeverything works fine, I use it every day. -- 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: Default value (Not in table) in Dropdown
In my controller, can I just add the default value in controller something like below? If possible, this is the easiest one for me. Though I will get error I do this. *controller* if request.vars.model_name: models = db(db.KR_Lead.ModelName == request.vars.model_name).select(db.KR_Lead.ALL) else: *models = 'SELECT Model'* Error: type 'exceptions.AttributeError'('str' object has no attribute 'Name') On Monday, February 2, 2015 at 3:38:11 PM UTC-6, Niphlod wrote: building it by hand kinda slows things down a lot (boilerplate alert). Thankfully, we all know HTML, but bring! Having a widget displaying a default value (that won't get accepted) is pretty damn easy with IS_IN_SET(..., zero='choose me...') with html and the requirement of no added validation (both serverside or javascript), you can only do selectoption selected disabledchoose one/optionoption value=1 /option/select i.e. make the first option selected AND disabled. It will show up but the user won't be able to transmit it as part of the form, not even in javascript (val() of this select would be *null*) -- 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] mssql connection URGENT!
The below connection statement was working fine and the SQL Servers's instance was HELPDESK/HELPDESK. dbh = DAL(mssql2://username:password@HELPDESK/HS2000CS, migrate_enabled=False) Now, our vendor change the name of instance to HELPDESK/HELPDESK_VM. I tried, dbh = DAL(mssql2://username:password@[HELPDESK/HELPDESK_VM]/HS2000CS, migrate_enabled=False) dbh = DAL(mssql2://username:password@10.30.6.222/HS2000CS, migrate_enabled=False) SQL Server is in our local network and 10.30.6.222 is the local ip address. but both doesn't work. It's in production and I need to fix in a few hours. Please help! -- 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.
Re: [web2py] Re: represents currency format
I got this error... type 'exceptions.TypeError'(lambda() takes exactly 2 arguments (1 given)) Render also looks complicated to me so I will just use the JS Massimo suugested. Thank you both!! On Monday, January 26, 2015 at 6:01:08 PM UTC-6, Niphlod wrote: in the view, you have td style=text-align: right;{{=list.UnitPrice}}/td use instead td style=text-align: right;{{=db.KR_Product.UnitPrice.represent(list.UnitPrice)}}/td should work without issues. or read about render() here http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Rendering-rows-using-represent -- 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.
Re: [web2py] Re: Dropdown lists
Thank you for your feedback! I found onchange=jQuery('#model_name').empty(); this is unnecessary operation for my purpose so it's removed! On Tue, Jan 27, 2015 at 11:19 AM, Derek sp1d...@gmail.com wrote: What I mean by 'you are mixing your view with your controller' is that you are using your controller to build HTML that will be used as-is. You should never create HTML in your controllers, leave that to the views. The whole point of MVC is that each part has a very specific purpose. Don't create your models in your controllers or views, don't create html in your models or controllers, and don't put logic in models and views. https://www.youtube.com/watch?v=8FWdQVNeTlI On Tuesday, January 27, 2015 at 10:15:50 AM UTC-7, Derek wrote: Well, where do I start? It looks like you are a victim of copy and paste coding. Delete your two functions and start over again. That said, you are mixing your view with your controller, please don't do that. I would suggest you use this web2pyslice as a starting point. (yes, I wrote it) http://www.web2pyslices.com/slice/show/1724/cascading- dropdowns-simplified On Monday, January 26, 2015 at 1:28:20 PM UTC-7, Omi Chiba wrote: I have a three dropdown and the value will be dynamically changed using ajax. It's working fine but something is wrong. In second dropdown (id=lead_name), I specify jQuery('#model_name') but it's actually jQuery('#leadl_name') but then when the value for the second drop changed, the value disappear from the second and third. When I keep the current way (which is wrong name) it's working as expected Do you guys know what's wrong? This is my view form enctype=multipart/form-data action={{URL()}} method=post tr tdselect name='model_name' onchange=jQuery( '#model_name').empty(); ajax('lead_ajax', ['model_name'], 'lead_name'); {{for model in models:}} option value={{=model.Name}} {{= selected='selected' if str(model.Name)= =request.vars.model_name else }} {{=model.Name}} /option {{pass}} /select/td tdselect id='lead_name' name='lead_name' onchange= jQuery('#model_name').empty(); ajax('block_ajax', ['lead_name'], 'block_name'); {{for lead in leads:}} option value={{=lead.Name}} {{= selected='selected' if str(lead.Name)= =request.vars.lead_name else }} {{=lead.Name}} /option {{pass}} /select/td tdselect id='block_name' name='block_name' {{for block in blocks:}} option value={{=block.Name}} {{= selected='selected' if str(block.Name)= =request.vars.block_name else }} {{=block.Name}} /option {{pass}} /select/td td/td td/td tdinput type=submit value='Submit'/td /tr /form My controller def index(): response.title='KR Quick Delivery Service' if request.vars.model_name: lists = db((db.KR_Product.Model==request.vars.model_name) (db. KR_Product.Lead==request.vars.lead_name) (db.KR_Product.Block==request .vars.block_name)).select(db.KR_Product.ALL) else: lists='' models = db().select(db.KR_Model.ALL) leads = db(db.KR_Lead.ModelName == '20').select(db.KR_Lead.ALL) blocks = db(db.KR_Block.LeadName == '01').select(db.KR_Block.ALL) return dict(lists=lists,models=models,leads=leads,blocks=blocks) def lead_ajax(): leads = db(db.KR_Lead.ModelName==request.vars.model_name).select(db. KR_Lead.ALL) result = '' for lead in leads: result += option value=' + lead.Name + ' + lead.Name + /option return XML(result) def block_ajax(): blocks = db(db.KR_Block.LeadName==request.vars.lead_name).select(db. KR_Block.ALL) result = '' for block in blocks: result += option value=' + block.Name + ' + block.Name + /option return XML(result) -- 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/ZnZtTw-HXFc/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/d/optout. -- Resources: - http://web2py.com - http
[web2py] Dropdown lists
I have a three dropdown and the value will be dynamically changed using ajax. It's working fine but something is wrong. In second dropdown (id=lead_name), I specify jQuery('#model_name') but it's actually jQuery('#leadl_name') but then when the value for the second drop changed, the value disappear from the second and third. When I keep the current way (which is wrong name) it's working as expected Do you guys know what's wrong? This is my view form enctype=multipart/form-data action={{URL()}} method=post tr tdselect name='model_name' onchange=jQuery('#model_name' ).empty(); ajax('lead_ajax', ['model_name'], 'lead_name'); {{for model in models:}} option value={{=model.Name}} {{= selected='selected' if str(model.Name)= =request.vars.model_name else }} {{=model.Name}} /option {{pass}} /select/td tdselect id='lead_name' name='lead_name' onchange=jQuery ('#model_name').empty(); ajax('block_ajax', ['lead_name'], 'block_name'); {{for lead in leads:}} option value={{=lead.Name}} {{= selected='selected' if str(lead.Name)= =request.vars.lead_name else }} {{=lead.Name}} /option {{pass}} /select/td tdselect id='block_name' name='block_name' {{for block in blocks:}} option value={{=block.Name}} {{= selected='selected' if str(block.Name)= =request.vars.block_name else }} {{=block.Name}} /option {{pass}} /select/td td/td td/td tdinput type=submit value='Submit'/td /tr /form My controller def index(): response.title='KR Quick Delivery Service' if request.vars.model_name: lists = db((db.KR_Product.Model==request.vars.model_name) (db. KR_Product.Lead==request.vars.lead_name) (db.KR_Product.Block==request. vars.block_name)).select(db.KR_Product.ALL) else: lists='' models = db().select(db.KR_Model.ALL) leads = db(db.KR_Lead.ModelName == '20').select(db.KR_Lead.ALL) blocks = db(db.KR_Block.LeadName == '01').select(db.KR_Block.ALL) return dict(lists=lists,models=models,leads=leads,blocks=blocks) def lead_ajax(): leads = db(db.KR_Lead.ModelName==request.vars.model_name).select(db. KR_Lead.ALL) result = '' for lead in leads: result += option value=' + lead.Name + ' + lead.Name + /option return XML(result) def block_ajax(): blocks = db(db.KR_Block.LeadName==request.vars.lead_name).select(db. KR_Block.ALL) result = '' for block in blocks: result += option value=' + block.Name + ' + block.Name + /option return XML(result) -- 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.
Re: [web2py] Re: represents currency format
Can you give me more details? I'm not sure if directly call it from view or controller. I apprecite if you can provide a sample code with the following. db.KR_Product.UnitPrice.represent = lambda value, row: '$ %.2f' % (0.0 if value == None else value) On Mon, Jan 26, 2015 at 4:56 PM, Niphlod niph...@gmail.com wrote: if you're not using web2py's facilities (SQLTABLE, grid, rows.render(), etc), you have to call represent directly {{=db.KR_Product.UnitPrice.represent(list.UnitPrice)}} On Monday, January 26, 2015 at 11:39:07 PM UTC+1, Omi Chiba wrote: I want to show the UnitPrice like $1,000,00 but it shows 1000.00. *Model* db.define_table('KR_Product', Field('ProductCode', length=15), Field('PartNumber', length=50), Field('SubA', length=15), Field('SubB', length=15), Field('UnitPrice', 'decimal(18,2)'), Field('Quantity', 'decimal(18,0)'), Field('Weight', 'decimal(18,3)'), Field('LeadTime', length=50), Field('Model', length=2), Field('Lead', length=2), Field('Block', length=1), Field('Stroke', length=4), Field('Grade', length=1), Field('Cover', length=1), Field('Sensor', length=1), Field('Housing', length=1), Field('Flange', length=1), Field('Description', length=500) ) db.KR_Product.UnitPrice.represent = lambda value, row: '$ %.2f' % (0.0 if value == None else value) *View* div id=container div id=wrapper table class=table table-hover thead thPart Number/th thLead Time/th th style=text-align: right;span class='right'Quantity/th th style=text-align: right;span class='right'Unit Price($)/th th style=text-align: right;span class='right'Weight(kg)/th /thead tbody {{for list in lists:}} tr td{{=list.PartNumber}}/td td{{=list.LeadTime}}/td td style=text-align: right;{{=list.Quantity}}/td td style=text-align: right;{{=list.UnitPrice}}/td td style=text-align: right;{{=list.Weight}}/td /tr {{pass}} /tbody /table /div /div -- 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/bJHpQE5O74g/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/d/optout. -- 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] represents currency format
I want to show the UnitPrice like $1,000,00 but it shows 1000.00. *Model* db.define_table('KR_Product', Field('ProductCode', length=15), Field('PartNumber', length=50), Field('SubA', length=15), Field('SubB', length=15), Field('UnitPrice', 'decimal(18,2)'), Field('Quantity', 'decimal(18,0)'), Field('Weight', 'decimal(18,3)'), Field('LeadTime', length=50), Field('Model', length=2), Field('Lead', length=2), Field('Block', length=1), Field('Stroke', length=4), Field('Grade', length=1), Field('Cover', length=1), Field('Sensor', length=1), Field('Housing', length=1), Field('Flange', length=1), Field('Description', length=500) ) db.KR_Product.UnitPrice.represent = lambda value, row: '$ %.2f' % (0.0 if value == None else value) *View* div id=container div id=wrapper table class=table table-hover thead thPart Number/th thLead Time/th th style=text-align: right;span class='right'Quantity/th th style=text-align: right;span class='right'Unit Price($)/th th style=text-align: right;span class='right'Weight(kg)/th /thead tbody {{for list in lists:}} tr td{{=list.PartNumber}}/td td{{=list.LeadTime}}/td td style=text-align: right;{{=list.Quantity}}/td td style=text-align: right;{{=list.UnitPrice}}/td td style=text-align: right;{{=list.Weight}}/td /tr {{pass}} /tbody /table /div /div -- 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.
Re: [web2py] Re: HELP!! Another upgrading failed for Apache running web2py
Massimo, Thank you for looking into the problem. Your office is a little bit far for me but maybe we can work remotely. It's hosting server so I can give you login info and we can use google hangout chat or something The server is live but only few people access the website so we can bring down the web2py anytime we want. IP Address: 192.30.163.156 Username: vps18276\vps18276admin Password: 3a17f9985c! Web2py Password: 3a17f9985c The running website is http://thksupport.com and currently running with web2py 2.4.7. I'm available anytime, so just let me know when you're available. Also, you can remote access the server without telling me I trust you so it's OK. On Fri, Jan 23, 2015 at 4:18 PM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Want to stop by my office next week? I'd like to take a look. On Friday, 23 January 2015 15:02:21 UTC-6, Omi Chiba wrote: OK, so I can fix this TypeError: can't pickle function objects error by the solution described here. (Adding AllowOverride None in apache config file https://groups.google.com/forum/#!searchin/web2py/apache$20pickle/web2py/ UYqS8nIkeQY/ib8Vjshs7JEJ This solve one problem! So I don't have any problem with web2py 2.4.7 right now, I was hoping this also solve the problem with 2.9.12 but it doesn't. I got a same error. The ticket mentioned in the linked forum post is still opened, https://code.google.com/p/web2py/issues/detail?id=1655 So I think this is related issue which is not solved yet. On Friday, January 23, 2015 at 10:05:06 AM UTC-6, Omi Chiba wrote: I mean file is created anyway. It's just a error ticket File C:\Python27\Lib\copy_reg.py, line 70, in _reduce_ex raise TypeError, can't pickle %s objects % base.__name__ TypeError: can't pickle function objects On Friday, January 23, 2015 at 9:26:18 AM UTC-6, Omi Chiba wrote: Um... more weird things. I'm using version 2.4.7 now and I got a similar error when I try to create view. Versionweb2py™Version 2.4.7-stable+timestamp.2013.05.24.17.48.47PythonPython 2.7.4: C:\UniServer\usr\local\apache2\bin\Apache.exe (prefix: C:\Python27)Traceback 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. Traceback (most recent call last): File C:\web2py\gluon\main.py, line 606, in wsgibase session._try_store_in_cookie_or_file(request, response) File C:\web2py\gluon\globals.py, line 757, in _try_store_in_cookie_or_file self._try_store_in_file(request, response) File C:\web2py\gluon\globals.py, line 763, in _try_store_in_file if not response.session_id or self._forget or self._unchanged(): File C:\web2py\gluon\globals.py, line 719, in _unchanged session_pickled = cPickle.dumps(dict(self)) File C:\Python27\Lib\copy_reg.py, line 70, in _reduce_ex raise TypeError, can't pickle %s objects % base.__name__ TypeError: can't pickle function objects On Friday, January 23, 2015 at 8:54:23 AM UTC-6, Omi Chiba wrote: Yes. I stop and start apache when I replace web2py folder. After trouble shooting I found 1. http://thksupport.com/welcome/default/index = OK 2. https://thksupport.com/welcome/default/index = NG 3. https://thksupport.com/admin/default/index = NG So any https request become NG for the same error Then, Restart Apache server 1. http://thksupport.com/welcome/default/index = NG 2. https://thksupport.com/welcome/default/index = OK 3. https://thksupport.com/admin/default/index = OK Now all http request become error!! Then, Restart Apache server Again... all https request become error. Previous version (2.4.6) is working fine both http and https no problem. On Thursday, January 22, 2015 at 11:21:49 PM UTC-6, Massimo Di Pierro wrote: Did you restart the web server? I do not think this has anything to do with cookies. This has to do with pickle being None and it cannot be because it is clearly imported. Something very bad happened to your import. Make sure you stop and start again the web server. If you use mod_proxy also stop and start python. On Thursday, 22 January 2015 17:27:00 UTC-6, Omi Chiba wrote: Please see my quick test result below. I'm not sure if it's related to sessions and/or cookies because I always failed when I access with https. 1st test 1. delete all the cookie on my browser and delete sessions from all the app. 2. open the website = display welcome app = ok 3. tried to access admin app with https = NG (Same error ticket.) 2nd test 1. delete all the cookie on my browser and delete sessions from all the app. 2. tried to access admin app with https = NG (Same error ticket.) 3rd Test 1. delete all the cookie on my browser and delete sessions from all the app. 2. Open browser incognito mode 3. open the website = display welcome app = ok 4. tried to access admin app with https = NG (Same error ticket.) On Thu, Jan 22, 2015 at 5:02 PM, Massimo Di Pierro massimo@gmail.com wrote: I am pretty sure that is what web2py
Re: [web2py] Re: HELP!! Another upgrading failed for Apache running web2py
OK, so I can fix this TypeError: can't pickle function objects error by the solution described here. (Adding AllowOverride None in apache config file https://groups.google.com/forum/#!searchin/web2py/apache$20pickle/web2py/UYqS8nIkeQY/ib8Vjshs7JEJ This solve one problem! So I don't have any problem with web2py 2.4.7 right now, I was hoping this also solve the problem with 2.9.12 but it doesn't. I got a same error. The ticket mentioned in the linked forum post is still opened, https://code.google.com/p/web2py/issues/detail?id=1655 So I think this is related issue which is not solved yet. On Friday, January 23, 2015 at 10:05:06 AM UTC-6, Omi Chiba wrote: I mean file is created anyway. It's just a error ticket File C:\Python27\Lib\copy_reg.py, line 70, in _reduce_ex raise TypeError, can't pickle %s objects % base.__name__ TypeError: can't pickle function objects On Friday, January 23, 2015 at 9:26:18 AM UTC-6, Omi Chiba wrote: Um... more weird things. I'm using version 2.4.7 now and I got a similar error when I try to create view. Versionweb2py™Version 2.4.7-stable+timestamp.2013.05.24.17.48.47PythonPython 2.7.4: C:\UniServer\usr\local\apache2\bin\Apache.exe (prefix: C:\Python27) Traceback 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. Traceback (most recent call last): File C:\web2py\gluon\main.py, line 606, in wsgibase session._try_store_in_cookie_or_file(request, response) File C:\web2py\gluon\globals.py, line 757, in _try_store_in_cookie_or_file self._try_store_in_file(request, response) File C:\web2py\gluon\globals.py, line 763, in _try_store_in_file if not response.session_id or self._forget or self._unchanged(): File C:\web2py\gluon\globals.py, line 719, in _unchanged session_pickled = cPickle.dumps(dict(self)) File C:\Python27\Lib\copy_reg.py, line 70, in _reduce_ex raise TypeError, can't pickle %s objects % base.__name__ TypeError: can't pickle function objects On Friday, January 23, 2015 at 8:54:23 AM UTC-6, Omi Chiba wrote: Yes. I stop and start apache when I replace web2py folder. After trouble shooting I found 1. http://thksupport.com/welcome/default/index = OK 2. https://thksupport.com/welcome/default/index = NG 3. https://thksupport.com/admin/default/index = NG So any https request become NG for the same error Then, Restart Apache server 1. http://thksupport.com/welcome/default/index = NG 2. https://thksupport.com/welcome/default/index = OK 3. https://thksupport.com/admin/default/index = OK Now all http request become error!! Then, Restart Apache server Again... all https request become error. Previous version (2.4.6) is working fine both http and https no problem. On Thursday, January 22, 2015 at 11:21:49 PM UTC-6, Massimo Di Pierro wrote: Did you restart the web server? I do not think this has anything to do with cookies. This has to do with pickle being None and it cannot be because it is clearly imported. Something very bad happened to your import. Make sure you stop and start again the web server. If you use mod_proxy also stop and start python. On Thursday, 22 January 2015 17:27:00 UTC-6, Omi Chiba wrote: Please see my quick test result below. I'm not sure if it's related to sessions and/or cookies because I always failed when I access with https. 1st test 1. delete all the cookie on my browser and delete sessions from all the app. 2. open the website = display welcome app = ok 3. tried to access admin app with https = NG (Same error ticket.) 2nd test 1. delete all the cookie on my browser and delete sessions from all the app. 2. tried to access admin app with https = NG (Same error ticket.) 3rd Test 1. delete all the cookie on my browser and delete sessions from all the app. 2. Open browser incognito mode 3. open the website = display welcome app = ok 4. tried to access admin app with https = NG (Same error ticket.) On Thu, Jan 22, 2015 at 5:02 PM, Massimo Di Pierro massimo@gmail.com wrote: I am pretty sure that is what web2py does. If sessions are deleted the cookie is ignored. Are these session in cookies? On Thursday, 22 January 2015 11:35:56 UTC-6, Leonel Câmara wrote: Basically you have an old cookie in your browser that's messing things up. Obviously it's also a bug with web2py as it should just discard it if it doesn't have a file for it anymore. But you should be good if you clear your browser cookies and the sessions in the apps. -- 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/yBM8Ybl_xGA/unsubscribe. To unsubscribe from this group and all its topics
Re: [web2py] Re: HELP!! Another upgrading failed for Apache running web2py
Please delete my previous forum post from your emails : ) On Friday, January 23, 2015 at 4:18:03 PM UTC-6, Massimo Di Pierro wrote: Want to stop by my office next week? I'd like to take a look. On Friday, 23 January 2015 15:02:21 UTC-6, Omi Chiba wrote: OK, so I can fix this TypeError: can't pickle function objects error by the solution described here. (Adding AllowOverride None in apache config file https://groups.google.com/forum/#!searchin/web2py/apache$20pickle/web2py/UYqS8nIkeQY/ib8Vjshs7JEJ This solve one problem! So I don't have any problem with web2py 2.4.7 right now, I was hoping this also solve the problem with 2.9.12 but it doesn't. I got a same error. The ticket mentioned in the linked forum post is still opened, https://code.google.com/p/web2py/issues/detail?id=1655 So I think this is related issue which is not solved yet. On Friday, January 23, 2015 at 10:05:06 AM UTC-6, Omi Chiba wrote: I mean file is created anyway. It's just a error ticket File C:\Python27\Lib\copy_reg.py, line 70, in _reduce_ex raise TypeError, can't pickle %s objects % base.__name__ TypeError: can't pickle function objects On Friday, January 23, 2015 at 9:26:18 AM UTC-6, Omi Chiba wrote: Um... more weird things. I'm using version 2.4.7 now and I got a similar error when I try to create view. Versionweb2py™Version 2.4.7-stable+timestamp.2013.05.24.17.48.47PythonPython 2.7.4: C:\UniServer\usr\local\apache2\bin\Apache.exe (prefix: C:\Python27) Traceback 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. Traceback (most recent call last): File C:\web2py\gluon\main.py, line 606, in wsgibase session._try_store_in_cookie_or_file(request, response) File C:\web2py\gluon\globals.py, line 757, in _try_store_in_cookie_or_file self._try_store_in_file(request, response) File C:\web2py\gluon\globals.py, line 763, in _try_store_in_file if not response.session_id or self._forget or self._unchanged(): File C:\web2py\gluon\globals.py, line 719, in _unchanged session_pickled = cPickle.dumps(dict(self)) File C:\Python27\Lib\copy_reg.py, line 70, in _reduce_ex raise TypeError, can't pickle %s objects % base.__name__ TypeError: can't pickle function objects On Friday, January 23, 2015 at 8:54:23 AM UTC-6, Omi Chiba wrote: Yes. I stop and start apache when I replace web2py folder. After trouble shooting I found 1. http://thksupport.com/welcome/default/index = OK 2. https://thksupport.com/welcome/default/index = NG 3. https://thksupport.com/admin/default/index = NG So any https request become NG for the same error Then, Restart Apache server 1. http://thksupport.com/welcome/default/index = NG 2. https://thksupport.com/welcome/default/index = OK 3. https://thksupport.com/admin/default/index = OK Now all http request become error!! Then, Restart Apache server Again... all https request become error. Previous version (2.4.6) is working fine both http and https no problem. On Thursday, January 22, 2015 at 11:21:49 PM UTC-6, Massimo Di Pierro wrote: Did you restart the web server? I do not think this has anything to do with cookies. This has to do with pickle being None and it cannot be because it is clearly imported. Something very bad happened to your import. Make sure you stop and start again the web server. If you use mod_proxy also stop and start python. On Thursday, 22 January 2015 17:27:00 UTC-6, Omi Chiba wrote: Please see my quick test result below. I'm not sure if it's related to sessions and/or cookies because I always failed when I access with https. 1st test 1. delete all the cookie on my browser and delete sessions from all the app. 2. open the website = display welcome app = ok 3. tried to access admin app with https = NG (Same error ticket.) 2nd test 1. delete all the cookie on my browser and delete sessions from all the app. 2. tried to access admin app with https = NG (Same error ticket.) 3rd Test 1. delete all the cookie on my browser and delete sessions from all the app. 2. Open browser incognito mode 3. open the website = display welcome app = ok 4. tried to access admin app with https = NG (Same error ticket.) On Thu, Jan 22, 2015 at 5:02 PM, Massimo Di Pierro massimo@gmail.com wrote: I am pretty sure that is what web2py does. If sessions are deleted the cookie is ignored. Are these session in cookies? On Thursday, 22 January 2015 11:35:56 UTC-6, Leonel Câmara wrote: Basically you have an old cookie in your browser that's messing things up. Obviously it's also a bug with web2py as it should just discard it if it doesn't have a file for it anymore. But you should be good if you clear your browser cookies and the sessions in the apps. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list
Re: [web2py] Re: HELP!! Another upgrading failed for Apache running web2py
Yes. I stop and start apache when I replace web2py folder. After trouble shooting I found 1. http://thksupport.com/welcome/default/index = OK 2. https://thksupport.com/welcome/default/index = NG 3. https://thksupport.com/admin/default/index = NG So any https request become NG for the same error Then, Restart Apache server 1. http://thksupport.com/welcome/default/index = NG 2. https://thksupport.com/welcome/default/index = OK 3. https://thksupport.com/admin/default/index = OK Now all http request become error!! Then, Restart Apache server Again... all https request become error. Previous version (2.4.6) is working fine both http and https no problem. On Thursday, January 22, 2015 at 11:21:49 PM UTC-6, Massimo Di Pierro wrote: Did you restart the web server? I do not think this has anything to do with cookies. This has to do with pickle being None and it cannot be because it is clearly imported. Something very bad happened to your import. Make sure you stop and start again the web server. If you use mod_proxy also stop and start python. On Thursday, 22 January 2015 17:27:00 UTC-6, Omi Chiba wrote: Please see my quick test result below. I'm not sure if it's related to sessions and/or cookies because I always failed when I access with https. 1st test 1. delete all the cookie on my browser and delete sessions from all the app. 2. open the website = display welcome app = ok 3. tried to access admin app with https = NG (Same error ticket.) 2nd test 1. delete all the cookie on my browser and delete sessions from all the app. 2. tried to access admin app with https = NG (Same error ticket.) 3rd Test 1. delete all the cookie on my browser and delete sessions from all the app. 2. Open browser incognito mode 3. open the website = display welcome app = ok 4. tried to access admin app with https = NG (Same error ticket.) On Thu, Jan 22, 2015 at 5:02 PM, Massimo Di Pierro massimo@gmail.com javascript: wrote: I am pretty sure that is what web2py does. If sessions are deleted the cookie is ignored. Are these session in cookies? On Thursday, 22 January 2015 11:35:56 UTC-6, Leonel Câmara wrote: Basically you have an old cookie in your browser that's messing things up. Obviously it's also a bug with web2py as it should just discard it if it doesn't have a file for it anymore. But you should be good if you clear your browser cookies and the sessions in the apps. -- 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/yBM8Ybl_xGA/unsubscribe. To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com javascript:. For more options, visit https://groups.google.com/d/optout. -- 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.
Re: [web2py] Re: HELP!! Another upgrading failed for Apache running web2py
Um... more weird things. I'm using version 2.4.7 now and I got a similar error when I try to create view. Versionweb2py™Version 2.4.7-stable+timestamp.2013.05.24.17.48.47PythonPython 2.7.4: C:\UniServer\usr\local\apache2\bin\Apache.exe (prefix: C:\Python27) Traceback 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. Traceback (most recent call last): File C:\web2py\gluon\main.py, line 606, in wsgibase session._try_store_in_cookie_or_file(request, response) File C:\web2py\gluon\globals.py, line 757, in _try_store_in_cookie_or_file self._try_store_in_file(request, response) File C:\web2py\gluon\globals.py, line 763, in _try_store_in_file if not response.session_id or self._forget or self._unchanged(): File C:\web2py\gluon\globals.py, line 719, in _unchanged session_pickled = cPickle.dumps(dict(self)) File C:\Python27\Lib\copy_reg.py, line 70, in _reduce_ex raise TypeError, can't pickle %s objects % base.__name__ TypeError: can't pickle function objects On Friday, January 23, 2015 at 8:54:23 AM UTC-6, Omi Chiba wrote: Yes. I stop and start apache when I replace web2py folder. After trouble shooting I found 1. http://thksupport.com/welcome/default/index = OK 2. https://thksupport.com/welcome/default/index = NG 3. https://thksupport.com/admin/default/index = NG So any https request become NG for the same error Then, Restart Apache server 1. http://thksupport.com/welcome/default/index = NG 2. https://thksupport.com/welcome/default/index = OK 3. https://thksupport.com/admin/default/index = OK Now all http request become error!! Then, Restart Apache server Again... all https request become error. Previous version (2.4.6) is working fine both http and https no problem. On Thursday, January 22, 2015 at 11:21:49 PM UTC-6, Massimo Di Pierro wrote: Did you restart the web server? I do not think this has anything to do with cookies. This has to do with pickle being None and it cannot be because it is clearly imported. Something very bad happened to your import. Make sure you stop and start again the web server. If you use mod_proxy also stop and start python. On Thursday, 22 January 2015 17:27:00 UTC-6, Omi Chiba wrote: Please see my quick test result below. I'm not sure if it's related to sessions and/or cookies because I always failed when I access with https. 1st test 1. delete all the cookie on my browser and delete sessions from all the app. 2. open the website = display welcome app = ok 3. tried to access admin app with https = NG (Same error ticket.) 2nd test 1. delete all the cookie on my browser and delete sessions from all the app. 2. tried to access admin app with https = NG (Same error ticket.) 3rd Test 1. delete all the cookie on my browser and delete sessions from all the app. 2. Open browser incognito mode 3. open the website = display welcome app = ok 4. tried to access admin app with https = NG (Same error ticket.) On Thu, Jan 22, 2015 at 5:02 PM, Massimo Di Pierro massimo@gmail.com wrote: I am pretty sure that is what web2py does. If sessions are deleted the cookie is ignored. Are these session in cookies? On Thursday, 22 January 2015 11:35:56 UTC-6, Leonel Câmara wrote: Basically you have an old cookie in your browser that's messing things up. Obviously it's also a bug with web2py as it should just discard it if it doesn't have a file for it anymore. But you should be good if you clear your browser cookies and the sessions in the apps. -- 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/yBM8Ybl_xGA/unsubscribe. To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- 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.
Re: [web2py] Re: HELP!! Another upgrading failed for Apache running web2py
I mean file is created anyway. It's just a error ticket File C:\Python27\Lib\copy_reg.py, line 70, in _reduce_ex raise TypeError, can't pickle %s objects % base.__name__ TypeError: can't pickle function objects On Friday, January 23, 2015 at 9:26:18 AM UTC-6, Omi Chiba wrote: Um... more weird things. I'm using version 2.4.7 now and I got a similar error when I try to create view. Versionweb2py™Version 2.4.7-stable+timestamp.2013.05.24.17.48.47PythonPython 2.7.4: C:\UniServer\usr\local\apache2\bin\Apache.exe (prefix: C:\Python27) Traceback 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. Traceback (most recent call last): File C:\web2py\gluon\main.py, line 606, in wsgibase session._try_store_in_cookie_or_file(request, response) File C:\web2py\gluon\globals.py, line 757, in _try_store_in_cookie_or_file self._try_store_in_file(request, response) File C:\web2py\gluon\globals.py, line 763, in _try_store_in_file if not response.session_id or self._forget or self._unchanged(): File C:\web2py\gluon\globals.py, line 719, in _unchanged session_pickled = cPickle.dumps(dict(self)) File C:\Python27\Lib\copy_reg.py, line 70, in _reduce_ex raise TypeError, can't pickle %s objects % base.__name__ TypeError: can't pickle function objects On Friday, January 23, 2015 at 8:54:23 AM UTC-6, Omi Chiba wrote: Yes. I stop and start apache when I replace web2py folder. After trouble shooting I found 1. http://thksupport.com/welcome/default/index = OK 2. https://thksupport.com/welcome/default/index = NG 3. https://thksupport.com/admin/default/index = NG So any https request become NG for the same error Then, Restart Apache server 1. http://thksupport.com/welcome/default/index = NG 2. https://thksupport.com/welcome/default/index = OK 3. https://thksupport.com/admin/default/index = OK Now all http request become error!! Then, Restart Apache server Again... all https request become error. Previous version (2.4.6) is working fine both http and https no problem. On Thursday, January 22, 2015 at 11:21:49 PM UTC-6, Massimo Di Pierro wrote: Did you restart the web server? I do not think this has anything to do with cookies. This has to do with pickle being None and it cannot be because it is clearly imported. Something very bad happened to your import. Make sure you stop and start again the web server. If you use mod_proxy also stop and start python. On Thursday, 22 January 2015 17:27:00 UTC-6, Omi Chiba wrote: Please see my quick test result below. I'm not sure if it's related to sessions and/or cookies because I always failed when I access with https. 1st test 1. delete all the cookie on my browser and delete sessions from all the app. 2. open the website = display welcome app = ok 3. tried to access admin app with https = NG (Same error ticket.) 2nd test 1. delete all the cookie on my browser and delete sessions from all the app. 2. tried to access admin app with https = NG (Same error ticket.) 3rd Test 1. delete all the cookie on my browser and delete sessions from all the app. 2. Open browser incognito mode 3. open the website = display welcome app = ok 4. tried to access admin app with https = NG (Same error ticket.) On Thu, Jan 22, 2015 at 5:02 PM, Massimo Di Pierro massimo@gmail.com wrote: I am pretty sure that is what web2py does. If sessions are deleted the cookie is ignored. Are these session in cookies? On Thursday, 22 January 2015 11:35:56 UTC-6, Leonel Câmara wrote: Basically you have an old cookie in your browser that's messing things up. Obviously it's also a bug with web2py as it should just discard it if it doesn't have a file for it anymore. But you should be good if you clear your browser cookies and the sessions in the apps. -- 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/yBM8Ybl_xGA/unsubscribe. To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- 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: HELP!! Another upgrading failed for Apache running web2py
I just bring the customized app I crated so admin app is from the latest download. No change. Today, I tried fresh install. Download the latest source and run using apache and got the exact same error! So it means the lates web2py doesn't work with apache via wsgi hadler. I need this fixed ASAP. See attached. On Wednesday, January 21, 2015 at 3:42:41 PM UTC-6, Leonel Câmara wrote: Yes, clear for all the apps including admin. Has the admin application been updated too for the new version? -- 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.
Re: [web2py] Re: HELP!! Another upgrading failed for Apache running web2py
Please see my quick test result below. I'm not sure if it's related to sessions and/or cookies because I always failed when I access with https. 1st test 1. delete all the cookie on my browser and delete sessions from all the app. 2. open the website = display welcome app = ok 3. tried to access admin app with https = NG (Same error ticket.) 2nd test 1. delete all the cookie on my browser and delete sessions from all the app. 2. tried to access admin app with https = NG (Same error ticket.) 3rd Test 1. delete all the cookie on my browser and delete sessions from all the app. 2. Open browser incognito mode 3. open the website = display welcome app = ok 4. tried to access admin app with https = NG (Same error ticket.) On Thu, Jan 22, 2015 at 5:02 PM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: I am pretty sure that is what web2py does. If sessions are deleted the cookie is ignored. Are these session in cookies? On Thursday, 22 January 2015 11:35:56 UTC-6, Leonel Câmara wrote: Basically you have an old cookie in your browser that's messing things up. Obviously it's also a bug with web2py as it should just discard it if it doesn't have a file for it anymore. But you should be good if you clear your browser cookies and the sessions in the apps. -- 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/yBM8Ybl_xGA/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/d/optout. -- 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: HELP!! Another upgrading failed for Apache running web2py
Thank you. I posted a ticket for this. https://code.google.com/p/web2py/issues/detail?id=2036 Even I delete session, cookies, hittp or https will get error so the website is useless. I will postpone my upgrade until this fix. On Thursday, January 22, 2015 at 11:35:56 AM UTC-6, Leonel Câmara wrote: Basically you have an old cookie in your browser that's messing things up. Obviously it's also a bug with web2py as it should just discard it if it doesn't have a file for it anymore. But you should be good if you clear your browser cookies and the sessions in the apps. -- 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.
Re: [web2py] Re: HELP!! Another upgrading failed for Apache running web2py
It works!!! and now I can access with or without incognito mode... but why?? Is this temporarly fix? On Thu, Jan 22, 2015 at 10:30 AM, Leonel Câmara leonelcam...@gmail.com wrote: if you go there with your browser in incognito mode does it work? -- 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/yBM8Ybl_xGA/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/d/optout. -- 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.
Re: [web2py] Re: HELP!! Another upgrading failed for Apache running web2py
Um... actually now I got the same error when I access http which I didn't have any problems. So the original problem was I couldn't access with https and now I cannot access with http with any app (Admin, Welcome...etc). On Thursday, January 22, 2015 at 10:39:34 AM UTC-6, Omi Chiba wrote: It works!!! and now I can access with or without incognito mode... but why?? Is this temporarly fix? On Thu, Jan 22, 2015 at 10:30 AM, Leonel Câmara leonelcam...@gmail.com wrote: if you go there with your browser in incognito mode does it work? -- 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/yBM8Ybl_xGA/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/d/optout. -- 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: HELP!! Another upgrading failed for Apache running web2py
Do you mean the clear the sessions folder under web2py\applications\admin? I tried it anyway but the same error... On Wednesday, January 21, 2015 at 1:40:43 PM UTC-6, Omi Chiba wrote: The problem occurs for admin app. Do you mean the clear the sessions folder under web2py\applications\admin? I didn't migrate admin app so this should be all empty from the beginning... or are you talking about apache? On Wednesday, January 21, 2015 at 1:20:42 PM UTC-6, Leonel Câmara wrote: This error is different from the other one, all you need is to clear the sessions, compiled and cache folders on your apps and everything will be fine. -- 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: HELP!! Another upgrading failed for Apache running web2py
The problem occurs for admin app. Do you mean the clear the sessions folder under web2py\applications\admin? I didn't migrate admin app so this should be all empty from the beginning... or are you talking about apache? On Wednesday, January 21, 2015 at 1:20:42 PM UTC-6, Leonel Câmara wrote: This error is different from the other one, all you need is to clear the sessions, compiled and cache folders on your apps and everything will be fine. -- 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] HELP!! One click upgrade failed for pythonanywhere site
Hi, I clicked the upload on admin and tried to upgrade from 2.4.6 to 2.9.12. As soon as I clicked I got ticket but cannot see the ticket because now I get a ticket to see the ticket... It means I cannot open admin site. My app is still working fine. I don't where to start to fix. Can you guys help? I can access web2py folder on pythonanywhere no problem. Worst case, I can delete it and install new and import app which I backup before upgrade. -- 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.
Re: [web2py] Re: HELP!! One click upgrade failed for pythonanywhere site
Right, I think I just need to delete the app on pythonanywhere, install new web2py from their installer and replace routes.py and my apps Hopefully this works. On Wed, Jan 21, 2015 at 2:34 PM, Niphlod niph...@gmail.com wrote: in this case it's not platform-dependency the issue: it's the method web2py uses for the upgrade-in-place. We should label it CLEARLY as things can go wrong if you press this button and live with it: there are just too much moving parts around an upgrade. Most of the times it works (and it did), but that does not need to imply a fail-proof process. Things can change, web2py is (most of the times) backwards compatible with app-code but not with apps artifacts coming from different versions , e.g. sessions (or cache) serialization due to speed improvements, and so on... we simply can't afford to live with years-old choices just for the sake of a working in-place upgrade. Given the build-up of recent-releases crashes/errors/whatnot I dare to say we'd need: - a fail-proof upgrade process documented in the book - label the infamous button on admin as experimental (proposed in the past, but never happened) It's really damn easy to upgrade web2py knowing its environment... - stop the webserver (or prepare a new empty folder leaving the old one running) - prune existing except of applications/ and/or routes.py-logging.conf-etc in the root (or copy applications/ and/or routes.py-logging.conf-etc to the new one) - unzip new web2py into the root (or the new folder) - clean sessions/cache folder for every app - start the webserver (or change the configuration of the webserver to pick up from the new folder) voilà. -- 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/eXIt4HaHF44/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/d/optout. -- 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: HELP!! One click upgrade failed for pythonanywhere site
I was overt-rusting the web2py because it always promise backward compatibility... but this time it's depanding on platform so no complains. Now I failed two upgrade work for both pytonanywhere and my windows 2012 hosting server with apache... I just take one for the team and failed... : ) On Wednesday, January 21, 2015 at 2:11:31 PM UTC-6, Niphlod wrote: IMHO the issue with upgrading in place (always an HARD thing to do) is that the upgrade method doesn't take into consideration to prune the directory BEFORE installing the new version. When no modules in gluon change (or when things gets added), there is no issue however, this time with dal.py becoming dal/__init__.py things ARE GOING to break. -- 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] Login Button off the layout
I installed the latest web2py Version 2.9.11 after long time absence from this project and found the Login button on the login page looks different from the previous one (See attached) Is this normal? Kind of strange to me... -- 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: Login Button off the layout
The login page which newly created in this version looks fine so Maybe there are CSS change which affects the layout of previous app... On Friday, January 16, 2015 at 1:42:11 PM UTC-6, Omi Chiba wrote: I installed the latest web2py Version 2.9.11 after long time absence from this project and found the Login button on the login page looks different from the previous one (See attached) Is this normal? Kind of strange to me... -- 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: Don't use 64 bit ODBC with Web2Py and SQL Server
Right, I'm using Windows 2012 64bit and MSSQL 2012 on cloud. Tried python 64 bit with pyodbc first then go back 32 bit. It works fine. On Tuesday, January 13, 2015 at 6:06:37 PM UTC-6, Pbop wrote: Spent days trying to track down an error with a Web2Py app and SQL Server 2008 R2 running 64 bit ODBC drivers. Switched to 32 bit drivers and problem solved. The problem is not in Web2Py but in the actual PyOdbc driver. -- 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: dropdown text too long
Maybe this link help? http://eedle.com/2013/12/21/word-wrap-break-word-css-for-long-text-options-in-drop-down-select-lists/ -- 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: web2py conference - online talks
Thank your for sharing the link. It was the best conference ever! I was so excited and arrived around 8:20am. No body was there just me, which makes me the first attendee for the first web2py conference : ) Sorry. I have to leave after lunch to take care my family but I will check the videos this afternoon. It was really fun because everyone talk about web2py and it's really cool I can meet Anthony who help me A LOT in this online forum. On Monday, May 5, 2014 10:55:28 AM UTC-5, Massimo Di Pierro wrote: Please find below the links to the video of the first web2py conference. Videos are not broken into talks. There is no audio for the first 2minutes but no talk either, only service announcements. *Part #1 (from start to lunch break)* https://colflash.cdm.depaul.edu/colflashweb/COLFlashPlayer.aspx?ID=183272 10:00-10:10! Conference Opening 10:10-10:20! “What's New with the PSF” by Brian Curtin 10:20-11:00! “History of web2py” by Massimo Di Pierro 11:00-11:40! Learn web2py the Really Hard Way by Anthony Bastardi 11:40-12:20! Stereodose by Mark Li 12:20-12:30! Planet Host by Jason Burosh *Part #2 (from tutorial to coffee break)* https://colflash.cdm.depaul.edu/colflashweb/COLFlashPlayer.aspx?ID=183273 13:00:13:40! hands-on web2py tutorial by Clifford Williams 13:40-14:20! Angular and web2py by Amber Doctor 14:20-14:40 ! Stitching together the tree of life with web2py by Richard Ree 1 4:40-15:00! ShipElf: Automated Fulfillment with Web2Py by Peter Szczepanski 15:00-15:20! MyIRE - What is Open Source Science? by Mark Graves 15:20-15:40! Introduction to Mongodb by Marco Chou *Part #3 (from coffee break to end)* https://colflash.cdm.depaul.edu/colflashweb/COLFlashPlayer.aspx?ID=183274 16:00-16:20! Introduction to OpenShift by Craig Brott 16:20-16:40! Introduction to Hypermedia API by Bryan Barnard 16:40-17:00! web2py and the Semantic web by Chris Baron 17:00-17-20! Teaching an old dog new tricks by Don O'Hara 17:20-17:30! Conference Closing -- 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: Writable = False with Edit mode gives tampering with form's record_id error
This is the error I got. The form looks fine by doing Writable = False (See attachment) but None is set when it's submit. type 'exceptions.SyntaxError' user is tampering with form's record_id: {'EMTKSC': None, 'EMTKCD': None} != {'EMTKSC': 'J11', 'EMTKCD': 'J2620008'} I also tried Writable = True, and Disable the dropdown with jQuery but the same result. There are two option I can think of. 1. Writable = True, then hide the value from the form (Then I need to use the custom layout... which is time consuming) 2. Writable = True, then use db.executesql for updating without built-in update function. It's pretty normal to read-only the key field. I don't know how you guys dealing with this problem. -- 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. attachment: Capture.JPG
[web2py] Re: Writable = False with Edit mode gives tampering with form's record_id error
Right, Key have to be Writable. I ended up doing this my option 1 (Hide the value with CSS and display the value for the field separately using Custom Form very frustrated. On Wednesday, April 2, 2014 9:40:46 AM UTC-5, Niphlod wrote: I seem to recall that the same thing happens setting db.table.id.writable = False On Wednesday, April 2, 2014 4:07:38 PM UTC+2, Omi Chiba wrote: This is the error I got. The form looks fine by doing Writable = False (See attachment) but None is set when it's submit. type 'exceptions.SyntaxError' user is tampering with form's record_id: {'EMTKSC': None, 'EMTKCD': None} != {'EMTKSC': 'J11', 'EMTKCD': 'J2620008'} I also tried Writable = True, and Disable the dropdown with jQuery but the same result. There are two option I can think of. 1. Writable = True, then hide the value from the form (Then I need to use the custom layout... which is time consuming) 2. Writable = True, then use db.executesql for updating without built-in update function. It's pretty normal to read-only the key field. I don't know how you guys dealing with this problem. -- 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] Writable = False with Edit mode gives tampering with form's record_id error
I have simple table and everything works fine with View, Add, Edit. It has two key field and I want to protect (Writabe = False) in Edit Mode. When I set writable = False in Controller, They're readonly in Edit mode but I get tampering with form's record_id.. error when I submit. Any idea? *Controller* def email_update(): response.title = 'Update' response.subtitle = 'E-mail Account' request.args(0) or redirect (URL('email_index')) record = db.UDMEM(db.UDMEM.EMTKSC==request.args(0) and db.UDMEM.EMTKCD==request.args(1)) if record != None: db.UDMEM.EMTKSC.writable = False db.UDMEM.EMTKCD.writable = False form = SQLFORM(db.UDMEM,record, deletable=True) else: redirect(URL('email_index')) *Model* # MF - Email db.define_table('UDMEM', Field('EMTKCD', length=8, label=Customer), Field('EMTKSC', length=3, label=Dept), Field('EMTO01', length=50, label=To:Address 01), Field('EMTO02', length=50, label=To:Address 02), Field('EMTO03', length=50, label=To:Address 03), Field('EMTO04', length=50, label=To:Address 04), Field('EMTO05', length=50, label=To:Address 05), Field('EMCC01', length=50, label=Cc:Address 01), Field('EMCC02', length=50, label=Cc:Address 02), Field('EMCC03', length=50, label=Cc:Address 03), Field('EMCC04', length=50, label=Cc:Address 04), Field('EMFLAG', length=1, label=Upload Flag), Field('EMUUSR', length=128, update = auth.user.username.upper() if auth.user else None, label=Updated by), Field('EMUDAT', 'datetime', update =request.now, label=Updated on), primarykey=['EMTKCD', 'EMTKSC']) db.UDMEM.EMTKSC.requires=IS_IN_DB(dbe,dbe.TDMBUL00.BUSEC1,'%(BUBURK)s (%(BUSEC1)s)') db.UDMEM.EMTKCD.requires=IS_IN_DB(dbe,dbe.CDMTKJ00.TRTRCD,'%(TRTRKN)s (%(TRTRCD)s)', cache=(cache.ram, 1800)) db.UDMEM.EMTO01.requires=IS_NOT_EMPTY() db.UDMEM.EMFLAG.writable = db.UDMEM.EMFLAG.readable = False db.UDMEM.EMUUSR.writable = False db.UDMEM.EMUDAT.writable = False -- 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] Version 2.4.7 clean error on Apache Server
I updated my web2py to the latest version and got the following error when I did Clean from Manage list. Is any one getting the same error? It was fine when I do with Rocket server but shows the error for Apache. Versionweb2py™Version 2.4.7-stable+timestamp.2013.05.24.17.48.47PythonPython 2.7.4: C:\UniServer\usr\local\apache2\bin\Apache.exe (prefix: C:\Python27) Traceback 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. Traceback (most recent call last): File C:\web2py\gluon\main.py, line 606, in wsgibase session._try_store_in_cookie_or_file(request, response) File C:\web2py\gluon\globals.py, line 757, in _try_store_in_cookie_or_file self._try_store_in_file(request, response) File C:\web2py\gluon\globals.py, line 763, in _try_store_in_file if not response.session_id or self._forget or self._unchanged(): File C:\web2py\gluon\globals.py, line 719, in _unchanged session_pickled = cPickle.dumps(dict(self)) File C:\Python27\Lib\copy_reg.py, line 70, in _reduce_ex raise TypeError, can't pickle %s objects % base.__name__ TypeError: can't pickle function objects Error snapshot [image: help]https://thksupport.com/admin/default/ticket/admin/199.66.161.38.2013-05-30.16-38-42.885887c8-fd50-445c-a2e0-7abb0c6e42db# type 'exceptions.TypeError'(can't pickle function objects) -- --- 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.
[web2py] sitemap.xml
Do we have the way to generate sitemap.xml automatically? -- --- 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.
[web2py] Re: sitemap.xml
I was thinking like this website where it will search for the directly under the domain and generate sitemap.xml. http://www.xml-sitemaps.com/ On Wednesday, May 15, 2013 1:59:26 PM UTC-5, Niphlod wrote: automatically from what list ? it's needed at least a list of urls to generate it On Wednesday, May 15, 2013 4:59:01 PM UTC+2, Omi Chiba wrote: Do we have the way to generate sitemap.xml automatically? -- --- 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.
[web2py] Re: sitemap.xml
You're right. The web site I previously posted create the index up to controller level. I think it's OK for now. On Wednesday, May 15, 2013 3:44:26 PM UTC-5, Niphlod wrote: PS: the problem with this approach is that your site needs to include some page where all the urls that it can generate are listed. e.g. you make a /app/default/showme/ controller that takes an integer and returns the representation of a product, that you previously saved in a database.. (/app/default/showme/1, /app/dedault/showme/2, etc) How do you crawl them automatically without a /app/default/show/all that lists all products ? Usually when you want to generate a sitemap.xml it's because bots (that basically point to your domain and start crawling like the script provided) can't know in advance your dinamically generated pages if there isn't somewhere a page that lists ALL of them. -- --- 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.
[web2py] Number format using represent
I'm trying to display ShipQty field value with correct number format such as 1,500 but it shows 1500. I don't know if my represent statement is wrong or because I'm using bootstrap table style... model db.define_table('shipping', Field('FullOrderNumber', length=11, label='Order#'), Field('ShipDate', 'date', label='Shipped On'), Field('ShipNumber', length=12, label='Shipping#'), Field('ShipQty', 'decimal(9,0)', label='Shipped Qty',represent = lambda ShipQty,row: '%.2f' % ShipQty), Field('DeliveryMethod', length=30, label='Delivery Method'), Field('TrackingNumber', length=20, label='Tracking#'), Field('UpdatedDate', 'date', label='Updated On'), ) control key = request.args(0) or redirect(URL('index')) query = (db.shipping.FullOrderNumber==key) lists = db(query).select(db.shipping.ALL) view --- table class=table table-hover thead thOrder#/th thStatus/th thPart#/th thspan class='right'Order Qty/span/th thspan class='right'Shipped Qty/span/th thTracking#/th /thead tbody {{for orders in orders:}} tr td{{=orders.FullOrderNumber}}/td td{{=orders.StatusDesc}}/td td{{=orders.PartNumber}}/td tdspan class='right'{{=orders.OrderQty}}/span/td tdspan class='right'{{=orders.ShipQty}}/span/td tda href={{=URL('tracking',args=orders.FullOrderNumber)}} class=btnClick/a/td /tr {{pass}} /tbody /table -- --- 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.
[web2py] Re: Number format using represent
Thank you for the info! I finally solved it by referencing the previous post!! https://groups.google.com/forum/?fromgroups=#!searchin/web2py/Number$20format$20locale/web2py/51XIw3Lz74c/vLnyxa9gfmgJ model -- import locale locale.setlocale(locale.LC_NUMERIC, 'English') def number_format(num, places=0): return locale.format(%.*f, (places, num), True) view -- td{{=number_format(lists.ShipQty,0)}}/td On Friday, May 10, 2013 2:10:21 PM UTC-5, Niphlod wrote: represent is used in widgets only, it doesn't get called for raw representations such as {{=record.column}} if you want to leverage your model's represent, you have to call it {{=db.table.column.represent(record.column, record)}} On Friday, May 10, 2013 6:57:48 PM UTC+2, Omi Chiba wrote: I'm trying to display ShipQty field value with correct number format such as 1,500 but it shows 1500. I don't know if my represent statement is wrong or because I'm using bootstrap table style... model db.define_table('shipping', Field('FullOrderNumber', length=11, label='Order#'), Field('ShipDate', 'date', label='Shipped On'), Field('ShipNumber', length=12, label='Shipping#'), Field('ShipQty', 'decimal(9,0)', label='Shipped Qty',represent = lambda ShipQty,row: '%.2f' % ShipQty), Field('DeliveryMethod', length=30, label='Delivery Method'), Field('TrackingNumber', length=20, label='Tracking#'), Field('UpdatedDate', 'date', label='Updated On'), ) control key = request.args(0) or redirect(URL('index')) query = (db.shipping.FullOrderNumber==key) lists = db(query).select(db.shipping.ALL) view --- table class=table table-hover thead thOrder#/th thStatus/th thPart#/th thspan class='right'Order Qty/span/th thspan class='right'Shipped Qty/span/th thTracking#/th /thead tbody {{for orders in orders:}} tr td{{=orders.FullOrderNumber}}/td td{{=orders.StatusDesc}}/td td{{=orders.PartNumber}}/td tdspan class='right'{{=orders.OrderQty}}/span/td tdspan class='right'{{=orders.ShipQty}}/span/td tda href={{=URL('tracking',args=orders.FullOrderNumber)}} class=btnClick/a/td /tr {{pass}} /tbody /table -- --- 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.
[web2py] Re: Dynamically change highlighted class for response.menu
Worked! Thank you~! On Thursday, May 9, 2013 3:38:41 AM UTC-5, Niphlod wrote: it's exactly working as expected with the latest snippet. Il giorno giovedì 9 maggio 2013 00:15:38 UTC+2, Omi Chiba ha scritto: Thank you for the additional explanation. I just want to highlight the home by defaut only first time user access the page. It should be removed when user click menu1 or menu2. The home will be highlighted again when user click home. By default. -- Home highlihgted Menu1 Menu2 User click menu1... Home Menu1 highlihgted Menu2 User click Home again... Home highlihgted Menu1 Menu2 On Wednesday, May 8, 2013 4:34:07 PM UTC-5, Niphlod wrote: ps: if you are on the case where you need to have home highlighted by default no matter what, use this javascript snippet (pretty straightforward) Added also a filter() to exclude the registration/login/etc links from being highlighted jQuery(function() { var path = location.pathname.substring(1); if ( path ) { var els = jQuery('ul.nav a[href$='+path+']').filter( [rel!=nofollow]); if (els.length != 0) { els.closest('li').addClass('highlighted'); } else { jQuery('ul.nav a[href$=/highlight/default/index]').closest ('li').addClass('highlighted'); } } }) PS: maybe to make it more clearer, use a Home link with an id, such as (SPAN('Home', _id='default_highlighted'), False, URL('default', 'index'), []), so you can switch the last line from jQuery('ul.nav a[href$=/highlight/default/index]').closest('li'). addClass('highlighted'); to jQuery('#default_highlighted').closest('li').addClass('highlighted'); -- --- 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.
[web2py] Re: Dynamically change highlighted class for response.menu
Niphlod Thank you !! It's perfect now. Paolo Thank you for the reference that's look easier too especially for someone like me who's not javascript gulu. On Thursday, May 9, 2013 1:55:00 PM UTC-5, Niphlod wrote: script jQuery(function() { var path = location.pathname.substring(1); if ( path ) { var els = jQuery('ul.nav a[href$='+path+']').filter( [rel!=nofollow]); if (els.length != 0) { els.find('span').addClass('highlighted'); } else { jQuery('#default_highlighted').find('span').addClass( 'highlighted'); } } }) /script is the one. the previous was for the one with the additional fiddles with the css. -- --- 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.
[web2py] Re: Dynamically change highlighted class for response.menu
Thank you for the additional explanation. I just want to highlight the home by defaut only first time user access the page. It should be removed when user click menu1 or menu2. The home will be highlighted again when user click home. By default. -- Home highlihgted Menu1 Menu2 User click menu1... Home Menu1 highlihgted Menu2 User click Home again... Home highlihgted Menu1 Menu2 On Wednesday, May 8, 2013 4:34:07 PM UTC-5, Niphlod wrote: ps: if you are on the case where you need to have home highlighted by default no matter what, use this javascript snippet (pretty straightforward) Added also a filter() to exclude the registration/login/etc links from being highlighted jQuery(function() { var path = location.pathname.substring(1); if ( path ) { var els = jQuery('ul.nav a[href$='+path+']').filter( [rel!=nofollow]); if (els.length != 0) { els.closest('li').addClass('highlighted'); } else { jQuery('ul.nav a[href$=/highlight/default/index]').closest( 'li').addClass('highlighted'); } } }) PS: maybe to make it more clearer, use a Home link with an id, such as (SPAN('Home', _id='default_highlighted'), False, URL('default', 'index'), []), so you can switch the last line from jQuery('ul.nav a[href$=/highlight/default/index]').closest('li'). addClass('highlighted'); to jQuery('#default_highlighted').closest('li').addClass('highlighted'); -- --- 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.
[web2py] web2py on apache 'exceptions.MemoryError'
I'm using the latest web2py 2.4.6-stable+timestamp.2013.04.06.17.37.38 (Running on Apache) with Windows 2012 Server 64bit. Everytime I do the following, I got ticket link, when I click the link, it will generate another error ticket and says 'exceptions.MemoryError'. Do you have any idea? - Create new simple app - Clean - Upload/Delete Image I don't see any errors listed for my app's error logs page so I'm wondering I don't have enough authority to do something with file system... -- --- 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.
[web2py] Dynamically change highlighted class for response.menu
I have a following response.menu in my menu.py. By default Home is highlighted but I want to highlight the menu clicked by the user. For example, when user click contact, 'highlighted' class should be added to contact and removed from home. response.menu = [ (SPAN('Home', _class='highlighted'), False, URL('default', 'index'), []), (T('Order Status'), False, URL('default', 'orderstatus'), []), (T('QA'), False, URL('default', 'qa'), []), (T('Contact'), False, URL('default', 'contact'), []) ] -- --- 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.
[web2py] Re: Dynamically change highlighted class for response.menu
Niphlod , thank you for the reply! Can you provide me actual code workis on new app? I'm not sure where I should put the javascript and what value should I specify for 'all a in the menu'. On Tuesday, May 7, 2013 11:05:27 AM UTC-5, Niphlod wrote: javascript .. something like $('all a in the menu').click(function(e) { $('all a in the menu').removeClass('highlighted'); $(this).addClass('highlighted'); }) should work . You can even generalize it to highlight the current page url automatically. var path = location.pathname.substring(1); if ( path ) $('all a in menu[href$=' + path + ']').closest('li'). addClass('highlight'); Il giorno martedì 7 maggio 2013 17:56:10 UTC+2, Omi Chiba ha scritto: I have a following response.menu in my menu.py. By default Home is highlighted but I want to highlight the menu clicked by the user. For example, when user click contact, 'highlighted' class should be added to contact and removed from home. response.menu = [ (SPAN('Home', _class='highlighted'), False, URL('default', 'index'), []), (T('Order Status'), False, URL('default', 'orderstatus'), []), (T('QA'), False, URL('default', 'qa'), []), (T('Contact'), False, URL('default', 'contact'), []) ] -- --- 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] web2py on apache 'exceptions.MemoryError'
It's empty... On Tuesday, May 7, 2013 11:37:11 AM UTC-5, Marin Pranjić wrote: Can you check app/errors content? How many tickets there? What is their size in total? On Tue, May 7, 2013 at 5:28 PM, Omi Chiba ochi...@gmail.com javascript: wrote: I'm using the latest web2py 2.4.6-stable+timestamp.2013.04.06.17.37.38 (Running on Apache) with Windows 2012 Server 64bit. Everytime I do the following, I got ticket link, when I click the link, it will generate another error ticket and says 'exceptions.MemoryError'. Do you have any idea? - Create new simple app - Clean - Upload/Delete Image I don't see any errors listed for my app's error logs page so I'm wondering I don't have enough authority to do something with file system... -- --- 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+un...@googlegroups.com javascript:. 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.
[web2py] Disable auto-migration for auth tables.
I'm using CAS so new app is sharing the same auth tables so it doesn't have to be created. But it's trying to create one and get already existing error... I can do migrate_enabled=Falese in DAL but then I cannot migrate any other tables used in the app. Can we just disable auto-migration only for auth tables? -- --- 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] Disable auto-migration for auth tables.
It works! Thanks a lot. On Tuesday, May 7, 2013 2:26:34 PM UTC-5, Ricardo Pedroso wrote: On Tue, May 7, 2013 at 8:05 PM, Omi Chiba ochi...@gmail.com javascript: wrote: I'm using CAS so new app is sharing the same auth tables so it doesn't have to be created. But it's trying to create one and get already existing error... I can do migrate_enabled=Falese in DAL but then I cannot migrate any other tables used in the app. Can we just disable auto-migration only for auth tables? Yes. auth.define_tables(migrate=False) Ricardo -- --- 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] web2py on apache 'exceptions.MemoryError'
I think I'm OK now. I gave full control for web2py folder for users and it starts working fine... On Tuesday, May 7, 2013 11:48:54 AM UTC-5, Omi Chiba wrote: Oh, my mistake. It was there under admin/errors. I clear all the error files and try to create new app called hello. Please see the attached. hello app is created anyway but generate two tickets. First log 199.66.161.38 2013-05-07.11-40-45... Second log (When I click the link for the first log, this one is created) 199.66.161.38 2013-05-07.11-41-09... On Tuesday, May 7, 2013 11:43:11 AM UTC-5, Marin Pranjić wrote: well if you got a ticket link, something should be there On Tue, May 7, 2013 at 6:39 PM, Omi Chiba ochi...@gmail.com wrote: It's empty... On Tuesday, May 7, 2013 11:37:11 AM UTC-5, Marin Pranjić wrote: Can you check app/errors content? How many tickets there? What is their size in total? On Tue, May 7, 2013 at 5:28 PM, Omi Chiba ochi...@gmail.com wrote: I'm using the latest web2py 2.4.6-stable+timestamp.**2013.04.06.17.37.38 (Running on Apache) with Windows 2012 Server 64bit. Everytime I do the following, I got ticket link, when I click the link, it will generate another error ticket and says 'exceptions.MemoryError'. Do you have any idea? - Create new simple app - Clean - Upload/Delete Image I don't see any errors listed for my app's error logs page so I'm wondering I don't have enough authority to do something with file system... -- --- 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+un...@**googlegroups.com. For more options, visit https://groups.google.com/**groups/opt_outhttps://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+un...@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.
[web2py] Re: bootstrap thumnails problem
Thank you for the reply. I think there is nothing we can do about it. It's trying to put the word next line if the word will be cut off middle and even out the space between the words. It's just a behavior for bootstrap and I cannot really control... On Thursday, May 2, 2013 1:23:13 PM UTC-5, Niphlod wrote: check with firebug / similar if your p with the descriptions have something among the lines of text-aling: justify applied. looks like that in the screenshots you posted. On Wednesday, May 1, 2013 11:06:55 PM UTC+2, Omi Chiba wrote: Maybe this is not web2py issue but I'm trying to use thumnail class to shows the three image blocks but the text in the paragraph inside is strangely have too much space between the words. Does anyone know how to adjust it? h3How can we help you?/h3 ul class=thumbnails li class=span3 div class=thumbnail {{=IMG(_src=URL('static/images','holder260_180.png'),_style=width: 250px,_class=img-polaroid,_alt=Order Status)}} h4Order Status/h4 pThumbnail caption.../p /div /li li class=span3 div class=thumbnail {{=IMG(_src=URL('static/images','holder260_180.png'),_style=width: 250px,_class=img-polaroid,_alt=Order Status)}} h4QA/h4 pTo search the Frequently Asked Questions/p /div /li li class=span3 div class=thumbnail {{=IMG(_src=URL('static/images','holder260_180.png'),_style=width: 250px,_class=img-polaroid,_alt=Order Status)}} h4Contact/h4 pThumbnail caption.../p /div /li /ul -- --- 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.
[web2py] Re: bootstrap thumnails problem
Thank you for suggestions. -- --- 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.
[web2py] bootstrap thumnails problem
Maybe this is not web2py issue but I'm trying to use thumnail class to shows the three image blocks but the text in the paragraph inside is strangely have too much space between the words. Does anyone know how to adjust it? h3How can we help you?/h3 ul class=thumbnails li class=span3 div class=thumbnail {{=IMG(_src=URL('static/images','holder260_180.png'),_style=width: 250px,_class=img-polaroid,_alt=Order Status)}} h4Order Status/h4 pThumbnail caption.../p /div /li li class=span3 div class=thumbnail {{=IMG(_src=URL('static/images','holder260_180.png'),_style=width: 250px,_class=img-polaroid,_alt=Order Status)}} h4QA/h4 pTo search the Frequently Asked Questions/p /div /li li class=span3 div class=thumbnail {{=IMG(_src=URL('static/images','holder260_180.png'),_style=width: 250px,_class=img-polaroid,_alt=Order Status)}} h4Contact/h4 pThumbnail caption.../p /div /li /ul -- --- 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. attachment: Capture.JPG
[web2py] Re: web2py is moving
That's a good news. I llike pythonanywhere ! On Thursday, February 28, 2013 5:40:22 PM UTC-6, Massimo Di Pierro wrote: web2py.com is moving to pythonanywhere.com. There may be disruptions but we hope not. -- --- 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.
[web2py] Re: jquery mobile plugin layout problem
Found the solution. It works fine now. I submit a ticket along with my solution for this. http://code.google.com/p/web2py/issues/detail?id=1354thanks=1354ts=1361979432 On Tuesday, February 26, 2013 2:21:21 PM UTC-6, Omi Chiba wrote: How can I add margin both side of the page? I attached my screen shot. jquery mobile should give me the margin on left and right side so text, buttons fit nicely but there is no space when you use the plugin so the text doesn't look good. I use web2py 2.3.2 and downloaded the latest jquery mobile plugin. The screen shows blank and doesn't work so I replaced the code in views/plugin_jqmobile/layout.html. link rel=stylesheet href= http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.css; / script src= http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.js /script to this. link rel=stylesheet href= http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css; / script src= http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js;/script I tried the previous css just in case but the same result. -- --- 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.
[web2py] web2py 2.1.1 to 2.3.2
I was a little busy and my version was 2.1.1 but now it's 2.3.2! Is there anyone who can explain what's the major change since 2.1.1? -- --- 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.
[web2py] Re: web2py 2.1.1 to 2.3.2
Thanks : ) On Tuesday, February 26, 2013 1:43:03 PM UTC-6, Massimo Di Pierro wrote: You can find the changelog here: http://web2py.com/examples/default/changelog On Tuesday, 26 February 2013 13:22:58 UTC-6, Omi Chiba wrote: I was a little busy and my version was 2.1.1 but now it's 2.3.2! Is there anyone who can explain what's the major change since 2.1.1? -- --- 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.
[web2py] jquery mobile plugin layout problem
How can I add margin both side of the page? I attached my screen shot. jquery mobile should give me the margin on left and right side so text, buttons fit nicely but there is no space when you use the plugin so the text doesn't look good. I use web2py 2.3.2 and downloaded the latest jquery mobile plugin. The screen shows blank and doesn't work so I replaced the code in views/plugin_jqmobile/layout.html. link rel=stylesheet href=http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.css; / script src=http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.js;/script to this. link rel=stylesheet href=http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css; / script src=http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js;/script I tried the previous css just in case but the same result. -- --- 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. attachment: jquery-mobile.JPG
[web2py] Re: outdated web2py plugin for jquery mobile
Same here. One of web2py Japan member found it's using the old jquery mobile files. I changed the code in views/plugin_jqmobile/layout.html link rel=stylesheet href=http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.css; / script src=http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.js;/script to this and it's working file. link rel=stylesheet href=http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css; / script src=http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js;/script On Thursday, February 14, 2013 3:09:35 AM UTC-6, wanderer wrote: I had the same problem today. Looks like http://web2py.com/plugins/plugin_jqmobile/about still refers to the wrong plugin. Am Sonntag, 21. Oktober 2012 17:43:37 UTC+2 schrieb Massimo Di Pierro: Will do asap. The one that ships with admin is updated, the one on web2py.com/plugins is not. On Sunday, 21 October 2012 09:35:44 UTC-5, kirilisa wrote: Hi, I'm new to web2py (and to python in fact) and was very excited about the ease of use that seemed evident in web2py for building my HTML5 app. As I had previously determined to use jQuery Mobile, I was even more excited to see that there was a plugin for that. However, downloading the plugin from http://web2py.com/plugins/plugin_jqmobile/about always resulted in a blank page - the plugin did not work. On closer inspection, some of the pathing in the layout.html file was wrong, but fixing that still did not make it work. I was ready to give it up when I noticed that web2py 2.1 was out and that it had a mobile admin interface that was in fact using the jQuery Mobile plugin! However, still, installing the plugin in my custom app from the app creation wizard or even downloading it from the mobile admin page at http://192.168.1.11:8000/admin/plugin_jqmobile/about resulted in the same old outdated version of the plugin. I finally scrapped the install and just copied all the plugin files from the /admin/ app to my web2py app - it now works. To make a long story short - it would be great if the plugin download could be updated both on the mobile admin page and at http://web2py.com/plugins/plugin_jqmobile/about to spare someone else the frustration I went through trying to get it to work! Thanks! -- --- 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.
[web2py] Re: grid export button
I posted on this on my bloghttp://ochiba77.blogspot.com/2012/10/web2py-grid-with-export-dropdown.html?showComment=1351174654911#c5334545878916593563 and someone pointed that it will get ticket when clicking View button. Do you know how to fix? Problem looks like here. export_menu_links = original_export_menu.elements('a') 1. 2. 3. 4. 5. 6. Traceback (most recent call last): File C:\web2py\gluon\restricted.py, line 209, in restricted exec ccode in environment File C:\web2py\applications\grid\views\default/index.html, line 82, in module AttributeError: 'NoneType' object has no attribute 'elements' 73. 74. 75. 76. 77. 78. 79. 80. 81. 82. 83. 84. 85. 86. 87. 88. 89. 90. 91. 92. pass response.write('\n\ndiv class=', escape=False) response.write(middle_columns) response.write('\n', escape=False) response.write('\n', escape=False) response.write('\r\n', escape=False) w2p_grid_tbl = grid.element('table') if w2p_grid_tbl: original_export_menu = grid.element('div.w2p_export_menu') export_menu_links = original_export_menu.elements('a') export_menu_items = [] for link in export_menu_links: item = LI(link) export_menu_items.append(item) pass new_export_menu = DIV( A( T('Exports'), SPAN(_class='caret'), _href='#', _class='btn dropdown-toggle', On Tuesday, October 23, 2012 8:38:54 AM UTC-5, Omi Chiba wrote: It works! Thank you for sharing your code. On Monday, October 22, 2012 5:00:19 PM UTC-5, Paolo Caruccio wrote: My fault. I extrapoled the code from more complex one. Try this: {{extend 'layout.html'}} {{ w2p_grid_tbl = grid.element('table') if w2p_grid_tbl: original_export_menu = grid.element('div.w2p_export_menu') export_menu_links = original_export_menu.elements('a') export_menu_items = [] for link in export_menu_links: item = LI(link) export_menu_items.append(item) pass new_export_menu = DIV( A( T('Exports'), SPAN(_class='caret'), _href='#', _class='btn dropdown-toggle', **{'_data-toggle':dropdown} ), UL(*export_menu_items, _class='dropdown-menu' ), _class='w2p_export_menu btn-group' ) export_menu = grid.element('div.w2p_export_menu',replace=new_export_menu ) pass }} {{=grid}} Of course you could modify the DOM directly in the controller. Il giorno lunedì 22 ottobre 2012 22:56:48 UTC+2, Omi Chiba ha scritto: Wow! This is exactly what I wanted. I hope this will be the default layout for grid. I copy and pasted your code between {{extend 'layout.html'}} and {{=gird}}, then export labels are now disappeard... Maybe you should check your code with the latest (2.1.1). {{left_sidebar_enabled,right_sidebar_enabled=False,('message' in globals())}} {{extend 'layout.html'}} {{ w2p_grid_tbl = grid.element('table') if w2p_grid_tbl: export_menu = grid.element('div.w2p_export_menu') export_menu_links = export_menu.elements('a') export_menu_items = [] for link in export_menu_links: item = LI(link) export_menu_items.append(item) pass export_menu = grid.element('div.w2p_export_menu',replace=None) new_export_menu = DIV( A( T('Exports'), SPAN(_class='caret'), _href='#', _class='btn dropdown-toggle', **{'_data-toggle':dropdown} ), UL(*export_menu_items, _class='dropdown-menu' ), _class='w2p_export_menu btn-group' ) pass }} {{=grid}} On Monday, October 22, 2012 2:10:53 PM UTC-5, Paolo Caruccio wrote: For grid export menu I'm happy with below method In the views/*.html file where is your grid put on top (just below extend layout command) the following code: {{ w2p_grid_tbl = grid.element('table') if w2p_grid_tbl: export_menu = grid.element('div.w2p_export_menu') export_menu_links = export_menu.elements('a') export_menu_items = [] for link in export_menu_links: item = LI(link) export_menu_items.append(item) pass export_menu = grid.element('div.w2p_export_menu',replace=None) new_export_menu = DIV( A( T('Exports'), SPAN(_class='caret'), _href='#', _class='btn dropdown-toggle', **{'_data-toggle':dropdown} ), UL(*export_menu_items, _class='dropdown-menu' ), _class='w2p_export_menu btn-group
[web2py] Re: grid export button
It worked!! Thanks again. On Thursday, October 25, 2012 10:49:15 AM UTC-5, Paolo Caruccio wrote: This happens because the url has arguments. please try with: {{extend 'layout.html'}} {{ if not request.args: w2p_grid_tbl = grid.element('table') if w2p_grid_tbl: original_export_menu = grid.element('div.w2p_export_menu') export_menu_links = original_export_menu.elements('a') export_menu_items = [] for link in export_menu_links: item = LI(link) export_menu_items.append(item) pass new_export_menu = DIV( A( T('Exports'), SPAN(_class='caret'), _href='#', _class='btn dropdown-toggle', **{'_data-toggle':dropdown} ), UL(*export_menu_items, _class='dropdown-menu' ), _class='w2p_export_menu btn-group' ) export_menu = grid.element('div.w2p_export_menu',replace=new_export_menu) pass pass }} {{=grid}} Of course if the page with the grid has arguments in url you have to change the first condition and check the acceptable cases. Il giorno giovedì 25 ottobre 2012 16:20:45 UTC+2, Omi Chiba ha scritto: I posted on this on my bloghttp://ochiba77.blogspot.com/2012/10/web2py-grid-with-export-dropdown.html?showComment=1351174654911#c5334545878916593563 and someone pointed that it will get ticket when clicking View button. Do you know how to fix? Problem looks like here. export_menu_links = original_export_menu.elements('a') 1. 2. 3. 4. 5. 6. Traceback (most recent call last): File C:\web2py\gluon\restricted.py, line 209, in restricted exec ccode in environment File C:\web2py\applications\grid\views\default/index.html, line 82, in module AttributeError: 'NoneType' object has no attribute 'elements' 73. 74. 75. 76. 77. 78. 79. 80. 81. 82. 83. 84. 85. 86. 87. 88. 89. 90. 91. 92. pass response.write('\n\ndiv class=', escape=False) response.write(middle_columns) response.write('\n', escape=False) response.write('\n', escape=False) response.write('\r\n', escape=False) w2p_grid_tbl = grid.element('table') if w2p_grid_tbl: original_export_menu = grid.element('div.w2p_export_menu') export_menu_links = original_export_menu.elements('a') export_menu_items = [] for link in export_menu_links: item = LI(link) export_menu_items.append(item) pass new_export_menu = DIV( A( T('Exports'), SPAN(_class='caret'), _href='#', _class='btn dropdown-toggle', On Tuesday, October 23, 2012 8:38:54 AM UTC-5, Omi Chiba wrote: It works! Thank you for sharing your code. On Monday, October 22, 2012 5:00:19 PM UTC-5, Paolo Caruccio wrote: My fault. I extrapoled the code from more complex one. Try this: {{extend 'layout.html'}} {{ w2p_grid_tbl = grid.element('table') if w2p_grid_tbl: original_export_menu = grid.element('div.w2p_export_menu') export_menu_links = original_export_menu.elements('a') export_menu_items = [] for link in export_menu_links: item = LI(link) export_menu_items.append(item) pass new_export_menu = DIV( A( T('Exports'), SPAN(_class='caret'), _href='#', _class='btn dropdown-toggle', **{'_data-toggle':dropdown} ), UL(*export_menu_items, _class='dropdown-menu' ), _class='w2p_export_menu btn-group' ) export_menu = grid.element('div.w2p_export_menu',replace= new_export_menu) pass }} {{=grid}} Of course you could modify the DOM directly in the controller. Il giorno lunedì 22 ottobre 2012 22:56:48 UTC+2, Omi Chiba ha scritto: Wow! This is exactly what I wanted. I hope this will be the default layout for grid. I copy and pasted your code between {{extend 'layout.html'}} and {{=gird}}, then export labels are now disappeard... Maybe you should check your code with the latest (2.1.1). {{left_sidebar_enabled,right_sidebar_enabled=False,('message' in globals())}} {{extend 'layout.html'}} {{ w2p_grid_tbl = grid.element('table') if w2p_grid_tbl: export_menu = grid.element('div.w2p_export_menu') export_menu_links = export_menu.elements('a') export_menu_items = [] for link in export_menu_links: item = LI(link) export_menu_items.append(item) pass export_menu = grid.element('div.w2p_export_menu',replace=None) new_export_menu = DIV( A( T('Exports'), SPAN(_class='caret'), _href='#', _class='btn dropdown-toggle
[web2py] grid create,editable, deletable are not displayed
I don't what I'm doing wrong. I made a new sample grid app with ver 2.1.1 and it doesn't display create, editable, deletable by default or with True. Model db.define_table('Category', Field('Code', 'integer'), Field('Name'), format='%(Name)s') Controller def index(): query = db.Category.id 0 grid = SQLFORM.grid(query,csv=True,paginate=10) return dict(grid=grid) View {{extend 'layout.html'}} {{=grid}} -- attachment: gird_links.jpg
Re: [web2py] Re: grid create,editable, deletable are not displayed
Ah! That's why. Thanks Niphlod! On Tue, Oct 23, 2012 at 9:08 AM, Niphlod niph...@gmail.com wrote: you have to be logged-in . By default web2py doesn't allow random users to modify your precious data. you can turn off this safe behaviour with user_signature=False By default all the URL generated by the grid are digitally signed and verified. This means one cannot perform certain actions (create, update, delete) without being logged-in http://web2py.com/books/default/chapter/29/07#SQLFORM.grid-and-SQLFORM.smartgrid On Tuesday, October 23, 2012 3:47:20 PM UTC+2, Omi Chiba wrote: I don't what I'm doing wrong. I made a new sample grid app with ver 2.1.1 and it doesn't display create, editable, deletable by default or with True. Model db.define_table('Category', Field('Code', 'integer'), Field('Name'), format='%(Name)s') Controller def index(): query = db.Category.id 0 grid = SQLFORM.grid(query,csv=True,**paginate=10) return dict(grid=grid) View {{extend 'layout.html'}} {{=grid}} -- --
[web2py] grid export button
New export function on grid has many choices but I need to keep the old format. (Export button for csv) because... - I'm using the gird for users (Maybe this format is good for us but not users.) - Current export options layout is not pretty (I prefer button with dropdown list) - I don't want users to see hidden columns Is there any option available for me? --
[web2py] Re: grid export button
Wow! This is exactly what I wanted. I hope this will be the default layout for grid. I copy and pasted your code between {{extend 'layout.html'}} and {{=gird}}, then export labels are now disappeard... Maybe you should check your code with the latest (2.1.1). {{left_sidebar_enabled,right_sidebar_enabled=False,('message' in globals())}} {{extend 'layout.html'}} {{ w2p_grid_tbl = grid.element('table') if w2p_grid_tbl: export_menu = grid.element('div.w2p_export_menu') export_menu_links = export_menu.elements('a') export_menu_items = [] for link in export_menu_links: item = LI(link) export_menu_items.append(item) pass export_menu = grid.element('div.w2p_export_menu',replace=None) new_export_menu = DIV( A( T('Exports'), SPAN(_class='caret'), _href='#', _class='btn dropdown-toggle', **{'_data-toggle':dropdown} ), UL(*export_menu_items, _class='dropdown-menu' ), _class='w2p_export_menu btn-group' ) pass }} {{=grid}} On Monday, October 22, 2012 2:10:53 PM UTC-5, Paolo Caruccio wrote: For grid export menu I'm happy with below method In the views/*.html file where is your grid put on top (just below extend layout command) the following code: {{ w2p_grid_tbl = grid.element('table') if w2p_grid_tbl: export_menu = grid.element('div.w2p_export_menu') export_menu_links = export_menu.elements('a') export_menu_items = [] for link in export_menu_links: item = LI(link) export_menu_items.append(item) pass export_menu = grid.element('div.w2p_export_menu',replace=None) new_export_menu = DIV( A( T('Exports'), SPAN(_class='caret'), _href='#', _class='btn dropdown-toggle', **{'_data-toggle':dropdown} ), UL(*export_menu_items, _class='dropdown-menu' ), _class='w2p_export_menu btn-group' ) pass }} In the attached picture you can see how the exports menu is rendered using css bootstrap framework. The method is based on Server-side DOM and parsing ( http://web2py.com/books/default/chapter/29/05#Server-side-DOM-and-parsing) and it uses the elements argument replace (new beatiful and powerful - in my opinion - feature). For reference you could read https://groups.google.com/forum/?fromgroups=#!topic/web2py/fbYZXoIOkCY I hope this will help you. Il giorno lunedì 22 ottobre 2012 17:15:37 UTC+2, Omi Chiba ha scritto: New export function on grid has many choices but I need to keep the old format. (Export button for csv) because... - I'm using the gird for users (Maybe this format is good for us but not users.) - Current export options layout is not pretty (I prefer button with dropdown list) - I don't want users to see hidden columns Is there any option available for me? --
[web2py] Version 2.1.1 error: Table' object has no attribute '_id'
My app was working fine with Version 1.99.2. I upgrade to Version 2.1.1 and it shows this error. I'm using DB2 for my database. PDTFF is new table defined by web2py so it has id field but the others are existing and doesn't have id field. *Traceback (most recent call last):* File C:\web2py\gluon\restricted.py, line 209, in restricted exec ccode in environment File C:/web2py/applications/fedex/controllers/default.py, line 205, in module File C:\web2py\gluon\globals.py, line 187, in lambda self._caller = lambda f: f() File C:\web2py\gluon\tools.py, line 2838, in f return action(*a, **b) File C:/web2py/applications/fedex/controllers/default.py, line 116, in next form = SQLFORM(db.PDTFF,record) File C:\web2py\gluon\sqlhtml.py, line 1038, in __init__ inp = self.widgets.options.widget(field, default) File C:\web2py\gluon\sqlhtml.py, line 226, in widget options = requires[0].options() File C:\web2py\gluon\validators.py, line 2500, in _options options = self.other.options() File C:\web2py\gluon\validators.py, line 484, in options self.build_set() File C:\web2py\gluon\validators.py, line 471, in build_set records = self.dbset(table).select(*fields, **dd) File C:\web2py\gluon\dal.py, line 8726, in __call__ query = self.db._adapter.id_query(query) File C:\web2py\gluon\dal.py, line 631, in id_query return table._id != None File C:\web2py\gluon\dal.py, line 7636, in __getitem__ return ogetattr(self, str(key)) AttributeError: 'Table' object has no attribute '_id' *Function argument list* (self=Table TDMKNP00 (KNCTCD,KNKNCD,KNKNNM), key='_id') *Model* # coding: utf8 # Employee info table on HELPDESK dbh.define_table('tbluser', Field('name', length=255), Field('location', length=255), Field('emailaddress', length=255)) # Dept Master db.define_table('TDMBUP01', Field('BUSEC1', length=3), Field('BUBURK', length=12), primarykey=['BUSEC1']) # Country Master db.define_table('TDMCNP00', Field('CNCNCD', length=3), Field('CNCNNM', length=30), primarykey=['CNCNCD']) # Area 2 Master db.define_table('TDMKNP00', Field('KNCTCD', length=3), Field('KNKNCD', length=2), Field('KNKNNM', length=30), primarykey=['KNCTCD','KNKNCD']) # Purchase Order db.define_table('SDTH2P01', Field('H2DNO', length=8), Field('H2TRD1', 'integer'), Field('H2JJDN', length=8), Field('H2JJGN', 'integer'), Field('H2JDNO', length=8), Field('H2JGNO', 'integer'), Field('H2JCSC', length=3), Field('H2HSKB', length=1), Field('H2KSM', length=3), Field('H2PRCD', length=15), Field('H2PRKJ', length=50), Field('H2TRS', 'integer'), Field('H2HZS', 'integer'), primarykey=['H2DNO']) # Open FedEx Purchase Order db.define_table('SDTH2PF1', Field('H2DNO', length=8), Field('H2TRD1', 'integer'), Field('H2JJDN', length=8), Field('H2JJGN', 'integer'), Field('H2JDNO', length=8), Field('H2JGNO', 'integer'), Field('H2JCSC', length=3), Field('H2HSKB', length=1), Field('H2KSM', length=3), Field('H2PRCD', length=15), Field('H2PRKJ', length=50), Field('H2TRS', 'integer'), Field('H2HZS', 'integer'), primarykey=['H2DNO']) # Received Order db.define_table('SDTJ2P00', Field('J2DNO', length=8), Field('J2GNO', 'integer'), Field('J2TSCD',length=8), Field('J2TSK1',length=35), Field('J2TSK2',length=35), Field('J2TSPE',length=22), Field('J2ODA1',length=30), Field('J2ODA2',length=30), Field('J2ODA7',length=20), Field('J2KNCD',length=2), Field('J2CNCD',length=3), Field('J2OYUB',length=10), Field('J2OTEL',length=20), Field('J2KYSC',length=12), Field('J2NSD','integer'), primarykey=['J2DNO','J2GNO']) # FedEx Request Output file db.define_table('PDTFF', Field('FFDNO', length=8, label='HJ#'), Field('FFTRD', 'date', label=Requested), Field('FFJCSC', length=3, label=Dept), Field('FFBURK', length=12, label=Dept Name), Field('FFJDNO', length=8, label=JJ#), Field('FFJGNO', 'integer', label=JJ line#), Field('FFJJDN', length=8, label=J# (JP)), Field('FFJJGN', 'integer', label=J line# (JP)), Field('FFACCT', length=9, label=FedEx Acct #), Field('FFCUST', length=30, label=Company Name), Field('FFNSD', 'date',label=Delivery Due), Field('FFPRCD', length=15,label=Product Code), Field('FFPRKJ', length=50,label=Part Number), Field('FFTRS', 'integer',label=Quantity), Field('FFTSK1',length=35,label=Name 1), Field('FFTSK2',length=35,label=Name 2), Field('FFTSPE',length=22,label=Attn:), Field('FFODA1',length=30,label=Address 1), Field('FFODA2',length=30,label=Adderss 2), Field('FFODA7',length=20,label=City), Field('FFKNCD',length=2,label=State), Field('FFCNCD',length=3,label=Country), Field('FFOYUB',length=10,label=Zip), Field('FFOTEL',length=20,label=Phone), Field('FFKYSC',length=12,label=Customer Order#),
[web2py] Re: Version 2.1.1 error: Table' object has no attribute '_id'
It looks this line failed. Here I simply edit the record provided by user's select. form = SQLFORM(db.PDTFF,record) On Friday, October 19, 2012 3:27:53 PM UTC-5, Omi Chiba wrote: My app was working fine with Version 1.99.2. I upgrade to Version 2.1.1 and it shows this error. I'm using DB2 for my database. PDTFF is new table defined by web2py so it has id field but the others are existing and doesn't have id field. *Traceback (most recent call last):* File C:\web2py\gluon\restricted.py, line 209, in restricted exec ccode in environment File C:/web2py/applications/fedex/controllers/default.py, line 205, in module File C:\web2py\gluon\globals.py, line 187, in lambda self._caller = lambda f: f() File C:\web2py\gluon\tools.py, line 2838, in f return action(*a, **b) File C:/web2py/applications/fedex/controllers/default.py, line 116, in next form = SQLFORM(db.PDTFF,record) File C:\web2py\gluon\sqlhtml.py, line 1038, in __init__ inp = self.widgets.options.widget(field, default) File C:\web2py\gluon\sqlhtml.py, line 226, in widget options = requires[0].options() File C:\web2py\gluon\validators.py, line 2500, in _options options = self.other.options() File C:\web2py\gluon\validators.py, line 484, in options self.build_set() File C:\web2py\gluon\validators.py, line 471, in build_set records = self.dbset(table).select(*fields, **dd) File C:\web2py\gluon\dal.py, line 8726, in __call__ query = self.db._adapter.id_query(query) File C:\web2py\gluon\dal.py, line 631, in id_query return table._id != None File C:\web2py\gluon\dal.py, line 7636, in __getitem__ return ogetattr(self, str(key)) AttributeError: 'Table' object has no attribute '_id' *Function argument list* (self=Table TDMKNP00 (KNCTCD,KNKNCD,KNKNNM), key='_id') *Model* # coding: utf8 # Employee info table on HELPDESK dbh.define_table('tbluser', Field('name', length=255), Field('location', length=255), Field('emailaddress', length=255)) # Dept Master db.define_table('TDMBUP01', Field('BUSEC1', length=3), Field('BUBURK', length=12), primarykey=['BUSEC1']) # Country Master db.define_table('TDMCNP00', Field('CNCNCD', length=3), Field('CNCNNM', length=30), primarykey=['CNCNCD']) # Area 2 Master db.define_table('TDMKNP00', Field('KNCTCD', length=3), Field('KNKNCD', length=2), Field('KNKNNM', length=30), primarykey=['KNCTCD','KNKNCD']) # Purchase Order db.define_table('SDTH2P01', Field('H2DNO', length=8), Field('H2TRD1', 'integer'), Field('H2JJDN', length=8), Field('H2JJGN', 'integer'), Field('H2JDNO', length=8), Field('H2JGNO', 'integer'), Field('H2JCSC', length=3), Field('H2HSKB', length=1), Field('H2KSM', length=3), Field('H2PRCD', length=15), Field('H2PRKJ', length=50), Field('H2TRS', 'integer'), Field('H2HZS', 'integer'), primarykey=['H2DNO']) # Open FedEx Purchase Order db.define_table('SDTH2PF1', Field('H2DNO', length=8), Field('H2TRD1', 'integer'), Field('H2JJDN', length=8), Field('H2JJGN', 'integer'), Field('H2JDNO', length=8), Field('H2JGNO', 'integer'), Field('H2JCSC', length=3), Field('H2HSKB', length=1), Field('H2KSM', length=3), Field('H2PRCD', length=15), Field('H2PRKJ', length=50), Field('H2TRS', 'integer'), Field('H2HZS', 'integer'), primarykey=['H2DNO']) # Received Order db.define_table('SDTJ2P00', Field('J2DNO', length=8), Field('J2GNO', 'integer'), Field('J2TSCD',length=8), Field('J2TSK1',length=35), Field('J2TSK2',length=35), Field('J2TSPE',length=22), Field('J2ODA1',length=30), Field('J2ODA2',length=30), Field('J2ODA7',length=20), Field('J2KNCD',length=2), Field('J2CNCD',length=3), Field('J2OYUB',length=10), Field('J2OTEL',length=20), Field('J2KYSC',length=12), Field('J2NSD','integer'), primarykey=['J2DNO','J2GNO']) # FedEx Request Output file db.define_table('PDTFF', Field('FFDNO', length=8, label='HJ#'), Field('FFTRD', 'date', label=Requested), Field('FFJCSC', length=3, label=Dept), Field('FFBURK', length=12, label=Dept Name), Field('FFJDNO', length=8, label=JJ#), Field('FFJGNO', 'integer', label=JJ line#), Field('FFJJDN', length=8, label=J# (JP)), Field('FFJJGN', 'integer', label=J line# (JP)), Field('FFACCT', length=9, label=FedEx Acct #), Field('FFCUST', length=30, label=Company Name), Field('FFNSD', 'date',label=Delivery Due), Field('FFPRCD', length=15,label=Product Code), Field('FFPRKJ', length=50,label=Part Number), Field('FFTRS', 'integer',label=Quantity), Field('FFTSK1',length=35,label=Name 1), Field('FFTSK2',length=35,label=Name 2), Field('FFTSPE',length=22,label=Attn:), Field('FFODA1',length=30,label=Address 1