[web2py] passing multiple values from view to controller

2018-11-04 Thread Tribo Eila
Hi,

using the code below, i'm trying to pass multiple variable from view to 
controller... and simple print the two values or work some validation.

perhaps i'm missing something... need help

view:

[web2py] Re: customizing SQLFORM to insert many rows from one form

2018-04-03 Thread Tribo Eila
you can try this http://www.mdelrosso.com/sheepit/index.php?lng=en_GB

On Monday, April 2, 2018 at 5:37:09 PM UTC+3, Mashareq M wrote:
>
> Hi,
>
> I am creating a web app for attending employees.
>
> This is the model:
>
> db.define_table(
> 'employee',
>  Field('name'),
>  format = '%(name)s')
> db.define_table(
> 'attendance',
> Field('employee_id',db.employee),
> Field('attend','boolean'),
> Field('comments','text') )
>
> This is the controller:
> def fillForm():
> employeeIDS=db(db.employee).select(db.employee.ALL)
> form = SQLFORM(db.attendance)
> if form.process(session=None, formname='test').accepted:
> response.flash = 'form accepted'
> elif form.errors:
> response.flash = 'form has errors'
> else:
> response.flash = 'please fill the form'
> return locals()
>
> This is the view:
> 
> 
> 
> name
> attend?
> comments
> 
> 
> {{for eid in employeeIDS:}}
> 
> {{=eid.name}}
> 
> 
> 
> 
> {{pass}}
> 
> 
> 
> 
> 
>
> The question is:
>
> How can I insert the data in each row in the table to be in one row in the 
> attendance table, whether the employee is attendance or absence ?
>
>
> Best Regards,
>

-- 
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: insert list of dictionary

2016-10-23 Thread Tribo Eila
Thank You Anthony.

You give me another idea...

On Thursday, October 20, 2016 at 6:17:50 PM UTC+3, Anthony wrote:
>
> On Wednesday, October 19, 2016 at 9:15:21 AM UTC-4, Tribo Eila wrote:
>>
>> Hi,
>>
>> supposed: 
>> db.define_table('color', Field('blue'),Field('yellow'),Field('red'))
>>
>> COLORED_THINGS = {
>> 'blue': ['sky', 'jeans', 'powerline insert mode'],
>> 'yellow': ['sun', 'banana', 'phone book/monitor stand'], 
>>  
>> 'red': ['blood', 'tomato', 'test failure']}
>>
>
> Do you want COLORED_THINGS to be a *single record* in the "color" table? 
> If so, your fields will have to be of type "list:string" (so each field can 
> store a list of strings) -- for example, Field('blue', 'list:string'). In 
> that case, just do:
>
> db.color.insert(**COLORED_THINGS)
>
> Anthony
>  
>
>>
>> using db.color.insert(...). i'm trying to figure how to save in database 
>> base on key dict. i tried for loops but my head starts turning.
>>
>

-- 
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: insert list of dictionary

2016-10-23 Thread Tribo Eila
Perfect! 

Thank You very much.

On Thursday, October 20, 2016 at 4:11:52 PM UTC+3, Scott Hunter wrote:
>
> Your fields are of type string (the default); so either make string 
> representations of your lists or declare the fields as lists of strings.
>
> Or, if you are trying to use this data to define *multiple* records, 
> something like this might do what you want:
>
> for i in xrange(3):
> db.color.insert( blue=COLORED_THINGS['blue'][i], 
>  yellow=COLORED_THINGS['yellow'][i],  red=COLORED_THINGS['red'][i] )
>
> On Wednesday, October 19, 2016 at 9:15:21 AM UTC-4, Tribo Eila wrote:
>>
>> Hi,
>>
>> supposed: 
>> db.define_table('color', Field('blue'),Field('yellow'),Field('red'))
>>
>> COLORED_THINGS = {
>> 'blue': ['sky', 'jeans', 'powerline insert mode'],
>> 'yellow': ['sun', 'banana', 'phone book/monitor stand'], 
>>  
>> 'red': ['blood', 'tomato', 'test failure']}
>>
>> using db.color.insert(...). i'm trying to figure how to save in database 
>> base on key dict. i tried for loops but my head starts turning.
>>
>

