[web2py] How to set Reset password key programmatically?
Hey everybody, I added a couple of users programmatically as suggested on the mailing list using my_crypt = CRYPT(key=auth.settings.hmac_key) crypt_pass = my_crypt(passw)[0] id_user= db.auth_user.insert(username = username, email = email, password = crypt_pass) That's perfectly fine, but... the newly created users lack a *Reset password key* How would I assign a Reset password key when creating users programmatically, so that users later can retrieve their password? Anybody could share a code snippet? Cheers Toby -- 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] Is there any way to host PHP w/ Web2py on Nginx environment? PHP noob but long time Web2py user here
Hello Web2py users, My site requires a JS script library that requires a PHP file and I just don't have any idea how I should enable PHP on my Web2py site. Is there any way to host PHP w/ Web2py on Nginx environment Ubuntu? Thank you. -- 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: max value in linked tables
db.employee_contract.contract_id == db.contract.id) (db.employee_contract.employee_id == db.employee.id I think you should do it: contracts = ((db.employee_contract.contract_id == db.contract.id) (db.employee_contract.employee_id == db.employee.id)) rows = db(contracts).select(db.employee.ALL, db.contract.ALL, orderby=db.employee.id|~db.contract.start_date, distinct=db.employee.id) On Sunday, 28 December 2014 15:57:10 UTC-6, JaapP wrote: Hi, Any hints about how to tackle the following problem greatly appreciated: given three tables: *employee*: id name ... *contract*: id start_date fte100 ... *employee_contract:* id employee_id contract_id An employee can have one or more contracs; they are linked through the employee_contract table. I would like to find a query that returns the contract details for the latest contract for an employee; i've solved a little step of my puzzle and can retrieve the latest contract by doing something like this: employee_id = 10 contr = db( (db.employee.id == employee_id) (db.employee_contract.contract_id == db.contract.id) (db.employee_contract.employee_id == db.employee.id) ).select(db.employee.ALL, db.contract.start_date.max()) latest_start_date = contr.contract.start_date.max() but i need also the corresponding contract.fte100 field. Can this be done by using the DAL, or should i construct a loop to find the answer? Best regards, Jaap -- 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: Auth Users Session
If the purpose is to allow users to authenticate with one all and login with others, I suggest you use CAS. If apps are distinct, they should have different sessions else you risk of breaking something. Massimo On Thursday, 18 December 2014 08:36:22 UTC-6, Oliver wrote: Hi All, I really enjoy discovering the beauty of web2py. Just got a newbie question :) If I create multiple apps and use one db or sharing one db to all apps, can the login session be shared between apps? Thanks. For example from the default, we have the admin(which is lock), welcome and example apps. Can welcome and example apps share the same auth_users session to members only pages? I know the db can be shared but not sure if the session can be shared thru different apps. Thanks all. -- 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: Migrate sessions from files to DB
In the old days it was possible to switch from file based and db based and old sessions would be migrated automatically. We made mani changes to the session logic and I have not tested whether this still works. Perhaps you can help use. create a simple session with a counter. def index(): session.counter = (session.counter or 0)+1 return str(session.counter) reload a few times to increase the counter, than add session.connect(request, response, db=db) reload and see if counter continues or is reset to zero. Let us know. On Friday, 19 December 2014 01:03:31 UTC-6, harsha tanguturi wrote: The sessions are being stored in the files but I would like to migrate them to DB without disturbing the existing 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] Re: interget or string to date
much simpler. :-) db.FEDEXFORM.FFNSD.default = datetime.datetime.strptime(jj.J2NSD,'%Y%m%d') On Wednesday, 2 November 2011 10:19:39 UTC-5, Omi Chiba wrote: This is more like python question but jj.J2NSD is integer and has value = 2030 (MMDD) I want to set the value as default value of FFNSD which is 'date' type. Field('FFNSD', 'date'), I think I need to import datetime and convert from integer or stiring. Is anyone know easy way to do it ? This doesn't work because it set string to date... db.FEDEXFORM.FFNSD.default = str(jj.J2NSD)[0:4]+-+str(jj.J2NSD) [4:6]+-+str(jj.J2NSD)[6:8] -- 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: Managing 600MB size files on Google Cloud with web2py
I'm looking for a similar solution widht google cloud store. El miércoles, 23 de julio de 2014 11:27:29 UTC+2, Giacomo Dorigo escribió: Hello everybody, I am writing an app for storing and delivering files more or less from 3 up to 600Mb size. I would like to rely on Google App Engine for running my web2py instance. What I am wondering if it's better to store the data directly in the Google not relational datastore (Google Cloud Datastore), or to upload them to the Google relational MySQL version (Google Cloud SQL), or in the end to implement the upload/download to the Google Cloud Storage treating it as alternative uploadfs. Does anybody have any suggestion or experience on this topic? Thanks. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] database select from set encoding
hello I have a postgres dabatabase with utf8 encoding after executing workersDb = db(db.worker.w_organisation == org).select(db.worker.id, db.worker.w_nick_name).as_list() I get a list of dict where my strings are endoed as 'Moj\xc4\x8dca' where it should write Mojčca How do i set the encoding? Thank you -- 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: Stream cStringIO
Thank you! Yes, it worked, but maybe it should be added into the response.stream code itself? 2014-12-27 2:27 GMT+04:00 Niphlod niph...@gmail.com: the docstrings api on web2py.com/examples/epydoc are reeeally old and buggy. The new api documentation is on readthedocs http://web2py.readthedocs.org/en/latest/ Now... if you want to pass a StringIO to response.stream, you have to rewind it to 0 before passing it s = cStringIO.StringIO() rows.export_to_csv_file(s, represent=False) s.seek(0) #--- return response.stream(s, attachment=True, filename='categories.csv') -- 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/71tdm80FVls/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] navbar in sqlform.grid
Hello My navbar user button does not show dropdown options when I am in a view where SQLFORM.grid is? Any suggestions why? -- 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: Stream cStringIO
nope. you could want to stream something at the middle of the stringio constructed stream. Dealing with seek() is basic python 101. On Monday, December 29, 2014 3:03:45 PM UTC+1, flagist0 wrote: Thank you! Yes, it worked, but maybe it should be added into the response.stream code itself? 2014-12-27 2:27 GMT+04:00 Niphlod nip...@gmail.com javascript:: the docstrings api on web2py.com/examples/epydoc are reeeally old and buggy. The new api documentation is on readthedocs http://web2py.readthedocs.org/en/latest/ Now... if you want to pass a StringIO to response.stream, you have to rewind it to 0 before passing it s = cStringIO.StringIO() rows.export_to_csv_file(s, represent=False) s.seek(0) #--- return response.stream(s, attachment=True, filename='categories.csv') -- 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/71tdm80FVls/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: Daily task on production: scheduler or cron?
Thanks Niphlod for your tips. The idea of having a separate db for the scheduler crossed my mind when I noticed the db parameter for the Scheduler constructor; however, in my case, I have **multiple instances of web2py** (instead of a single instance with multiple apps), like this: /var/www/web2py1/web2py.py /var/www/web2py1/applications/myapp /var/www/web2py1/applications/myapp/models/scheduler.py /var/www/web2py2/web2py.py /var/www/web2py2/applications/myapp /var/www/web2py2/applications/myapp/models/scheduler.py /var/www/web2py3/web2py.py /var/www/web2py3/applications/myapp /var/www/web2py3/applications/myapp/models/scheduler.py so I guess it's not possible to run only one scheduler (using the web2py.py of the first instance) and getting it execute the tasks queued by the other web2py instances, in spite of they are using the same db for the scheduling. Please correct me if I'm wrong. If I'm correct about last thing, and, considering that I don't want to depend on OS cron, then question is: would it be correct to queue the task in the follow way? scheduler.queue_task( send_newsletter, # the function that sends the newsletter start_time=first_execution, # first_execution would be, for example, tomorrow at 8am period=86400,# one day, expressed in seconds repeats = 0 # unlimited repeats ) That is, the task is queued one first time, with a period of one day and unlimited repeats. If this is the case, would it make sense to set the scheduler's heartbeat to, let's say, 10 minutes or more? 2014-12-24 15:03 GMT-03:00 Niphlod niph...@gmail.com: a) Some people never consider this as a possibility, but if you have 3 apps, e.g. app1, app2 and app3, you can run one scheduler for all applications. The default mode is built to process by default tasks coming from the same app that queues them, but the switch is still there: application_name... The only thing to make sure would be to queue tasks with the explicit application_name='.', e.g. mysched.queue_task(thefunction, , application_name='app1') . In that way you can even queue a task defined in app2 from app1. If instead your defined tasks in app1 are queued only within app1, the explicit application_name is not needed. Of course, the database used by the scheduler would have to be the same, and once it's the same, no matter what appname you pass to the -K parameter...it will process any task queued in there (i.e. from ALL apps) without issues. b) If you don't care about leaving the possibility up to the users to receive those notification at ultra-fine-grained times, e.g. 2:37AM, but only e.g. at 00:00, 00:30, 01:00 (every half hour) and so on, you can avoid having the scheduler always active you can istantiate it with mysched = Scheduler(dbsched, max_empty_runs=10) and start the scheduler with web2py.py -K app1 every half hour. A worker will then fired up, will process all queued tasks and then it be terminated automatically after 10 empty loops, i.e. 10 rounds where no new tasks are found. I use a lot this pattern for e.g., a high number of tasks that needs to be processed before arriving at the office, at 6:00am. The usecase is pretty much leave all the raw data coming in during the day, aggregate and do some report on it at fixed intervals. in my case, I know that during the day tasks gets queued, but I only need to run them (aggregation and reporting) by 7:00am on the next morning, so I just start the scheduler at 6:00am, let it process all the backlog and then die gracefully when there's no work to do. c) to have the task execute on the exact same time every day, you're encouraged to pass also the prevent_drift parameter set to True. This is explained in the book... quote: *Default behavior: The time period is not calculated between the END of the first round and the START of the next, but from the START time of the first round to the START time of the next cycle). This can cause accumulating 'drift' in the start time of a job. After v 2.8.2, a new parameter prevent_drift was added, defaulting to False. If set to True when queing a task, the start_time parameter will take precedence over the period, preventing drift* -- 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/LZYGjEX3bXg/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) -
[web2py] Re: navbar in sqlform.grid
Can you show some code? -Jim On Monday, December 29, 2014 8:30:31 AM UTC-6, Yebach wrote: Hello My navbar user button does not show dropdown options when I am in a view where SQLFORM.grid is? Any suggestions why? -- 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] database select from set encoding
El Mon, 29 Dec 2014 05:53:37 -0800 (PST) Yebach vid.og...@gmail.com escribió: hello I have a postgres dabatabase with utf8 encoding after executing workersDb = db(db.worker.w_organisation == org).select(db.worker.id, db.worker.w_nick_name).as_list() I get a list of dict where my strings are endoed as 'Moj\xc4\x8dca' where it should write Mojčca How do i set the encoding? Thank you right at the end of the section http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Connection-strings--the-uri-parameter- Marco. -- 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: Is there any way to host PHP w/ Web2py on Nginx environment? PHP noob but long time Web2py user here
It's possible, however a better option would be for you to rewrite the php functionality in a web2py controller function. -- 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: Rocket // HTTP 400 Bad Request - Body is incomplete
/location/index/espace-de-stockage/la-seyne-sur-mer/1 copystream called with size=672 /error/ticket/index/ copystream called with size=672 class 'socket.timeout' timed out /error/ticket/index/ copystream called with size=672 class 'socket.timeout' timed out /error/ticket/index/ copystream called with size=672 class 'socket.timeout' timed out /error/ticket/index/ copystream called with size=672 class 'socket.timeout' timed out From what I understand the POST request is sent 4 times. The first time, an exception is found so a ticket request is sent to my error application that handles tickets (configured in routes_onerror). So the next 3 requests are sent to my ticket handler but they end up raising an IOError due to this line in fileutils.py (L465): data = src.read(size) The IOError itself gives little information. It just prints timed out. What bothers me though is that this error causes a top-level python error that completely stalls the server: I had to close my shell to actually shut it down. -- 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: Rocket // HTTP 400 Bad Request - Body is incomplete
This is the request received by my ticket handler (I removed some big chunks so that it's readable): _vars None function index _body None args [] wsgi gluon.main.LazyWSGI object at 0x111e5cdd0 controller ticket utcnow 2014-12-29 18:09:42.485011 url /error/ticket/index/ step None now 2014-12-29 19:09:42.484998 is_local True is_shell None uuid error/127.0.0.1.2014-12-29.19-09-42.95417662-6fed-4364-8f6a-f9e467f66bb6 extension html cid None _post_vars None _get_vars None ajax False is_https False is_sheduler None application error client 127.0.0.1 is_restful False And this is request.env (raw data): content_length 672 HTTP_REFERER http://localhost:8000/location/index/espace-de-stockage/la-seyne-sur-mer/1 SERVER_SOFTWARE Rocket 1.2.6 SCRIPT_NAME REQUEST_METHOD POST HTTP_ORIGIN http://localhost:8000 SERVER_PROTOCOL HTTP/1.1 web2py_path /opt/web2py-prod CONTENT_LENGTH 672 wsgi_url_scheme http server_name Orbital Station WEB2PY_STATUS_CODE 500 wsgi_errors open file 'stderr', mode 'w' at 0x10c5fd1e0 web2py_version 2.9.11-stable+timestamp.2014.09.15.23.35.11 wsgi_multiprocess False wsgi.version (1, 0) HTTP_CACHE_CONTROL max-age=0 HTTP_CONTENT_TYPE multipart/form-data; boundary=WebKitFormBoundarybsXFgXJZPAWZABTt request_uri /error/ticket/index?code=500ticket=jestocke/127.0.0.1.2014-12-29.19-09-42.ac14c293-9460-46df-934c-d6da0579c5acrequested_uri=%2Fjestocke%2Ffr%2Flocation%2Findex%2Fespace-de-stockage%2Fla-seyne-sur-mer%2F1request_url=/location/index/espace-de-stockage/la-seyne-sur-mer/1 HTTP_ACCEPT text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 __ROUTES_ONERROR__ True http_connection keep-alive local_hosts ['Orbital Station', '::1', ':::127.0.0.1', '127.0.0.1'] script_name wsgi.multiprocess False http_accept_encoding gzip, deflate __routes_onerror__ True PATH_INFO /error/ticket/index/ http_origin http://localhost:8000 QUERY_STRING code=500ticket=jestocke/127.0.0.1.2014-12-29.19-09-42.ac14c293-9460-46df-934c-d6da0579c5acrequested_uri=%2Fjestocke%2Ffr%2Flocation%2Findex%2Fespace-de-stockage%2Fla-seyne-sur-mer%2F1request_url=/location/index/espace-de-stockage/la-seyne-sur-mer/1 cmd_args [] http_accept text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 HTTP_USER_AGENT Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36 HTTP_CONNECTION keep-alive REMOTE_ADDR 127.0.0.1 http_accept_language fr,en-US;q=0.8,en;q=0.6,de;q=0.4,ja;q=0.2 wsgi.url_scheme http is_source True server_port 8000 gluon_parent /opt/web2py-prod HTTP_DNT 1 http_content_length 672 wsgi.multithread True query_string code=500ticket=jestocke/127.0.0.1.2014-12-29.19-09-42.ac14c293-9460-46df-934c-d6da0579c5acrequested_uri=%2Fjestocke%2Ffr%2Flocation%2Findex%2Fespace-de-stockage%2Fla-seyne-sur-mer%2F1request_url=/location/index/espace-de-stockage/la-seyne-sur-mer/1 wsgi_run_once False wsgi.file_wrapper wsgiref.util.FileWrapper HTTP_ACCEPT_ENCODING gzip, deflate http_cache_control max-age=0 REMOTE_PORT 60871 wsgi_file_wrapper wsgiref.util.FileWrapper applications_parent /opt/web2py-prod request_method POST WEB2PY_ORIGINAL_URI /location/index/espace-de-stockage/la-seyne-sur-mer/1 SERVER_PORT 8000 http_content_type multipart/form-data; boundary=WebKitFormBoundarybsXFgXJZPAWZABTt web2py_original_uri /error/ticket/index/?code=500ticket=jestocke/127.0.0.1.2014-12-29.19-09-42.ac14c293-9460-46df-934c-d6da0579c5acrequested_uri=%2Fjestocke%2Ffr%2Flocation%2Findex%2Fespace-de-stockage%2Fla-seyne-sur-mer%2F1request_url=/location/index/espace-de-stockage/la-seyne-sur-mer/1 wsgi_multithread True web2py_status_code 500 HTTP_HOST localhost:8000 content_type multipart/form-data; boundary=WebKitFormBoundarybsXFgXJZPAWZABTt REQUEST_URI /jestocke/fr/location/index/espace-de-stockage/la-seyne-sur-mer/1 wsgi.run_once False wsgi.errors open file 'stderr', mode 'w' at 0x10c5fd1e0 HTTP_ACCEPT_LANGUAGE fr,en-US;q=0.8,en;q=0.6,de;q=0.4,ja;q=0.2 app_folders set(['/opt/web2py-prod/applications/admin/', '/opt/web2py-prod/applications/jestocke/', '/opt/web2py-prod/applications/error/']) HTTP_CONTENT_LENGTH 672 debugging False http_user_agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36 server_protocol HTTP/1.1 SERVER_NAME Orbital Station remote_addr 127.0.0.1 is_jython False wsgi_version (1, 0) wsgi_input socket._fileobject object at 0x111d71a50 server_software Rocket 1.2.6 wsgi.input socket._fileobject object at 0x111d71a50 http_host localhost:8000 path_info /error/ticket/index/ http_referer http://localhost:8000/location/index/espace-de-stockage/la-seyne-sur-mer/1 is_pypy False remote_port 60871 db_sessions set([]) http_dnt 1 CONTENT_TYPE multipart/form-data; boundary=WebKitFormBoundarybsXFgXJZPAWZABTt folder
[web2py] web2py and elasticsearch
Hi all, Could you suggest the way to marry web2py and elasticsearch (http://www.elasticsearch.org/overview/elasticsearch). I have found solution for Whoosh and Solr (https://github.com/mdipierro/web2py-haystack) but don't know how to adjust it for elasticsearch. Any suggestion and ideas will be mostly appreciated. Andrey -- 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] Auto detect of video file through url link while posting link
Hi Massimo, First of all have a Great year forward, I have no match with your knowledge of awesome web2py, most of things in which i have familiar, *When manually attaching a video link (from YouTube, Vimeo, etc) to a post , is there a way so that it automatically recognise the video link*.for example --Facebook automatically recognizes the link as a video, and allows the resulting status message to play the video inline. The video is displayed as an embedded player in the Wall or News feed. Exactly the same thing which i want to do. Please help me, as i have tried everything but the result is not as per expectation. now you are the boss. Thanks in Advance Professor -- 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: upper with Cyrillic
I use sqlite, but it turned out that sqlite not work functions Upper and Lover with Cyrillic In postgres Upper, Lover working correctly понедельник, 24 ноября 2014 г., 1:04:43 UTC+7 пользователь Massimo Di Pierro написал: Good question. No idea. left left hand side asked the database to perform capitalization in unicode. The right hand side does it in python. There is no guarante they will use the same rules for cyrillic. You can try: db.wanted.fam.upper()==fam.decode('utf8').upper().encode('utf8') but I cannot promise it works. On Saturday, 22 November 2014 21:33:00 UTC-6, Александр Остыловский wrote: how to get to work upper with Cyrillic ? db.wanted.fam.upper()==fam.upper() -- 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] setup-web2py-nginx-uwsgi-ubuntu.sh
Hello! Run on ubuntu 14.04 installation of nginx-uwsgi with a script that comes with web2py directory scripts: sudo ./setup-web2py-nginx-uwsgi-ubuntu.sh During installation, it asked in particular e-mail, password. I go to the browser to 127.0.0.1. web2py says he works (it is clear that even with nginx). But when you try to log into the administrative interface says Admin is disabled, since it is impossible to gain access to the password file -- 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 clause in controller formatted table
what is syntax for represents statement for this controller-styled table? def list_users(): btn = lambda row: A(Edit, _href=URL('manage_user', args=row.auth_user.id)) db.auth_user.edit = Field.Virtual(btn) rows = db(db.auth_user).select() ## TRIED THIS:db.auth_user.first_name.represent = lambda v, r: A(r.created_by.first_name, ' ', r.created_by.last_name, _href=URL('view_user_profile', args=r.created_by)) ## TRIED THIS:rows.auth_user.first_name.represent = lambda v, r: A(r.created_by.first_name, ' ', r.created_by.last_name, _href=URL('view_user_profile', args=r.created_by)) headers = [ID, Name, Last Name, Email, Edit] fields = ['id', 'first_name', 'last_name', email, edit] table = TABLE(THEAD(TR(*[B(header) for header in headers])), TBODY(*[TR(*[TD(row[field]) for field in fields]) \ for row in rows])) table[_class] = table table-striped table-bordered table-condensed return dict(table=table) thanks, Alex Glaros -- 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: How would one design a promotion for products using web2py?
Just a thought: On Saturday, December 27, 2014 7:25:01 AM UTC-8, 黄祥 wrote: [...] i'd love to learn from another products and implement it on web2py, but still have no idea how to do it in web2py ways. the reason is if it set on the table, the user (non technical) perhaps in marketing division can change their own conditional pricing rules without any help from technical or developer to set their own marketing idea. [...] One way to do this is to make a form that said Marketing Dept User (MDU!) would fill in, being permitted to access that form's page by the auth settings (auth groups, for instance), and then you just update the database with the form. But I think it would be easy to automate expiring special prices by extending Massimo's table: On Saturday, December 27, 2014 3:32:04 PM UTC+7, Massimo Di Pierro wrote: db.define_table('product', Field('name'), Field('price')) with Field('start'), Field('end'), pen = db.product.insert(name=Pen, price=8 if self4 else 10 if self2 else 12) and tweak the form so that this statement would insert start=now', end='3014/12/31' (for the default, datepicker results for specials) cart = {pen: 3} # 3 pens in cart cart_total = sum(eval(p.price, {'cart':cart,'self':cart[p.id]}) for p in db(db.product.name.belongs(cart.keys())).select()) and here you'd get more than one row back, and you'd pick the price with the lowest number that is valid at the time of the order. (I think I'd be tempted to handle the quantity discount somewhat similar ... add Field('threshold') and now you pick the row with the lowest price valid for the time period and whose threshold is met. As a future thing, you might want have a scheduler task that every once in a while checks for expired prices and deletes (if you allow deletes) or invalidates rows that expired long enough ago that you don't need them around for reference. And a thought occurs that when the base price changes, you can mark the old record expried (by setting the 'end' field to yesterday) and adding the new price with a far-off expiration. Caveat: most of my experience is with device programming, so I might have said somethin above that made the people with business sw experience shudder. Anyway, my two cents. /dps P.S. You may want to validate the price string so that it only contains if, else, and, or, self, cart strings. On Friday, 26 December 2014 09:39:15 UTC-6, 黄祥 wrote: hi, i face the similar problem (even more complex) designing the table for it. condition 1 : time base promotion promotion price will occured during the valid date (start, end) e.g. on 1 dec 2014 - 31 dec 2014 the price for product B will be $10, usually normal price is $12 condition 2 : quantity base promotion promotion price will occured when the quantity order is more than quantity that have been set e.g. buy 3 products B the price will be $10, when buy 1 of product B the price is $12 or buy 5 products B the price will be $8, when buy 1 of product B the price is $12 condition 3 : product base promotion promotion that offer free product when another product is ordered. e.g. buy 3 products B get 1 product C or buy 5 products B get 2 product C and 1 product D condition 4 : combination of all 3 aboves e.g. on 1 dec 2014 - 31 dec 2014 buy 3 products B get 1 product C my question is how do i design my table relation for that in web2py way? i've seen examples of presta shop add ons for that, but don't know how to do it using web2py way, any idea how to achieve that? thanks and best regards, stifan -- 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: represents clause in controller formatted table
The represent attribute is used by SQLFORM, SQLFORM.grid, and SQLTABLE but does not automatically get applied otherwise. You can also apply it by calling the .render() method on the Rows object, as documented here: http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Rendering-rows-using-represent Anthony On Monday, December 29, 2014 8:19:53 PM UTC-5, Alex Glaros wrote: what is syntax for represents statement for this controller-styled table? def list_users(): btn = lambda row: A(Edit, _href=URL('manage_user', args= row.auth_user.id)) db.auth_user.edit = Field.Virtual(btn) rows = db(db.auth_user).select() ## TRIED THIS:db.auth_user.first_name.represent = lambda v, r: A(r.created_by.first_name, ' ', r.created_by.last_name, _href=URL('view_user_profile', args=r.created_by)) ## TRIED THIS:rows.auth_user.first_name.represent = lambda v, r: A(r.created_by.first_name, ' ', r.created_by.last_name, _href=URL('view_user_profile', args=r.created_by)) headers = [ID, Name, Last Name, Email, Edit] fields = ['id', 'first_name', 'last_name', email, edit] table = TABLE(THEAD(TR(*[B(header) for header in headers])), TBODY(*[TR(*[TD(row[field]) for field in fields]) \ for row in rows])) table[_class] = table table-striped table-bordered table-condensed return dict(table=table) thanks, Alex Glaros -- 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: navbar in sqlform.grid
This is the part of html in my layout.html {{if auth.is_logged_in():}} div class=dropdown pull-right button data-toggle=dropdown class=btn btn-default navbar-btn span class=glyphicon glyphicon-user/spannbsp;nbsp;{{=auth.user.first_name}}nbsp;{{=auth.user.last_name}}nbsp;nbsp;span class=caret/span /button ul aria-labelledby=dropdown role=menu class=dropdown-menu li role=presentationa role=menuitem tabindex=-1 href={{=URL('default', 'user', args='logout')}}{{=T('Logout')}}/a/li li role=presentationa role=menuitem tabindex=-1 href={{=URL('default', 'user', args='profile')}}{{=T('Edit profile')}}/a/li li role=presentationa role=menuitem tabindex=-1 href={{=URL('default', 'user', args='change_password')}}{{=T('Change password')}}/a/li /ul /div {{pass}} It fails to work only at views where i have SQLFORM.grid 2014-12-29 16:40 GMT+01:00 Jim S j...@qlf.com: Can you show some code? -Jim On Monday, December 29, 2014 8:30:31 AM UTC-6, Yebach wrote: Hello My navbar user button does not show dropdown options when I am in a view where SQLFORM.grid is? Any suggestions why? -- 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/sjQoTm-XHgw/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. -- Lep pozdrav Vid Ogris -- 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] database select from set encoding
Hello Setting db_codec changes nothing 2014-12-29 17:21 GMT+01:00 Marco Mansilla thebigsho...@gmail.com: El Mon, 29 Dec 2014 05:53:37 -0800 (PST) Yebach vid.og...@gmail.com escribió: hello I have a postgres dabatabase with utf8 encoding after executing workersDb = db(db.worker.w_organisation == org).select(db.worker.id, db.worker.w_nick_name).as_list() I get a list of dict where my strings are endoed as 'Moj\xc4\x8dca' where it should write Mojčca How do i set the encoding? Thank you right at the end of the section http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Connection-strings--the-uri-parameter- Marco. -- 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/uUf6xZaUY_Y/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. -- Lep pozdrav Vid Ogris -- 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.