[web2py] format does not work for SQLFORM

2014-12-26 Thread t_glezakos via web2py-users
My application manages debits of hardware to personnel Here is my model: ## table that holds firms providing hardware db.define_table('providers', Field('eponymia', 'string', label='Name'), Field('address', 'string', label='Address'), Field('perioxi

[web2py] Re: tips requested for tracing errors

2014-12-26 Thread Dave S
On Monday, December 22, 2014 4:45:05 PM UTC-8, Alex Glaros wrote: > > I searched the error ticket for traces for table name, line number, but > couldn't see any connection to anything regarding the real error (which I > knew) > The easy bugs are the ones that break right where the mistake is.

Re: [web2py] Re: join question

2014-12-26 Thread Michele Comitini
It can be done by joining on the aliased child table in relational fashion: >>> db.define_table('p', Field('name')) >>> db.define_table('c', Field('name'), Field('p','reference p'), Field('value')) >>> c_alias=db.c.with_alias('c_alias') >>> db.p.insert(name='uno') >>> db.p.insert(name='due') >>>

[web2py] Re: Stream cStringIO

2014-12-26 Thread Niphlod
the docstrings api on web2py.com/examples/epydoc are reeeally old and buggy. The new api documentation is on readthedocs Now... if you want to pass a StringIO to response.stream, you have to "rewind" it to 0 before passing it s = cStringIO.String

[web2py] Stream cStringIO

2014-12-26 Thread flagist0
Hello! What is the current right way to stream data in web2py? I'm trying to stream the data using cStringIO and response.stream, but as a best result I get an empty file. Here is a source snippet: rows = current.db(current.db.categories.belongs(categories)).select() s = cStringIO.StringIO() rows

[web2py] Re: happy holidays everybody

2014-12-26 Thread 黄祥
merry christmas, happy holiday all n thanks all for the christmas present -- 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 becaus

Re: [web2py] Re: Dumb Question/Bug

2014-12-26 Thread Mark Billion
Awesome. I really appreciate the help. On Fri, Dec 26, 2014 at 10:13 AM, Anthony wrote: > On Friday, December 26, 2014 9:15:40 AM UTC-5, Mark Billion wrote: >> >> Just two questions for my edification: >> 1. Why did HTTP get grouped into exceptions >> > > By making HTTP an exception, this allow

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

2014-12-26 Thread 黄祥
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 : quanti

Re: [web2py] Re: Dumb Question/Bug

2014-12-26 Thread Anthony
On Friday, December 26, 2014 9:15:40 AM UTC-5, Mark Billion wrote: > > Just two questions for my edification: > 1. Why did HTTP get grouped into exceptions > By making HTTP an exception, this allows both the framework and app code to short-circuit a given response at any point and immediately ret

Re: [web2py] Re: Dumb Question/Bug

2014-12-26 Thread Mark Billion
Just two questions for my edification: 1. Why did HTTP get grouped into exceptions 2. Is there a security reason not to catch all non-http exceptions, ie except EXCEPTION On Tue, Dec 23, 2014 at 3:28 PM, Mark Billion wrote: > Thanks guys -- that makes a ton of sense. I really appreciate it. > >

[web2py] Re: join question

2014-12-26 Thread Massimo Di Pierro
Given this example: In [1]: db = DAL() In [2]: db.define_table('rel',Field('name')) In [3]: db.define_table('rol',Field('name'),Field('parent','reference rel'),Field('value')) In [4]: db.rel.insert(name="Max") In [5]: db.rel.insert(name="John") In [6]: db.rol.insert(name="Child1", parent=1, value

Re: [web2py] join question

2014-12-26 Thread Kiran Subbaraman
Wondering if the "*belongs*" operator is what you are looking for? db((db.Relation.id == db.Role.relationid) & (db.Role.value.*belongs*(['DMV','Suggestion'])).select() Details here: http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#belongs __