-- 
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] insert list of dictionary

2016-10-19 Thread Tribo Eila
Hi,

supposed: 
db.define_table('color', Field('blue'),Field('yellow'),Field('red'))

COLORED_THINGS = {
'blue': ['sky', 'jeans', 'powerline insert mode'],
'yellow': ['sun', 'banana', 'phone book/monitor stand'],   
   
'red': ['blood', 'tomato', 'test failure']}

using db.color.insert(...). i'm trying to figure how to save in database 
base on key dict. i tried for loops but my head starts turning.

-- 
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: SELECT without duplicates for a specific field

2016-06-15 Thread Tribo Eila
Instead using: 
db(db.table.reference == db.referencedtable.id).select(db.table.ALL, orderby
=db.referencedtable.Field, groupby=db.table.reference)

Use:
db(db.table.reference == db.referencedtable.id).select(
db.referencedtable.Field, orderby=db.referencedtable.Field, 
groupby=db.table.reference, 
join=(db.table.on(db.referencedtable.id == db.table.reference)))


On Tuesday, June 14, 2016 at 4:55:43 PM UTC+3, Gael Princivalle wrote:
>
> With inner joins orderby works but not groupby.
>
> db(db.table.reference == db.referencedtable.id).select(db.table.ALL, 
> orderby=db.referencedtable.Field)
> Works.
>
> db(db.table.reference == db.referencedtable.id).select(db.table.ALL, 
> orderby=db.referencedtable.Field, groupby=db.table.reference)
> Give a Ticket:
> column "table.id <http://products.id>" must appear in the GROUP BY clause 
> or be used in an aggregate function LINE 1: SELECT "table"."id"...
>
> Someone have a solution ?
>
> Il giorno martedì 14 giugno 2016 09:59:54 UTC+2, Tribo Eila ha scritto:
>>
>> Try  INNER JOINS.
>>
>> On Monday, June 13, 2016 at 6:31:33 PM UTC+3, Gael Princivalle wrote:
>>>
>>> New model:
>>> db.define_table('categories):
>>> Field('title', type='string'))
>>> 
>>> db.define_table('products'):
>>> Field('code', type='string'),
>>> Field('category', reference 'categories'))
>>>
>>> With groupby I obtain a good result.
>>>
>>> results = db(db.products).select(db.products.category, groupby=db.
>>> products.category)
>>>
>>> But I need to order the results by the category title.
>>>
>>> If I do like that:
>>> results = db(db.products).select(db.products.category, orderby=db.
>>> product.category.title, groupby=db.products.category)
>>>
>>> Ticket is : 'Field' object has no attribute 'title'
>>>
>>> Is there a way to order these results, or make a query that selct only 
>>> the categories in db.categories that are in db.products ?
>>>
>>> Il giorno giovedì 9 giugno 2016 12:56:57 UTC+2, tim.n...@conted.ox.ac.uk 
>>> ha scritto:
>>>>
>>>> Looks like you want a subquery.  You'll need to decide which of the 
>>>> items to choose when you have a given category_code.
>>>> Say you want the first item with a given category code:
>>>>
>>>> sub_query = db()._select(db.products.id.min(), groupby=db.products.
>>>> category_code)
>>>> results = db(db.products.id.belongs(sub_query)).select()
>>>>
>>>>
>>>> On Wednesday, 8 June 2016 15:10:33 UTC+1, Gael Princivalle wrote:
>>>>
>>>>> Hello.
>>>>>
>>>>> Is there a way to select some rows without duplicates for a specific 
>>>>> field ?
>>>>>
>>>>> MODEL:
>>>>> db.define_table('products'):
>>>>> Field('code', type='string'),
>>>>> Field('category_code', type='integer'))
>>>>>
>>>>> ROWS:
>>>>> code / category_code
>>>>> A1125 / 3
>>>>> C2214 / 2
>>>>> D235 / 3
>>>>> Z886 / 1
>>>>>
>>>>> I would like to make a select that give this result:
>>>>> code / category_code
>>>>> A1125 / 3
>>>>> C2214 / 2
>>>>> Z886 / 1
>>>>>
>>>>> Someone have an idea ?
>>>>>
>>>>> 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] Re: SELECT without duplicates for a specific field

