[web2py] Re: How would one design a promotion for products using web2py?

2015-01-01 Thread 黄祥
thank you so much dave and massimo, i'll try the simple first, handle the time base promotion (using start_date and end_date comparison) and then goes to quantity base promotion (using the sample code by massimo). for the scheduler i don't think it can be set by Marketing division user, it must

[web2py] how can I ensures list-order

2015-01-01 Thread Stef Mientki
hello, I'm using dygraph to plot a number of parameters. Dygraph needs a csv file as it's input. So I made a service: @service.csv def service_platdak(): ToDay= date.today() Tomorrow = ( ToDay + timedelta (1) ) Fields = [ db.Compare_Model.Date, db.Compare_Model.M2,db.Compare_Model.M2

[web2py] Re: how can I ensures list-order

2015-01-01 Thread Anthony
The problem is that you call .as_list(), which converts to a list of dictionaries, and dictionaries do not preserve the order of keys. Do you need a list of dictionaries? On Thursday, January 1, 2015 3:09:22 PM UTC-5, aapaap wrote: > > hello, > > I'm using dygraph to plot a number of parameters

Re: [web2py] Re: how can I ensures list-order

2015-01-01 Thread Stef Mientki
thanks Anthony, No, I don't need a list of dictionairies. From your question, I assume there's also a way to get a plain table ? I need a list of lists or even better a 2D-numpy array (so I can easily perform some conversions). The final list of lists (or numpy array) must be converted to a csv

Re: [web2py] Re: how can I ensures list-order

2015-01-01 Thread Anthony
In that case, I wouldn't bother having the DAL create a Rows object. Instead, the database cursor will return a list of tuples, which you can feed directly to numpy to create an array. There are two approaches to do this: import numpy as np my_array = np.asarray(db.executesql(db(query)._select(

[web2py] 2.9.11 migration

2015-01-01 Thread lucas
hey everyone, i just upgraded from 2.9.5 to 2.9.11 web2py onto a new centos 6.5 server. is there any migration stuff i need to know because just doing admin in the url and apache is throwing back: Not Found The requested URL /admin/default was not found on this server.

[web2py] Re: How to set Reset password key programmatically?

2015-01-01 Thread wish7code
Just for the records (it took me quite some time to understand the password reset mechanism, maybe this helps somebody else): The reset password key is created dynamically, so there's absolutely no need to populate the reset key field. Per default the reset password key field is empty. *Only *wh

[web2py] Dropdown based on multiple parents?

2015-01-01 Thread Gary Cowell
Hi, this is probably simple but searching as come up a blank and I'm still very new to web2py I have three tables, 'manufacturer' , 'model', and 'shoe' Manufacturer contains 'Asics','Nike' Then 'model' has parent of 'manufacturer', and will have 'Asics', 'Gel Nimbus' and 'Nike','Vomero' 'sho

[web2py] Any way for placing many views in one html file?

2015-01-01 Thread Przemysław Loesch
Hallo to everybody. I'm a newbie web2py user but I'm in love with it already. One thing which I'm not comfortable with is the amount of html views files. Is there a way to place many views in one file just like one controler file handles many functions? I'm still using the default web based IDE

[web2py] Setup uwsgi and nginx on Mac OSX

2015-01-01 Thread harsha tanguturi
Getting the error Import Error No module named site My uwsgi configuration goes as follows: [uwsgi] home = /usr/lib/python2.7 #plugins = http,python socket = /tmp/web2py.socket chmod-socket = 666 chown-socket = www:www pythonpath = /Users/harshatanguturi/Documents/repos/web2py #touch-reloa

[web2py] Format clause for multiple table relationships

2015-01-01 Thread Gary Cowell
I want the 'format' for the dropdown when I create a 'run' entry to be 'manufacturer.name model.model shoe.purchased' e.g. 'Mizuno Wave Rider 10-11-2014' for instance where 'Mizuno' is the manufacturer name, 'Wave Rider' is the model.model, and the date is shoe.purchased I managed to get the

[web2py] session uuid

2015-01-01 Thread Joe
What I am trying to do is send the user to a "product" page where the URL will be a unique URL which can not be used again to access that page after that session. This is what I did, but it's not working as I can use the same URL from an other browser and I can still get to the "product" page.

Re: [web2py] How to set Reset password key programmatically?

2015-01-01 Thread wish7code
Thanks Michele! In fact I misunderstood the basic concept (see my other mail which is still stuck in moderation) I thought reset_password_key is mandatory in all cases, in fact it's only needed upon password reset request as you suggested.. Cheers Toby Am Dienstag, 30. Dezember 2014 12:59:40 U

Re: [web2py] session uuid

2015-01-01 Thread Michele Comitini
def product(): if session.uuid != request.args(0): raise HTTP(404) return dict() 2014-12-30 4:46 GMT+01:00 Joe : > What I am trying to do is send the user to a "product" page where the URL > will be a unique URL which can not be used again to access that page after

Re: [web2py] session uuid

2015-01-01 Thread Michele Comitini
correction: def product(): if request.args(0) is not None and session.uuid != request.args(0): raise HTTP(404) return dict() 2015-01-02 0:36 GMT+01:00 Michele Comitini : > def product(): > if session.uuid != request.args(0): >raise HTTP(404) >

Re: [web2py] session uuid

2015-01-01 Thread Michele Comitini
again! ;-) def product(): if request.args(0) is None or session.uuid != request.args(0): raise HTTP(404) return dict() 2015-01-02 0:39 GMT+01:00 Michele Comitini : > correction: > > def product(): > if request.args(0) is not None and session.uuid != request.args(0

Re: [web2py] Re: how can I ensures list-order

2015-01-01 Thread Stef Mientki
thanks Anthony, your answer looks really great, exactly what I was looking for and more ;-) I'll probably try it to morrow. cheers, Stef On 01-Jan-15 22:39, Anthony wrote: In that case, I wouldn't bother having the DAL create a Rows object. Instead, the database cursor will return a list of tu