Re: [web2py] Re: admin-page and ignore_common_filters

2012-08-21 Thread Martin Weissenboeck
This is the new code: from gluon.fileutils import check_credentials db.auth_group._common_filter=lambda query: \ (db.auth_group.org==session.org) *or check_credentials(request)* I have tested check_credentials(request): it returns True - good! But - sorry! - it did not solve the problem:

[web2py] Re: web2py.css changes for bootstrap

2012-08-21 Thread villas
web2py.css includes styling for common html tags in addition to specific web2py stuff. The loading order in current layout.html is below. {{ response.files.append(URL('static','css/bootstrap.min.css')) response.files.append(URL('static','css/bootstrap-responsive.min.css'))

[web2py] Re: Standalone application (mac/win)

2012-08-21 Thread mmstud
My original application is done few years ago and some things has changed, so I'm getting an error when importing application to the a new web2py. Maybe someone can help what to do with library gluon: Traceback (most recent call last): File gluon/restricted.py, line 205, in restricted File

[web2py] Re: Pre-populate profile form

2012-08-21 Thread Daniel Gonzalez
Correct! Thanks Anthony. On Tuesday, August 21, 2012 1:07:34 AM UTC+2, Anthony wrote: You never processed the form. You have to call form.process() or form.accepts() for your variable assignments to get transferred to the widgets. Anthony On Monday, August 20, 2012 5:30:19 AM UTC-4,

[web2py] Re: web2py.css changes for bootstrap

2012-08-21 Thread Anthony
Are you talking about the stuff at the top of web2py.css marked these MUST stay ( http://code.google.com/p/web2py/source/browse/applications/welcome/static/css/web2py.css#1)? Now that we're using Bootstrap, I think most if not all of that section can probably be cut since Bootstrap already

[web2py] Re: Displaying a message following auth.requires_login() redirect

2012-08-21 Thread Rob Goldsmith
That's perfect, thanks Anthony. On Tuesday, 21 August 2012 00:00:16 UTC+1, Anthony wrote: Maybe try: def failed_authentication(url): session.flash = You must be logged in to view this page redirect(url) auth.settings.on_failed_authentication = failed_authentication Anthony On

[web2py] Re: web2py.css changes for bootstrap

2012-08-21 Thread Michael W
Putting web2py.css at the top of this list fixes many things for me actually, in relation to bootstrap and forms. The only problem left that I see is the div.error rule in web2py.css, it should be less specific so bootstrap or another css framework can override it properly. Michael On

[web2py] TypeError: 'lazyT' object is not callable

2012-08-21 Thread Johann Spies
Something was broken by updates in recent days from the trunk. From this code: response.flash(T(Searching...)) I get the error in the subject line. Previously I could use this without a problem. Regards Johann -- Because experiencing your loyal love is better than life itself, my lips will

[web2py] Router for multiple controllers

2012-08-21 Thread Daniel Gonzalez
Hello, I have the following routing requirements, which I am unable to configure in routes.py: www.mysite.com/hello - application1, controller1, hello www.mysite.com/bye - application1, controller2, bye As you can see, the functions hello and bye are in different controllers. Is it possible

[web2py] Can a table field reference a list?

2012-08-21 Thread lyn2py
Hi guys, db.define_table('activities', Field('name', 'string',length=255,requires=IS_NOT_EMPTY()), Field('description','text'), format='%(name)s' ) db.define_table('activity', Field('user_id','reference auth_user',default=auth.user_id), Field('activity_id','reference

[web2py] Re: Can a table field reference a list?

2012-08-21 Thread JungHyun Kim
As I know, you can write code like, Field('activity_id','list:reference activities'), From official document, http://web2py.com/books/default/chapter/29/6#DAL,-Table,-Field list:reference tableIS_IN_DB(db,table.field,format,multiple=True) 2012년 8월 21일 화요일 오후 6시 24분 9초 UTC+9, lyn2py 님의 말:

[web2py] Re: Can a table field reference a list?

2012-08-21 Thread lyn2py
Sorry I think my language could be off and subject to misinterpretation. I meant, I define a dict like activities = {1:diving,2:swimming,3:skiing} And reference it in the second table. On Tuesday, August 21, 2012 5:24:09 PM UTC+8, lyn2py wrote: Hi guys, db.define_table('activities',

[web2py] Re: Major speed improvement need testers

2012-08-21 Thread simon
This line does not seem to work in latest trunk. Is that because of the new Storage object? session.setdefault(history, []) On Saturday, 18 August 2012 04:00:44 UTC+1, Massimo Di Pierro wrote: There are two major speed improvements in trunk and I am not sure whether they should go in web2py

[web2py] NameError: global name 'requests' is not defined

2012-08-21 Thread Amit
Hi, I am using mailgun libraries to send mail from my web2py application,I followed example given in mailgun site mailgun.com: 1. requests.post((https://api.mailgun.net/v2/samples.mailgun.org/messages;), 2. auth=(api, key-3ax6xnjp29jd6fds4gc373sgvjxteol0), 3. data={ 4.

[web2py] Can you compute fields from another table?

2012-08-21 Thread lyn2py
Can a computed field take values from other tables? Thanks! --

[web2py] Re: NameError: global name 'requests' is not defined

2012-08-21 Thread Niphlod
requests is a cool library (don't confuse that with the request object (without the s) that is available in web2py). Their examples lacks of the import line (import requests). Of course you need to install that to be able to use it with pip install requests. Il giorno martedì 21 agosto 2012

[web2py] bug in dbnew part of ticket-system fixed

2012-08-21 Thread sunny
hi, i came across a bug in the ticket system while trying to switch from filesystem to db. the db_ready variable needs to be returned in admin/controllers/default.py also in the dbnew part. line 1196: return dict(errors = [x[1] for x in decorated], app=app, method=method, db_ready=db_ready)

Re: [web2py] Re: NameError: global name 'requests' is not defined

2012-08-21 Thread Amit
Thanks Niphold :), I installed requests libraries using easy install and able to see requests folder named requests-0.13.8-py2.7.egg in site-packages folder and used import statement like : from requests import * but still getting same error :( what I observed is : there is no module name

Re: [web2py] Re: NameError: global name 'requests' is not defined

2012-08-21 Thread Amit
I resolved the issue, somehow after installing it to Lib/site-packages of python installation path , it has not added to PYTHONPATH, because of that requests is not recognized, i have explicitly added it to the PYTHONPATH then its working fine. Thanks, Amit On Tue, Aug 21, 2012 at 4:02 PM, Amit

[web2py] Nice presentations -- impress.js

2012-08-21 Thread Michele Comitini
http://bartaz.github.com/impress.js mic --

Re: [web2py] Re: admin-page and ignore_common_filters

2012-08-21 Thread Massimo Di Pierro
I think you want: from gluon.fileutils import check_credentials if not *check_credentials(request):* * if not session.org: redirect('some_error_page') * db.auth_group._common_filter=lambda query: (db.auth_group.org== session.org) On Tuesday, 21 August 2012 01:04:38 UTC-5, mweissen

[web2py] Re: Can a table field reference a list?

2012-08-21 Thread Massimo Di Pierro
Do you mean something like this? activities = {1:'diving',2:'swimming',3:'skiing'} Field('activity_id','integer',requires=IS_IN_SET(activities),represent=lambda i: activities[i]) On Tuesday, 21 August 2012 04:24:09 UTC-5, lyn2py wrote: Hi guys, db.define_table('activities',

[web2py] Re: Major speed improvement need testers

2012-08-21 Thread Massimo Di Pierro
What does not work? The new store has for now been reverted. On Tuesday, 21 August 2012 05:07:32 UTC-5, simon wrote: This line does not seem to work in latest trunk. Is that because of the new Storage object? session.setdefault(history, []) On Saturday, 18 August 2012 04:00:44 UTC+1,

[web2py] Re: Can you compute fields from another table?

2012-08-21 Thread Massimo Di Pierro
yes. Field('name',compute=lambda row: db.other_table(row.other_id).other_field) On Tuesday, 21 August 2012 05:11:29 UTC-5, lyn2py wrote: Can a computed field take values from other tables? Thanks! --

[web2py] Re: bug in dbnew part of ticket-system fixed

2012-08-21 Thread Massimo Di Pierro
This should already be fixed in trunk. Thanks for reporting it. On Tuesday, 21 August 2012 05:25:49 UTC-5, sunny wrote: hi, i came across a bug in the ticket system while trying to switch from filesystem to db. the db_ready variable needs to be returned in admin/controllers/default.py

[web2py] How to apply language translation on requires field when showing other table field values.

2012-08-21 Thread Pradeesh
In my application I have to specify a title field as below Field('title', type='string',label=T('Title'),requires=IS_IN_DB(db,db.t_title.id, '%(name)s',orderby=db.t_title.id)) all the title options are mentioned in the t_title table. For example in t_title table I have values Mr. and Mrs. For

[web2py] Re: default tab key behavior change in fields

2012-08-21 Thread max
Hi, This is the script, i have generated but anyhow, it jumps to next key and tries to validate and the it looses focus. Another problem is, my script only work for a certain kind of input fields. is there a way to get all the input fields when i add it into web2py_ajax.html script

[web2py] Re: Nice presentations -- impress.js

2012-08-21 Thread Massimo Di Pierro
I like reveal.js better: Here is the code for markmin - presentation. https://github.com/mdipierro/markmin-reveal-slides Here is a demo: https://dl.dropbox.com/u/18065445/MarkminSlides/test.html This is based on the old markmin2html.py. It should be ported to the newer markmin with

[web2py] Re: I need help understanding an issue with SQLFORM.factory ( in the context of a form wizard )

2012-08-21 Thread Don_X
thank you Anthony for the explanation .. I tried to do it that way, but it does not work .. what am I doing wrong ??? def testpage(): STEPS = {0: ('Iagreeto','first_name','last_name','email','password', 'sex','birth_date','usertype'), # fields for 1st table and first step 1:

[web2py] Re: I need help understanding an issue with SQLFORM.factory ( in the context of a form wizard )

2012-08-21 Thread Don_X
well .. with session.testpage instead of session.wizard in the code pasted above ! --

[web2py] App Cookbook friends.html - class 'sqlite3.OperationalError' no such column: auth_user.first_name

2012-08-21 Thread pjryan126
I'm working through the Friends example in the Web2py Application Cookbook, and when I try the friends.html view, I get the following error: class 'sqlite3.OperationalError' no such column: auth_user.first_name My friends.html view is as follows: {{extend 'layout.html'}} h2Friendship

[web2py] Rocket and concurrency issue when benchmarking on win7

2012-08-21 Thread David Marko
I have latest web2py from trunk, Python 2.7(win7) with standalone web2py (using default Rocket server) . I just benchmarked a simple page without a model (just to see how high I can get when striping all unnecessary code ...) and can see some strange thing for me. To test I'm using apache

[web2py] Re: App Cookbook friends.html - class 'sqlite3.OperationalError' no such column: auth_user.first_name

2012-08-21 Thread Massimo Di Pierro
please try delete eveything in yourapp/databasaes On Tuesday, 21 August 2012 08:35:52 UTC-5, pjryan126 wrote: I'm working through the Friends example in the Web2py Application Cookbook, and when I try the friends.html view, I get the following error: class 'sqlite3.OperationalError' no such

Re: [web2py] Re: Standalone application (mac/win)

2012-08-21 Thread Khalil KHAMLICHI
On windows I 1) download web2py source, 2) install apache (as described in book with wsgi module -don't install certificates if you don't need admin enabled on client machine--) and my web2py app is up and running (you need to create a shortcut of course) I believe should be same thing for mac

[web2py] Re: Rocket and concurrency issue when benchmarking on win7

2012-08-21 Thread Massimo Di Pierro
This is probably an effect of the Python GIL. Python has no real parallelization even if you have concurrency. The more concurrent request the more inefficient it gets, even if (and specifically if) you have multiple computing cores. The way you achieve better performance is by using

[web2py] Re: I need help understanding an issue with SQLFORM.factory ( in the context of a form wizard )

2012-08-21 Thread Don_X
Finally ... Anthony, Thank you Bro ! You are a real prince !!! ... I got it to work in a wizard format with 3 steps 3 tables !! ... My god ! this feels liberating ! My only problem now is with the image upload in the form on the last step ... but that is a separate issue ! ... I

[web2py] menu, mobile phones and tablets

2012-08-21 Thread Martin Weissenboeck
I have played with some menu details and these are my results First try: response.menu = [ (T('Home'), False, URL('default','index'), [ (T('Dummy1'), False, URL('default','index'), [],), (T('Dummy2'), False, None, [],), (T('Desktop'), False, URL('default','index'),

[web2py] Re: default tab key behavior change in fields

2012-08-21 Thread max
All the other small problems other than general integration solved. There i need some help. script src=http://code.jquery.com/jquery-latest.js;/script script type=text/javascript $(document).ready(function(){ //textboxes = $(input.double); //textboxes = $(:input:not(:submit)); textboxes =

[web2py] AttributeError: 'thread._local' object has no attribute 'request'

2012-08-21 Thread Johann Spies
I was stupid enough not to be careful now I have a serious problem. I am using the trunk on my laptop where I do my development. This morning I found that certain functions that works on my laptop does not work on the server (which had a slightly older version of the web2py-trunk). I then

[web2py] Re: AttributeError: 'thread._local' object has no attribute 'request'

2012-08-21 Thread Massimo Di Pierro
People have reported theading issues on GAE with threadsafe: true in app.yaml. Make sure you have threadsafe: false until we get to the bottom to this. On Tuesday, 21 August 2012 09:01:30 UTC-5, Johann Spies wrote: I was stupid enough not to be careful now I have a serious problem. I am

Re: [web2py] Re: admin-page and ignore_common_filters

2012-08-21 Thread Martin Weissenboeck
Maybe I can say it in other words: (1) If I am normal user, I should only see my part of the table and I can work with it. This is perfectly assured by db.auth_group._common_filter=**lambda query: (db.auth_group.org==session.** org http://session.org/) (2) If I am the admin and if I use the

[web2py] Re: Rocket and concurrency issue when benchmarking on win7

2012-08-21 Thread David Marko
I see, so is it the way to limit the max number of threads to e.g. 10, so the system is not killed by the concurrency and as a result I will get 90 req/sec back? Dne úterý, 21. srpna 2012 15:45:58 UTC+2 Massimo Di Pierro napsal(a): This is probably an effect of the Python GIL. Python has no

[web2py] Re: Can a table field reference a list?

2012-08-21 Thread lyn2py
Thanks Massimo once again! On Tuesday, August 21, 2012 9:03:45 PM UTC+8, Massimo Di Pierro wrote: Do you mean something like this? activities = {1:'diving',2:'swimming',3:'skiing'} Field('activity_id','integer',requires=IS_IN_SET(activities),represent=lambda i: activities[i]) On

Re: [web2py] Re: admin-page and ignore_common_filters

2012-08-21 Thread Massimo Di Pierro
Now I understand better. Please open an issue for enhancement and link this thread. For now you'll have to handle with the suggested logic or perhaps: if *request.controller!='appadmin':* * if not session.org: redirect('some_error_page') * db.auth_group._common_filter=lambda query:

[web2py] json - Not Serializable error

2012-08-21 Thread lyn2py
When I perform: rows = db(db.table.id0).select() return rows It is OK But when I perform: rows = db(db.table.id0).select() dummy = [] for r in rows: if some_condition: r.item=False dummy.append(r) else: dummy.append(r) return dummy I get the not serializable

[web2py] Re: Major speed improvement need testers

2012-08-21 Thread simon
This was the error: File C:/web2py/applications/crm/models/db.py http://localhost:8080/admin/default/edit/crm/models/db.py, line 85, in module session.setdefault(history, []) TypeError: 'NoneType' object is not callable However now I get a different error in latest trunk: File

[web2py] Re: menu, mobile phones and tablets

2012-08-21 Thread szimszon
+1 https://groups.google.com/d/msg/web2py-developers/FMCF0HTs64A/CJ-PNCaIsuwJ 2012. augusztus 21., kedd 15:58:27 UTC+2 időpontban mweissen a következőt írta: I have played with some menu details and these are my results First try: response.menu = [ (T('Home'), False,

[web2py] Re: json - Not Serializable error

2012-08-21 Thread lyn2py
I must add that the below code are working when as a normal function that means def myfunc(): rows = db(db.table.id0).select() dummy = [] for r in rows: if some_condition: r.item=False dummy.append(r) else: dummy.append(r) return dummy is OK But @service.json def

[web2py] Re: Rocket and concurrency issue when benchmarking on win7

2012-08-21 Thread Massimo Di Pierro
I think so but this may be server dependent and machine dependent. Async servers probably do not have this problem. On Tuesday, 21 August 2012 09:17:10 UTC-5, David Marko wrote: I see, so is it the way to limit the max number of threads to e.g. 10, so the system is not killed by the

[web2py] Re: Major speed improvement need testers

2012-08-21 Thread Massimo Di Pierro
Thanks for testing this. Can you check this is fixed in trunk? On Tuesday, 21 August 2012 09:44:51 UTC-5, simon wrote: This was the error: File C:/web2py/applications/crm/models/db.py http://localhost:8080/admin/default/edit/crm/models/db.py, line 85, in module

[web2py] Re: menu, mobile phones and tablets

2012-08-21 Thread Massimo Di Pierro
Can you elaborate? Is there a problem that need to be solved? On Tuesday, 21 August 2012 09:46:35 UTC-5, szimszon wrote: +1 https://groups.google.com/d/msg/web2py-developers/FMCF0HTs64A/CJ-PNCaIsuwJ 2012. augusztus 21., kedd 15:58:27 UTC+2 időpontban mweissen a következőt írta: I have

[web2py] Re: json - Not Serializable error

2012-08-21 Thread Massimo Di Pierro
Make sure you have the latest trunk. On Tuesday, 21 August 2012 09:37:56 UTC-5, lyn2py wrote: When I perform: rows = db(db.table.id0).select() return rows It is OK But when I perform: rows = db(db.table.id0).select() dummy = [] for r in rows: if some_condition:

[web2py] Re: json - Not Serializable error

2012-08-21 Thread lyn2py
I have just grabbed a copy of trunk about 12 hours ago. I have just grabbed it again 5 mins ago. Now it won't even let me access the page? I'm quite confused. It doesn't even generate a ticket... On Safari it says the operation cannot be completed. On Tuesday, August 21, 2012 10:54:46 PM

[web2py] Re: need a simple wiki...

2012-08-21 Thread Alan Etkin
Two issues for debugging: -In a new scaffolding app with auth.wiki() appadmin does not show wiki tables, but they are defined (db.tables() return their names). -There's an auth_membership for wiki_editor with user_id set to None, I suppose it was created when loading the wiki feature without a

[web2py] Re: json - Not Serializable error

2012-08-21 Thread lyn2py
To clarify my abve post, I am using this code, and it fails without a ticket: def myfunc(): rows = db(db.table.id0).select() dummy = [] for r in rows: if some_condition: r.item=False dummy.append(r) else: dummy.append(r) return dummy And I get a not serializable

[web2py] Re: How to apply language translation on requires field when showing other table field values.

2012-08-21 Thread Anthony
Try: IS_IN_DB(db, db.t_title.id, lambda r: T(r.name), orderby=db.t_title.id) The label argument to IS_IN_DB can be a function that takes a Row object and returns a label for that row. Anthony On Tuesday, August 21, 2012 9:12:22 AM UTC-4, Pradeeshnarayan wrote: In my application I have to

[web2py] How to extend IMG to preprocess url

2012-08-21 Thread Angelo Compagnucci
Hi guys, Any advice on howto extend IMG to preprocess url? I simply want to mangle url before it passed to IMG and this should be done every time an IMG tag is used. Thanks! -- Profile: http://it.linkedin.com/in/compagnucciangelo --

[web2py] Re: Major speed improvement need testers

2012-08-21 Thread simon
yes it works now. On Tuesday, 21 August 2012 15:52:29 UTC+1, Massimo Di Pierro wrote: Thanks for testing this. Can you check this is fixed in trunk? On Tuesday, 21 August 2012 09:44:51 UTC-5, simon wrote: This was the error: File C:/web2py/applications/crm/models/db.py

[web2py] Re: Standalone application (mac/win)

2012-08-21 Thread Alan Etkin
Do you want to use web2py features from a desktop application? For importing web2py features from other software there is https://github.com/mdipierro/gluino For wxPython and web2py integration check gui2pyhttp://code.google.com/p/gui2py/ If you just want your web2py to be available in a given

[web2py] Re: How to extend IMG to preprocess url

2012-08-21 Thread Anthony
Maybe something like: class MYIMG(IMG): def __init__(self, *components, **attributes): if '_src' in attributes: attributes['_src'] = mangle(attributes['_src']) return super(MYIMG, self).__init__(*components, **attributes) Then you can do: MYIMG(_src=URL('static',

Re: [web2py] Re: menu, mobile phones and tablets

2012-08-21 Thread Martin Weissenboeck
Proposal: In gluon/html.py, line 2200 I have changed from def serialize_mobile(self, data, select=None, prefix=''): if not select: select = SELECT(**self.attributes) for item in data: if len(item) = 4 or item[4] == True: * if item[2]:

Re: [web2py] Re: admin-page and ignore_common_filters

2012-08-21 Thread Martin Weissenboeck
Done - thank you! 2012/8/21 Massimo Di Pierro massimo.dipie...@gmail.com Now I understand better. Please open an issue for enhancement and link this thread. For now you'll have to handle with the suggested logic or perhaps: if *request.controller!='appadmin':* * if not session.org:

Re: [web2py] Re: Nice presentations -- impress.js

2012-08-21 Thread adesantoasman
T +adesst -Original Message- From: Massimo Di Pierro massimo.dipie...@gmail.com Sender: web2py@googlegroups.com Date: Tue, 21 Aug 2012 06:15:57 To: web2py@googlegroups.com Reply-To: web2py@googlegroups.com Subject: [web2py] Re: Nice presentations -- impress.js I like reveal.js better:

[web2py] Re: Web2Py compute fields not working on update

2012-08-21 Thread Brandon Reynolds
Thank you so much i got it working. I removed the readable=false and writable=false and it works on update now. Those are not needed anyway because when the compute field is added on the model it hides it automatically. Brandon On Thursday, August 9, 2012 2:14:42 PM UTC-6, Deidre wrote:

Re: [web2py] Re: How to extend IMG to preprocess url

2012-08-21 Thread Angelo Compagnucci
Wow! I'll try ASAP, thank you! 2012/8/21 Anthony abasta...@gmail.com Maybe something like: class MYIMG(IMG): def __init__(self, *components, **attributes): if '_src' in attributes: attributes['_src'] = mangle(attributes['_src']) return super(MYIMG,

[web2py] Re: Router for multiple controllers

2012-08-21 Thread howesc
routes_in = ( ('/hello', '/app1/controller1/hello'), ('/bye', '/app1/controller1/bye')) On Tuesday, August 21, 2012 1:28:49 AM UTC-7, Daniel Gonzalez wrote: Hello, I have the following routing requirements, which I am unable to configure in routes.py: www.mysite.com/hello -

[web2py] SEO Friendly URLs and Page Titles

2012-08-21 Thread SeamusSeamus
1. What is the easiest way to make it so each page has it's own title? Currently it is set by layout.html, but what if I want its own page to have an independent title? 2. How can I make it so the title of the page is the name of a field in a model? I am using SQLForm now, and have /product/1

Re: [web2py] Re: Standalone application (mac/win)

2012-08-21 Thread Khalil KHAMLICHI
with apache installed you don't have to worry about starting services or restarting them, its all handled for you for free ! also apache is a very solid and well tested platform. On Tue, Aug 21, 2012 at 4:44 PM, Alan Etkin spame...@gmail.com wrote: Do you want to use web2py features from a

[web2py] Re: SEO Friendly URLs and Page Titles

2012-08-21 Thread Anthony
You can set response.title and response.meta in the controller or function to make it specific to particular controllers or functions (or you can set them conditionally in a model file). If you need to use a database value, just do a query to get the value (your probably want to cache it to

[web2py] Clearing session for single user

2012-08-21 Thread Yarin
Is it possible to clear a session for a single user? Currently, if we need to block user access, we must delete the user record or set registration key = blocked, and then clear session for the entire site. Is there a better way? --

Re: [web2py] Clearing session for single user

2012-08-21 Thread Khalil KHAMLICHI
I believe if you store sessions in db (which is very easy and out of the box if you opt for it), you can delete entry of user from it to disconnect him instantly, without affecting other users. this table has a name like : web2py_session_YourApplicationName Regards On Tue, Aug 21, 2012 at 6:22

Re: [web2py] Clearing session for single user

2012-08-21 Thread Yarin
Khali- I've never seen a session table in web2py before. Neither basic app nor wizard-generated nor welcome app have one- where have you seen this? On Tuesday, August 21, 2012 1:31:04 PM UTC-4, Khalil KHAMLICHI wrote: I believe if you store sessions in db (which is very easy and out of the

[web2py] Re: SQLFORM.factory + Multiple Tables + Upload Field + GAE Blob Problem

2012-08-21 Thread JungHyun Kim
I found a work around to solve this problem I added these 3 lines after form accepted if request.env.web2py_runtime_gae: request.vars.file.file.seek(0) form.vars.file_blob = request.vars.file.file.read() Cause file_blob was None, I just

[web2py] Re: need a simple wiki...

2012-08-21 Thread Rob_McC
Do I have to set something to get this to embedd youtube? Thanks, Rob ## Index Rob page content http://youtu.be/AHBjHCAUjus On Monday, August 20, 2012 9:30:09 PM UTC-4, Massimo Di Pierro wrote: I think the problem is that we broke trunk as we are running some tests... On Monday, 20

Re: [web2py] Re: menu, mobile phones and tablets

2012-08-21 Thread Massimo Di Pierro
Can you email me the patch? On Tuesday, 21 August 2012 10:59:21 UTC-5, mweissen wrote: Proposal: In gluon/html.py, line 2200 I have changed from def serialize_mobile(self, data, select=None, prefix=''): if not select: select = SELECT(**self.attributes) for

[web2py] Re: need a simple wiki...

2012-08-21 Thread Massimo Di Pierro
You have to use http://www.youtube.com/watch?v=AHBjHCAUjus else web2py does not know what oembed service to use. youtu.be is not a well known oembed service provider. On Tuesday, 21 August 2012 13:20:08 UTC-5, Rob_McC wrote: Do I have to set something to get this to embedd youtube?

Re: [web2py] Clearing session for single user

2012-08-21 Thread Khalil KHAMLICHI
pretty easy just after db definition example : db = DAL('postgres://postgres:Nour@localhost/asterisk') add this line : session.connect(request, response, db, masterapp=None) refresh and look inside database for a table called : web2py_session_YourAppNameHere On Tue, Aug 21, 2012 at 6:44 PM,

[web2py] Re: Clearing session for single user

2012-08-21 Thread Niphlod
the relevant book session is http://web2py.com/books/default/chapter/29/13#Sessions-in-database file sessions of db won't save you. You are in the need of having to know the relationship between session and user_id. Every app has different requirements, so you could implement the logic to

[web2py] Re: Clearing session for single user

2012-08-21 Thread Yarin
Perfect- this will get me there- thanks both On Tuesday, August 21, 2012 2:40:31 PM UTC-4, Niphlod wrote: the relevant book section is http://web2py.com/books/default/chapter/29/13#Sessions-in-database However, file sessions of db won't save you. You are in the need of having to know the

Re: [web2py] Re: Clearing session for single user

2012-08-21 Thread Khalil KHAMLICHI
You are right without some additional work to map users to session IDs its useless, but there are many ways from there : for example every user must have his own IP you can easily map a user to an ip upon login for example by using : auth.settings.login_onaccept = lambda func: usr_connect()

[web2py] Re: need a simple wiki...

2012-08-21 Thread Tim Michelsen
I reverted trunk to the older Storage but this is not the end of this. We are still working to replace it in a backward compatible way OK, now it works. But why do I always get Registration needs Verification? Can this be switched off? --

[web2py] Re: Router for multiple controllers

2012-08-21 Thread Derek
wrong. routes_in = ( ('/hello', '/app1/controller1/hello'), ('/bye', '/app1/controller*2*/bye')) On Tuesday, August 21, 2012 9:42:27 AM UTC-7, howesc wrote: routes_in = ( ('/hello', '/app1/controller1/hello'), ('/bye', '/app1/controller1/bye')) On Tuesday, August 21, 2012 1:28:49

Re: [web2py] Re: Router for multiple controllers

2012-08-21 Thread Christian Foster Howes
that's what i get for typing so quickly! thanks for spotting my mistake. :) On 8/21/12 12:15 , Derek wrote: wrong. routes_in = ( ('/hello', '/app1/controller1/hello'), ('/bye', '/app1/controller*2*/bye')) On Tuesday, August 21, 2012 9:42:27 AM UTC-7, howesc wrote: routes_in = ( ('/hello',

[web2py] Re: Clearing session for single user

2012-08-21 Thread Anthony
You could have a function that goes through each session file and looks for auth.user.id, and if it matches the id of the blocked user, delete the file. For some ideas on the logic for processing through all the session files, see

Re: [web2py] Re: Router for multiple controllers

2012-08-21 Thread Daniel Gonzalez
Thanks howesc and Derek, Your solution is working, but it is conflicting with routers. This is my full routes.py: routers = dict( BASE = dict( default_application = 'app1', ), myapp = dict( default_controller = 'controller1', default_function = 'start',

Re: [web2py] Re: Router for multiple controllers

2012-08-21 Thread Christian Foster Howes
i *think* it is one or the other, but not both. :( there may be a routers equivalent to my suggestion, but i don't know it. :( i know that you can convert routers into the routes_in/routes_out style. On 8/21/12 12:41 , Daniel Gonzalez wrote: Thanks howesc and Derek, Your solution is

Re: [web2py] Re: Router for multiple controllers

2012-08-21 Thread Anthony
No, the parameter-based and pattern-based rewrite systems are mutually exclusive -- you cannot combine them (mentioned at the end of the second paragraph here: http://web2py.com/books/default/chapter/29/4#URL-rewrite). Anthony On Tuesday, August 21, 2012 3:41:11 PM UTC-4, Daniel Gonzalez

[web2py] timezone support in dal, assumes local time is gmt time

2012-08-21 Thread Tim Michelsen
Could you explain this functionality, its application and settings? https://github.com/web2py/web2py/commit/ed485d38abe90e2c8f6578252d69fa9ebd4b98c1 --

[web2py] Re: SEO Friendly URLs and Page Titles

2012-08-21 Thread SeamusSeamus
Thanks, what about URLs so it is www.domain.com/product/{{fieldname title}} On Tuesday, August 21, 2012 10:56:49 AM UTC-6, Anthony wrote: You can set response.title and response.meta in the controller or function to make it specific to particular controllers or functions (or you can set

[web2py] Field to get file path

2012-08-21 Thread Simon Carr
Hi, I want to create a field where a user can select a file. But I dont want to upload the file, I just want to record the file path in the database. How do I do this? Thanks Simon --

[web2py] Re: Field to get file path

2012-08-21 Thread Anthony
Are you saying you want to record the file path of the file on the user's machine? I'm not sure that's possible without some kind of browser plugin, as it would present a security risk (i.e., the browser won't send that information to the server). Anthony On Tuesday, August 21, 2012 4:32:01

[web2py] Re: SEO Friendly URLs and Page Titles

2012-08-21 Thread Anthony
What is {{fieldname title}}? How do you get that value? On Tuesday, August 21, 2012 4:31:54 PM UTC-4, SeamusSeamus wrote: Thanks, what about URLs so it is www.domain.com/product/{{fieldnamehttp://www.domain.com/product/%7B%7Bfieldnametitle}} On Tuesday, August 21, 2012 10:56:49 AM UTC-6,

Re: [web2py] Re: Field to get file path

2012-08-21 Thread Simon Carr
OK, I will just have to have the user paste in the file path. Not a problem. Simon On 21 August 2012 21:42, Anthony abasta...@gmail.com wrote: Are you saying you want to record the file path of the file on the user's machine? I'm not sure that's possible without some kind of browser plugin,

[web2py] Hiding items in foreign key dropdown menus?

2012-08-21 Thread joe
I have a support table with the field 'isactive', which is a boolean. When someone is adding to a table that is supported by the first table, I want only items with isactive as True to be included in the dropdown. Here is some simplified example code: model --

[web2py] Re: need a simple wiki...

2012-08-21 Thread Rob_McC
Thanks ! works perfectly. youtu.be is not a well known oembed service provider. Funny the http://youtu.be/theVideoID tag, is all they've been using to SHARE a link lately. Also, the markmin syntax seems to work well. http://web2py.com/examples/static/markmin.html

[web2py] Re: SEO Friendly URLs and Page Titles

2012-08-21 Thread SeamusSeamus
I didnt mean to do {{ }}, but I mean domain.com/product/productname (Product name being the name of the variable in the field from the model) On Tuesday, August 21, 2012 2:43:35 PM UTC-6, Anthony wrote: What is {{fieldname title}}? How do you get that value? On Tuesday, August 21, 2012

[web2py] Re: Hiding items in foreign key dropdown menus?

2012-08-21 Thread villas
IS_IN_DB can take a set. It is mentioned in the book. Use something like: db(db.fruits.isactive==True) in place of db.fruits On Tuesday, August 21, 2012 10:13:52 PM UTC+1, joe wrote: I have a support table with the field 'isactive', which is a boolean. When someone is adding to a table

Re: [web2py] Re: SEO Friendly URLs and Page Titles

2012-08-21 Thread Bruno Rocha
You want to create a slug? web2py comes with IS_SLUG validator which helps with this. db.define_table(product, Field(title, unique=True), ... ... Field(slug, compute=lambda row: IS_SLUG()(row.title)[0] ) So now you can use slug field to build your urls. URL(product, show,

[web2py] Re: IS_IN_DB cannot pull the data from the table

2012-08-21 Thread Omi Chiba
Is there any other way I can try ? I can see the data in the both table no problem. It just cannot use IS_IN_DB function for it. On Monday, August 20, 2012 2:33:39 PM UTC-5, Omi Chiba wrote: Is the problem only in appadmin? No, it happnes anywhere. Can you produce a minimum program with

[web2py] Re: timezone support in dal, assumes local time is gmt time

2012-08-21 Thread Massimo Di Pierro
http://code.google.com/p/web2py/issues/detail?id=941can=1q=timezone For now it simply allows you to pass a string with a +04:00 timezone and it converts it to GMT. On Tuesday, 21 August 2012 15:20:46 UTC-5, Timmie wrote: Could you explain this functionality, its application and settings?

  1   2   >