2016-06-14 Thread Tribo Eila
Try  INNER JOINS.

On Monday, June 13, 2016 at 6:31:33 PM UTC+3, Gael Princivalle wrote:
>
> New model:
> db.define_table('categories):
> Field('title', type='string'))
> 
> db.define_table('products'):
> Field('code', type='string'),
> Field('category', reference 'categories'))
>
> With groupby I obtain a good result.
>
> results = db(db.products).select(db.products.category, groupby=db.products
> .category)
>
> But I need to order the results by the category title.
>
> If I do like that:
> results = db(db.products).select(db.products.category, orderby=db.product.
> category.title, groupby=db.products.category)
>
> Ticket is : 'Field' object has no attribute 'title'
>
> Is there a way to order these results, or make a query that selct only the 
> categories in db.categories that are in db.products ?
>
> Il giorno giovedì 9 giugno 2016 12:56:57 UTC+2, tim.n...@conted.ox.ac.uk 
> ha scritto:
>>
>> Looks like you want a subquery.  You'll need to decide which of the items 
>> to choose when you have a given category_code.
>> Say you want the first item with a given category code:
>>
>> sub_query = db()._select(db.products.id.min(), groupby=db.products.
>> category_code)
>> results = db(db.products.id.belongs(sub_query)).select()
>>
>>
>> On Wednesday, 8 June 2016 15:10:33 UTC+1, Gael Princivalle wrote:
>>
>>> Hello.
>>>
>>> Is there a way to select some rows without duplicates for a specific 
>>> field ?
>>>
>>> MODEL:
>>> db.define_table('products'):
>>> Field('code', type='string'),
>>> Field('category_code', type='integer'))
>>>
>>> ROWS:
>>> code / category_code
>>> A1125 / 3
>>> C2214 / 2
>>> D235 / 3
>>> Z886 / 1
>>>
>>> I would like to make a select that give this result:
>>> code / category_code
>>> A1125 / 3
>>> C2214 / 2
>>> Z886 / 1
>>>
>>> Someone have an idea ?
>>>
>>> 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] orderby with foreign key

2016-06-11 Thread Tribo Eila
hi, 

using: for x in db(..).select(.. orderby=db.yyy.zzz):
row.append(TD(x.zzz.key  <--- ref. value

how to sort the string value, instead the ref. value?

i tried using join and it's effective.

but i'm  using nested for loops which my head getting to explode now.

thanks for your 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] FPDF database image

2013-07-22 Thread Tribo Eila
I figured it out, not the dimension of the files... but the type of image 
file.

When I used the .png no error detected... but if I used .jpeg/.jpg it makes 
me trouble...

Need help to solve these.

Regards,

Eila

On Monday, July 15, 2013 6:49:00 PM UTC+3, Mariano Reingart wrote:
>
> You shoud have the picture in a file, so PyFPDF can load it. 
>
> Take a look at  build_badge_dict in web2conf: 
>
> https://code.google.com/p/web2conf/source/browse/controllers/badge.py#103 
>
> It uses some icons (speaker, country flag) from the private directory, 
> and uses the sponsor logo from a upload field in the database. 
>
> Basically, you should pass the full image path to PyFPDF (sponsor.logo 
> is the upload field): 
>
> fn = db.sponsor[user.sponsor_id].logo 
> source = os.path.join(request.folder, 'uploads', fn) 
>
> See the sample function, that uses that info to generate the pdf. 
>
> Best regads 
>
> Mariano Reingart 
> http://www.sistemasagiles.com.ar 
> http://reingart.blogspot.com 
>
>
> On Mon, Jul 15, 2013 at 2:03 AM, Tribo Eila 
> > 
> wrote: 
> > Hi, 
> > 
> > Supposed the code below: 
> > 
> > db.define_table('person', 
> > Field('name'), 
> > Field('picture', 'upload')). 
> > 
> > I'm trying to figured out, how to implement the picture to retrieve from 
> > database(postgreSQL) to FPDF. 
> > 
> > Any ideas to share? 
> > 
> > Thanks. 
> > 
> > Newbie 
> > 
> > 
> > 
> > 
> > -- 
> > 
> > --- 
> > 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.




Re: [web2py] FPDF database image

2013-07-22 Thread Tribo Eila
I followed your advised Massimo. It installed well. I already figured the 
dimensions of the images conflict.

The 320x479 uploaded file works well. But if the users uploaded 1600x1200 
or more, it makes the same error.

Am I missing something?

On Tuesday, July 16, 2013 1:13:53 PM UTC+3, Massimo Di Pierro wrote:
>
> You need to
>
>pip install PIL
>
> or
>
>sudo apt-get install python-imaging
>
> or on mac
>
>brew brew install pil
>
> On Tuesday, 16 July 2013 00:52:15 UTC-5, Tribo Eila wrote:
>>
>> Mariano,
>>
>> I already took your advised. But I can't figure out this error: 
>>
>> RuntimeError: FPDF error: PIL not installed
>>
>> After I installed the latest Binary Installer of PIL to 
>> python/../site-package. Still error exist.
>> Copy the folder to web2py/../site-packages, still the same.
>>
>> I tried to import PIL in python command line. No error.
>>
>> Any advised?
>>
>> Regards,
>>
>> Eila
>>
>>
>> On Monday, July 15, 2013 6:49:00 PM UTC+3, Mariano Reingart wrote:
>>>
>>> You shoud have the picture in a file, so PyFPDF can load it. 
>>>
>>> Take a look at  build_badge_dict in web2conf: 
>>>
>>> https://code.google.com/p/web2conf/source/browse/controllers/badge.py#103 
>>>
>>> It uses some icons (speaker, country flag) from the private directory, 
>>> and uses the sponsor logo from a upload field in the database. 
>>>
>>> Basically, you should pass the full image path to PyFPDF (sponsor.logo 
>>> is the upload field): 
>>>
>>> fn = db.sponsor[user.sponsor_id].logo 
>>> source = os.path.join(request.folder, 'uploads', fn) 
>>>
>>> See the sample function, that uses that info to generate the pdf. 
>>>
>>> Best regads 
>>>
>>> Mariano Reingart 
>>> http://www.sistemasagiles.com.ar 
>>> http://reingart.blogspot.com 
>>>
>>>
>>> On Mon, Jul 15, 2013 at 2:03 AM, Tribo Eila  
>>> wrote: 
>>> > Hi, 
>>> > 
>>> > Supposed the code below: 
>>> > 
>>> > db.define_table('person', 
>>> > Field('name'), 
>>> > Field('picture', 'upload')). 
>>> > 
>>> > I'm trying to figured out, how to implement the picture to retrieve 
>>> from 
>>> > database(postgreSQL) to FPDF. 
>>> > 
>>> > Any ideas to share? 
>>> > 
>>> > Thanks. 
>>> > 
>>> > Newbie 
>>> > 
>>> > 
>>> > 
>>> > 
>>> > -- 
>>> > 
>>> > --- 
>>> > 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.




Re: [web2py] FPDF database image

2013-07-15 Thread Tribo Eila
Mariano,

I already took your advised. But I can't figure out this error: 

RuntimeError: FPDF error: PIL not installed

After I installed the latest Binary Installer of PIL to python/../site-package. 
Still error exist.
Copy the folder to web2py/../site-packages, still the same.

I tried to import PIL in python command line. No error.

Any advised?

Regards,

Eila


On Monday, July 15, 2013 6:49:00 PM UTC+3, Mariano Reingart wrote:
>
> You shoud have the picture in a file, so PyFPDF can load it. 
>
> Take a look at  build_badge_dict in web2conf: 
>
> https://code.google.com/p/web2conf/source/browse/controllers/badge.py#103 
>
> It uses some icons (speaker, country flag) from the private directory, 
> and uses the sponsor logo from a upload field in the database. 
>
> Basically, you should pass the full image path to PyFPDF (sponsor.logo 
> is the upload field): 
>
> fn = db.sponsor[user.sponsor_id].logo 
> source = os.path.join(request.folder, 'uploads', fn) 
>
> See the sample function, that uses that info to generate the pdf. 
>
> Best regads 
>
> Mariano Reingart 
> http://www.sistemasagiles.com.ar 
> http://reingart.blogspot.com 
>
>
> On Mon, Jul 15, 2013 at 2:03 AM, Tribo Eila 
> > 
> wrote: 
> > Hi, 
> > 
> > Supposed the code below: 
> > 
> > db.define_table('person', 
> > Field('name'), 
> > Field('picture', 'upload')). 
> > 
> > I'm trying to figured out, how to implement the picture to retrieve from 
> > database(postgreSQL) to FPDF. 
> > 
> > Any ideas to share? 
> > 
> > Thanks. 
> > 
> > Newbie 
> > 
> > 
> > 
> > 
> > -- 
> > 
> > --- 
> > 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] FPDF database image

2013-07-15 Thread Tribo Eila
Hi,

Supposed the code below:

db.define_table('person',
Field('name'),
Field('picture', 'upload')).

I'm trying to figure out, how to implement the picture field from 
database(postgreSQL) to FPDF.

Any ideas to share?

Thank You.


-- 

--- 
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] FPDF database image

2013-07-15 Thread Tribo Eila
Hi,

Supposed the code below:

db.define_table('person',
Field('name'),
Field('picture', 'upload')).

I'm trying to figured out, how to implement the picture to retrieve from 
database(postgreSQL) to FPDF. 

Any ideas to share?

Thanks.

Newbie



-- 

--- 
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] FPDF Report database image

2013-07-15 Thread Tribo Eila
Hi,

Supposed the code below:

db.define_table('person',
Field('name),
Field('picture', 'upload'))

I'm trying to figure out, how to implement the picture field from 
database(postgreSQL) to FPDF.

Any ideas to share?

I'm very appreciated your help.

Thank you very much.

-- 

--- 
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] FPDF database image report

2013-07-15 Thread Tribo Eila
Hi,

Supposed the code below:

db.define_table('person',
Field('name),
Field('picture', 'upload'))

I'm trying to figure out, how to implement the picture field from 
database(postgreSQL) to FPDF.

Any ideas to share?

I'm very appreciated your help.

Thank you very much.

-- 

--- 
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: finding the difference in same field

2013-06-24 Thread Tribo Eila
Thanks Massimo,

It both works. 

My objective is to find the difference of last 2 entries. But I preferred 
to use the last you given below.

But my problem is, it always use the first row to compute the difference. 

Thanks for your reply.

On Sunday, June 23, 2013 2:55:53 PM UTC+3, Massimo Di Pierro wrote:
>
> rows = db(db.test).select(limitby=(0,2))
> rows[1].update_record(t2 = rows[1].t1-rows[0].t1)
>
> or if you need it for all records:
>
> row0 = db(db.test).select(limitby=(0,1)).first()
> db(db.test).update(t2 = db.test.t1-row0.t1)
>
>
>
> On Sunday, 23 June 2013 01:42:30 UTC-5, Tribo Eila wrote:
>>
>> Hi, 
>>
>> Supposed a model:
>>
>> db.define_table('test',
>> Field('t1', 'integer'),
>> Field('t2', 'integer'),
>> )
>>
>> How to find the difference in db.test.t1 (ex: db.test.t2(row2) = 
>> db.test.t1(row2) - db.test.t1(row1)) and store the result in db.test.t2.
>>
>> What approach should i used? 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] finding the difference in same field

2013-06-23 Thread Tribo Eila
Hi, 

Supposed a model:

db.define_table('test',
Field('t1', 'integer'),
Field('t2', 'integer'),
)

How to find the difference in db.test.t1 (ex: db.test.t2(row2) = 
db.test.t1(row2) - db.test.t1(row1)) and store the result in db.test.t2.

What approach should i used? 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.