Re: [web2py] Re: Unable to update database entry after compute=lambda r: calculation of some field values in the DB

2018-10-25 Thread sandeep patel
I think there is a problem in field type in Days because the default is a
string so days have a string value, you are multiplying string with an
integer in the computed field.

# 1
db.define_table('ClientDetails',
Field('CheckIn', 'date', label=SPAN('Check-In Date',
_style="font-weight:
bold;")),
Field('CheckOut', 'date', label=SPAN('Check-Out Date',
 _style="font-weight: bold;")),
Field('Days', compute=lambda r: (r['CheckOut']-r['CheckIn'
]).days),
Field('Amount', compute=lambda r: int(r['Days'])*int(r[
'Number_of_Guests'])*650))

# 2
db.define_table('ClientDetails',
Field('CheckIn', 'date', label=SPAN('Check-In Date',
_style="font-weight:
bold;")),
Field('CheckOut', 'date', label=SPAN('Check-Out Date',
 _style="font-weight: bold;")),
Field('Days', compute=lambda r: (r['CheckOut']-r['CheckIn'
]).days),
Field('Amount', compute=lambda r: ((r['CheckOut']-r[
'CheckIn']).days)*int(r['Number_of_Guests'])*650))

Let me know this will work for you.

Thanks
SP

On Fri, Oct 26, 2018 at 10:27 AM mostwanted  wrote:

> With this one there was no error traceback, the form just failed to submit
> showed a message that read *Error in form, please check it out *and i do
> have a field Number_of_Guests i just didnt include it coz i thought i was
> minimizing the whole code to show what could the root cause of the problem.
> When i remove the *Days *and* Amount *fields I am able to update the form
> but when put them back it gives an error!
>
> On Friday, October 26, 2018 at 12:13:55 AM UTC+2, 黄祥 wrote:
>>
>> pls show the error traceback, it's hard to know what the root cause.
>> just a quick analyze (guess), perhaps it's no Number_of_Guests field in
>> your table definition, so it can't be calculated
>>
>> 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.
>

-- 
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: Unable to update database entry after compute=lambda r: calculation of some field values in the DB

2018-10-25 Thread mostwanted
With this one there was no error traceback, the form just failed to submit 
showed a message that read *Error in form, please check it out *and i do 
have a field Number_of_Guests i just didnt include it coz i thought i was 
minimizing the whole code to show what could the root cause of the problem. 
When i remove the *Days *and* Amount *fields I am able to update the form 
but when put them back it gives an error!

On Friday, October 26, 2018 at 12:13:55 AM UTC+2, 黄祥 wrote:
>
> pls show the error traceback, it's hard to know what the root cause.
> just a quick analyze (guess), perhaps it's no Number_of_Guests field in 
> your table definition, so it can't be calculated
>
> 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: Issue between 2.14.5 and 2.17.2

2018-10-25 Thread Anthony
Are you on the same filesystem/OS? Is it possible your OS sort order is not 
different, so "_" sorts after the digits instead of before? Try changing 
0_imports.py to 00_imports.py.

Anthony

On Thursday, October 25, 2018 at 11:56:49 AM UTC-4, Annet wrote:
>
> After upgrading from web2py 2.14.5 to 2.17.2 and editing a model file I 
> got the following error:
>
> Traceback (most recent call last):
>   File "/Users/iannet/web2py/gluon/restricted.py", line 219, in restricted
> exec(ccode, environment)
>   File 
> "/Users/iannet/web2py/applications/adminmodel/models/01_education_db.py", 
> line 19, in 
> Field('image', type='upload', default=None, 
> requires=IS_EMPTY_OR(IS_IMAGE(extensions=('gif', 'jpg', 'jpeg', 'png'), 
> maxsize=(320, 518)), IS_LENGTH(128*1024)), autodelete=True, 
> uploadfolder=os.path.join(UPLOADFOLDER, 'vertexID%s' % 
> session.back_end_vertexID)),
> NameError: name 'os' is not defined
>
>
> What has changed between these versions that's causing this error? As far 
> as I can see 0_imports .py still imports os
>
>
> Kind regards,
>
> Annet
>
>

-- 
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: Unable to update database entry after compute=lambda r: calculation of some field values in the DB

2018-10-25 Thread 黄祥
pls show the error traceback, it's hard to know what the root cause.
just a quick analyze (guess), perhaps it's no Number_of_Guests field in 
your table definition, so it can't be calculated

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] Unable to update database entry after compute=lambda r: calculation of some field values in the DB

2018-10-25 Thread mostwanted
I was able to calculate and set some values in the database with 
compute=lambda r: but when i try to update those entries with SQLFORM() i 
get an error in the form and nothing is saved! What could be causing this 
and how can i fix it?

*MODEL:*
db.define_table('ClientDetails', 
Field('CheckIn', 'date', label=SPAN('Check-In Date', 
_style="font-weight: 
bold;")),
Field('CheckOut', 'date', label=SPAN('Check-Out Date', 
_style="font-weight: bold;")),
Field('Days', compute=lambda r: (r['CheckOut']-r['CheckIn'
]).days),
Field('Amount', compute=lambda r: r['Days']*r[
'Number_of_Guests']*650))

*UPDATE CONTROLLER:*
def clientUpdate():
details=db.ClientDetails(request.args(0, cast=int))
form=SQLFORM(db.ClientDetails, details.id, deletable=True, showid=False
).process()
return locals()


Regards:

Mostwanted

-- 
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: qrcode

2018-10-25 Thread isi_jca
Hi!!!

I solved the problem 
using reportlab https://www.reportlab.com/docs/reportlab-userguide.pdf

Look at this 
examples, http://www.web2pyslices.com/slice/show/1562/pdf-with-reportlab
http://www.web2pyslices.com/slice/show/1564/pdf-with-reportlab-ii

Regards.

El viernes, 12 de octubre de 2018, 4:27:29 (UTC-3), Jorge Luis Hernández 
Dueñas escribió:
>
> Hi, I have the same error, I try to save a qr image and I have tried it in 
> many ways but it keeps giving me error. Please, if you solved it, it would 
> be very helpful for me.
>
> El sábado, 23 de julio de 2016, 7:05:49 (UTC-5), isi_jca escribió:
>>
>>
>> Hi!!!.
>>>
>>>
>> When I try to print qrcode image to pdf using pyfpdf, I get the next 
>> error:
>>
>>  FPDF error: Unsupported image type: 
>> pilimage object at 0x7f2e82f13a50>
>>
>> Versión
>> web2py™ Version 2.14.5-stable+timestamp.2016.04.14.03.26.16
>> Python Python 2.7.6: /usr/bin/python (prefix: /usr)
>>  
>> Anyone have experience with this topic?
>>
>> 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.


Re: [web2py] How to strip away and get rid of (… days, 0:00:00) from a value acquired from a date calculation

2018-10-25 Thread mostwanted
It works SP, thank you.

Regards:

Mostwanted

On Thursday, October 25, 2018 at 7:17:03 PM UTC+2, sandeep patel wrote:
>
>
>
>
>
>
>
>
> *You can directly count days from date type.this belongs to datetime 
> class.db.define_table('hotels',Field('Hotel'),
> Field('Bookin', 'date'),Field('Bookout', 'date'),
> Field('days', compute=lambda r: (r['Bookout']-r['Bookin']).days),  
>   Field('guests', 'integer'),Field('price', compute=lambda r: 
> r['days']*r['guests']*650))Let me know if this will work for you.ThanksSP*
>
> On Thu, Oct 25, 2018 at 9:50 PM mostwanted  > wrote:
>
>> I have 4 values that have to be calculated together to set a default 
>> value for the fifth value, 2 of the 4 values are date values but the 
>> problem is that calculating their difference leaves *days, 0:00:00* as 
>> part of the answer but i only want the value number they give, is there a 
>> way to strip away the *days, 0:00:00* from the date calculation answer 
>> so i could use the remaining value in my calculation and get the answer i 
>> want?
>>
>>
>> *Example Code*
>>
>>
>> *MODEL:*
>>
>>
>>
>>
>>
>>
>>
>>
>> *db.define_table('hotels',Field('Hotel'),
>> Field('Bookin', 'date'),Field('Bookout', 'date'),
>> Field('days', compute=lambda r: r['Bookout']-r['Bookin']),
>> Field('guests', 'integer'),Field('price', compute=lambda r: 
>> r['days']*r['guests']*650))*
>>
>> Regards:
>>
>>
>> Mostwanted
>>
>> -- 
>> 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+un...@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.


Re: [web2py] Issue between 2.14.5 and 2.17.2

2018-10-25 Thread Carlos Cesar Caballero Díaz

Seems you are using os.path.join() without import the os module.

Greetings.


El 25/10/18 a las 11:56 a.m., 'Annet' via web2py-users escribió:
After upgrading from web2py 2.14.5 to 2.17.2 and editing a model file 
I got the following error:


Traceback(most recent call last): 
File"/Users/iannet/web2py/gluon/restricted.py", line219, in restricted
 exec(ccode, environment) 
File"/Users/iannet/web2py/applications/adminmodel/models/01_education_db.py", line19, 
in  Field('image', type='upload', default=None, 
requires=IS_EMPTY_OR(IS_IMAGE(extensions=('gif', 'jpg', 'jpeg', 'png'),
maxsize=(320, 518)), IS_LENGTH(128*1024)), autodelete=True,
uploadfolder=os.path.join(UPLOADFOLDER, 'vertexID%s' % 
session.back_end_vertexID)), NameError: name'os' is not defined

What has changed between these versions that's causing this error? As 
far as I can see 0_imports .py still imports os



Kind regards,

Annet

--
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.


--
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] How to strip away and get rid of (… days, 0:00:00) from a value acquired from a date calculation

2018-10-25 Thread sandeep patel
*You can directly count days from date type.this belongs to datetime
class.db.define_table('hotels',Field('Hotel'),
Field('Bookin', 'date'),Field('Bookout', 'date'),
Field('days', compute=lambda r: (r['Bookout']-r['Bookin']).days),
  Field('guests', 'integer'),Field('price', compute=lambda r:
r['days']*r['guests']*650))Let me know if this will work for you.ThanksSP*

On Thu, Oct 25, 2018 at 9:50 PM mostwanted  wrote:

> I have 4 values that have to be calculated together to set a default value
> for the fifth value, 2 of the 4 values are date values but the problem is
> that calculating their difference leaves *days, 0:00:00* as part of the
> answer but i only want the value number they give, is there a way to strip
> away the *days, 0:00:00* from the date calculation answer so i could use
> the remaining value in my calculation and get the answer i want?
>
>
> *Example Code*
>
>
> *MODEL:*
>
>
>
>
>
>
>
>
> *db.define_table('hotels',Field('Hotel'),
> Field('Bookin', 'date'),Field('Bookout', 'date'),
> Field('days', compute=lambda r: r['Bookout']-r['Bookin']),
> Field('guests', 'integer'),Field('price', compute=lambda r:
> r['days']*r['guests']*650))*
>
> Regards:
>
>
> Mostwanted
>
> --
> 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.
>

-- 
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] How to strip away and get rid of (… days, 0:00:00) from a value acquired from a date calculation

2018-10-25 Thread mostwanted
 

I have 4 values that have to be calculated together to set a default value 
for the fifth value, 2 of the 4 values are date values but the problem is 
that calculating their difference leaves *days, 0:00:00* as part of the 
answer but i only want the value number they give, is there a way to strip 
away the *days, 0:00:00* from the date calculation answer so i could use 
the remaining value in my calculation and get the answer i want?


*Example Code*


*MODEL:*








*db.define_table('hotels',Field('Hotel'),
Field('Bookin', 'date'),Field('Bookout', 'date'),
Field('days', compute=lambda r: r['Bookout']-r['Bookin']),
Field('guests', 'integer'),Field('price', compute=lambda r: 
r['days']*r['guests']*650))*

Regards:


Mostwanted

-- 
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] Issue between 2.14.5 and 2.17.2

2018-10-25 Thread 'Annet' via web2py-users
After upgrading from web2py 2.14.5 to 2.17.2 and editing a model file I got 
the following error:

Traceback (most recent call last):
  File "/Users/iannet/web2py/gluon/restricted.py", line 219, in restricted
exec(ccode, environment)
  File 
"/Users/iannet/web2py/applications/adminmodel/models/01_education_db.py", line 
19, in 
Field('image', type='upload', default=None, 
requires=IS_EMPTY_OR(IS_IMAGE(extensions=('gif', 'jpg', 'jpeg', 'png'), 
maxsize=(320, 518)), IS_LENGTH(128*1024)), autodelete=True, 
uploadfolder=os.path.join(UPLOADFOLDER, 'vertexID%s' % 
session.back_end_vertexID)),
NameError: name 'os' is not defined


What has changed between these versions that's causing this error? As far 
as I can see 0_imports .py still imports os


Kind regards,

Annet

-- 
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: mobile friendly login page

2018-10-25 Thread Lovedie JC
Thanks. It looks lovely. Let me try it.

On Thu, 25 Oct 2018, 18:14 Christian Varas  wrote:

> Sorry the image in the previous mails is broken, here is it:
> https://imgur.com/a/I1SsGlp
>
> Cheers
> Chris.
>
> El jue., 25 oct. 2018 a las 10:57, Lovedie JC ()
> escribió:
>
>> Works good.
>> How about app buttons in a single line/row?
>> Regards
>>
>> On Thu, 25 Oct 2018 at 16:22, sandeep patel 
>> wrote:
>>
>>> @lbjc
>>> Add some margin between the buttons.
>>>  you can try this. Add this in user.html file
>>> 
>>> .btn{
>>>   margin-left: 10px;
>>>   margin-top: 10px;
>>> }
>>> 
>>>
>>> Best/
>>> SP
>>>
>>> On Thu, Oct 25, 2018 at 6:34 PM mostwanted  wrote:
>>>
 The attachment link gives *error 404*

 On Thursday, October 25, 2018 at 2:06:15 PM UTC+2, lbjc...@gmail.com
 wrote:
>
> The default login page on the desktop looks absolutely good. The
> mobile page,see attached needs some workup. Is there a way to align the
> buttons?
> 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.

>>> --
>>> 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.
>>>
>> --
>> 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.
>>
> --
> 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.
>

-- 
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: mobile friendly login page

2018-10-25 Thread Christian Varas
Sorry the image in the previous mails is broken, here is it:
https://imgur.com/a/I1SsGlp

Cheers
Chris.

El jue., 25 oct. 2018 a las 10:57, Lovedie JC ()
escribió:

> Works good.
> How about app buttons in a single line/row?
> Regards
>
> On Thu, 25 Oct 2018 at 16:22, sandeep patel 
> wrote:
>
>> @lbjc
>> Add some margin between the buttons.
>>  you can try this. Add this in user.html file
>> 
>> .btn{
>>   margin-left: 10px;
>>   margin-top: 10px;
>> }
>> 
>>
>> Best/
>> SP
>>
>> On Thu, Oct 25, 2018 at 6:34 PM mostwanted  wrote:
>>
>>> The attachment link gives *error 404*
>>>
>>> On Thursday, October 25, 2018 at 2:06:15 PM UTC+2, lbjc...@gmail.com
>>> wrote:

 The default login page on the desktop looks absolutely good. The mobile
 page,see attached needs some workup. Is there a way to align the buttons?
 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.
>>>
>> --
>> 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.
>>
> --
> 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.
>

-- 
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: mobile friendly login page

2018-10-25 Thread Christian Varas
hi, this is my login page, I'm using adminLTE as template, try this
example, i might work for you, adminLTE works with boostrap like web2py, so
I think that should work.

[image: image.png]

controller:
def user():
return dict(page="Bienvenido", icon="", title="", form=auth())

*this is the view:*

{{extend 'layout_climbersoul.html'}}




  {{=T('Sign Up') if request.args(0) ==
'register' else T('Log In') if request.args(0) == 'login' else
T(request.args(0).replace('_',' ').title())}}



  
   {{
if request.args(0)=='login':
if not 'register' in auth.settings.actions_disabled:
form.add_button(T('Sign Up'),URL(args='register',
vars={'_next': request.vars._next} if request.vars._next else
None),_class='btn btn-default')
pass
if not 'request_reset_password' in
auth.settings.actions_disabled:
form.add_button(T('Lost
Password'),URL(args='request_reset_password'),_class='btn btn-default')
pass
pass
}}
{{=form}}
  
  
  



If the above doesn't work, I think you can customize the auth form like in
the SQLFORM.
Example:

form_add_lugar = SQLFORM.factory(
Field("Nombre", requires=IS_NOT_EMPTY()),
Field("Pais", default=1, requires=IS_IN_SET(range(1,
(len(country_list) + 1)), country_list)),
Field("Region", label="Región", default='Ninguna',
requires=IS_IN_SET(regiones)),
# captcha_field(),
_name="form_add_Lugar",
submit_button="Agregar",
)

*# Here you can add/change **attributes*
form_add_lugar[0][0][0]['_class'] = "control-label col-sm-2"
form_add_lugar[0][1][0]['_class'] = "control-label col-sm-2"
form_add_lugar[0][2][0]['_class'] = "control-label col-sm-2"


I hope this can help

Cheers.
Chris.

El jue., 25 oct. 2018 a las 10:57, Lovedie JC ()
escribió:

> Works good.
> How about app buttons in a single line/row?
> Regards
>
> On Thu, 25 Oct 2018 at 16:22, sandeep patel 
> wrote:
>
>> @lbjc
>> Add some margin between the buttons.
>>  you can try this. Add this in user.html file
>> 
>> .btn{
>>   margin-left: 10px;
>>   margin-top: 10px;
>> }
>> 
>>
>> Best/
>> SP
>>
>> On Thu, Oct 25, 2018 at 6:34 PM mostwanted  wrote:
>>
>>> The attachment link gives *error 404*
>>>
>>> On Thursday, October 25, 2018 at 2:06:15 PM UTC+2, lbjc...@gmail.com
>>> wrote:

 The default login page on the desktop looks absolutely good. The mobile
 page,see attached needs some workup. Is there a way to align the buttons?
 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.
>>>
>> --
>> 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.
>>
> --
> 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.
>

-- 
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: mobile friendly login page

2018-10-25 Thread Lovedie JC
Works good.
How about app buttons in a single line/row?
Regards

On Thu, 25 Oct 2018 at 16:22, sandeep patel 
wrote:

> @lbjc
> Add some margin between the buttons.
>  you can try this. Add this in user.html file
> 
> .btn{
>   margin-left: 10px;
>   margin-top: 10px;
> }
> 
>
> Best/
> SP
>
> On Thu, Oct 25, 2018 at 6:34 PM mostwanted  wrote:
>
>> The attachment link gives *error 404*
>>
>> On Thursday, October 25, 2018 at 2:06:15 PM UTC+2, lbjc...@gmail.com
>> wrote:
>>>
>>> The default login page on the desktop looks absolutely good. The mobile
>>> page,see attached needs some workup. Is there a way to align the buttons?
>>> 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.
>>
> --
> 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.
>

-- 
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: mobile friendly login page

2018-10-25 Thread sandeep patel
@lbjc
Add some margin between the buttons.
 you can try this. Add this in user.html file

.btn{
  margin-left: 10px;
  margin-top: 10px;
}


Best/
SP

On Thu, Oct 25, 2018 at 6:34 PM mostwanted  wrote:

> The attachment link gives *error 404*
>
> On Thursday, October 25, 2018 at 2:06:15 PM UTC+2, lbjc...@gmail.com
> wrote:
>>
>> The default login page on the desktop looks absolutely good. The mobile
>> page,see attached needs some workup. Is there a way to align the buttons?
>> 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.
>

-- 
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: mobile friendly login page

2018-10-25 Thread mostwanted
The attachment link gives *error 404*

On Thursday, October 25, 2018 at 2:06:15 PM UTC+2, lbjc...@gmail.com wrote:
>
> The default login page on the desktop looks absolutely good. The mobile 
> page,see attached needs some workup. Is there a way to align the buttons?
> 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.


Re: [web2py] Re: reference gives error table company has no column named....

2018-10-25 Thread mostwanted
Thanks Lovedie


On Thursday, October 25, 2018 at 1:27:08 PM UTC+2, Lovedie JC wrote:
>
> I noticed on my part,if I can remember, that the error comes because you 
> are recreating another table. That's why you can rename are restart web2py 
> and see if it works.
>
> On Thu, 25 Oct 2018, 13:52 mostwanted > 
> wrote:
>
>> If  i delete it from the database folder and refresh my browser with the 
>> table using the same name will it not throw the *table exists *error? 
>>
>> On Thursday, October 25, 2018 at 11:13:31 AM UTC+2, Lovedie JC wrote:
>>>
>>> I used to get that. Delete the db from the database  folder or rename it 
>>> brhe refresh or restart web2py.
>>>
>>> On Thu, 25 Oct 2018, 09:36 mostwanted  wrote:
>>>
 When i do all this it gives me error saying table Customer exists!

 On Friday, August 31, 2018 at 2:53:18 AM UTC+2, Anthony wrote:
>
> fake_migrate makes pyDAL think the model definition reflects the 
> actual schema in the database. Presumably the field in question does not 
> actually exist in the database. If that's the only field missing from the 
> database, do the following:
>
>1. Delete the *.table file for this table in the /databases folder.
>2. Comment out the line defining the missing field.
>3. Leave fake_migrate=True and run one request -- that will 
>re-create the *.table file, but without the missing field, so pyDAL 
> will 
>know to add the field in the next real migration.
>4. Remove fake_migrate everywhere -- you don't need it unless you 
>are correcting a migration problem.
>5. Set migrate=True.
>6. Remove the comment from #2 above and run another request -- 
>pyDAL will now create the missing field.
>
> Anthony
>
> On Thursday, August 30, 2018 at 4:13:02 PM UTC-4, mostwanted wrote:
>>
>> I have a database which i recently updated by adding a new table 
>> called *tlamelo*, the new table is referenced in one of the old 
>> tables called *company, *when i try to save data into the table 
>> *company* i get the error bellow *(table company has no column named 
>> tlamelo)!* I do not understand why i am getting this error, i am not 
>> sure if it has anything to do with the 
>> fake_migrate=True
>> or not! Can anyone please help me, thank you.
>>
>>  table company has no column named 
>> tlamelo
>>
>> This is the code for my table tlamelo
>> db.define_table('tlamelo',
>> Field('leina_la_tlamelo', requires=IS_NOT_EMPTY()),
>> format='%(leina_la_tlamelo)s', migrate=False, 
>> fake_migrate=True)
>>
>> This is the code for my table company
>> db.define_table('company',
>> Field('logo', 'upload'),
>> Field('company_name', requires=IS_NOT_EMPTY()),
>> Field('services', 'reference services'),
>> Field('tlamelo', 'reference tlamelo'), #tlamelo is 
>> referenced here
>> Field('product', 'reference product'),
>> Field('tel', requires=IS_NOT_EMPTY()),
>> Field('email', requires=IS_NOT_EMPTY()),
>> Field('fax', requires=IS_NOT_EMPTY()),
>> Field('cell', requires=IS_NOT_EMPTY()),
>> Field('facebook', requires=IS_NOT_EMPTY()),
>> Field('twitter', requires=IS_NOT_EMPTY()),
>> Field('website', requires=IS_NOT_EMPTY()),
>> Field('postal_address', requires=IS_NOT_EMPTY()),
>> Field('located_at', requires=IS_NOT_EMPTY()), migrate
>> =False, fake_migrate=True)
>>
>>
>> -- 
 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+un...@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+un...@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 

Re: [web2py] Re: Auth question

2018-10-25 Thread Jim S
Having the default user() functions is all you need.  I'd try commenting 
out your 'user' functions.

-Jim

On Wednesday, October 24, 2018 at 10:59:45 PM UTC-5, Rahul wrote:
>
> Yes this is in default.py. Please excuse me for my bad code as I am still 
> experimenting with Auth and not totally familiar with the implementation. 
> Is this the right way that I am doing it? or only having user() function is 
> enough ? 
>
> Thanks, Rahul
>
> On Wednesday, October 24, 2018 at 9:45:21 PM UTC+5:30, Jim S wrote:
>>
>> I'm confused.  Is this code in your controller somewhere?
>>
>> #  User functions ---
>> def login(): return dict(form=auth.login())
>> def register(): return dict(form=auth.register())
>> def retrieve_password(): return dict(form=auth.reset_password())
>> def logout(): return dict(form=auth.logout())
>> def profile(): return dict(form=auth.profile())
>>
>> You shouldn't need it.  To override the default login stuff I've just 
>> modified the one in default.py.
>>
>> -Jim
>>
>>
>>
>> On Tuesday, October 23, 2018 at 11:26:45 PM UTC-5, Rahul wrote:
>>>
>>> The user function remains as-is - No modifications done. 
>>>
>>> def user():
>>> """
>>> exposes:
>>> http:///[app]/default/user/login
>>> http:///[app]/default/user/logout
>>> http:///[app]/default/user/register
>>> http:///[app]/default/user/profile
>>> http:///[app]/default/user/retrieve_password
>>> http:///[app]/default/user/change_password
>>> http:///[app]/default/user/bulk_register
>>> use @auth.requires_login()
>>> @auth.requires_membership('group name')
>>> @auth.requires_permission('read','table name',record_id)
>>> to decorate functions that need access control
>>> also notice there is http:///[app]/appadmin/manage/auth to allow 
>>> administrator to manage users
>>> """
>>> return dict(form=auth())
>>>
>>> I am using the specified functions to expose methods as below - 
>>> #  User functions ---
>>> def login(): return dict(form=auth.login())
>>> def register(): return dict(form=auth.register())
>>> def retrieve_password(): return dict(form=auth.reset_password())
>>> def logout(): return dict(form=auth.logout())
>>> def profile(): return dict(form=auth.profile())
>>>
>>>
>>>
>>> and the corresponding files reside in \views\  *not in* \views\default 
>>> - I am not sure if the application is even picking up these files. 
>>>
>>> Note - I have extended the Auth (auth_user) table and added workspace 
>>> and other fields - This will be specified everytime I add a new user. I 
>>> would filter out the results as you mentioned but only after all the login 
>>> stuff works properly.
>>>
>>> auth.settings.extra_fields['auth_user'] = [
>>> Field ('workspace', length=128),
>>>
>>> Sincerely,
>>>
>>> Rahul 
>>>
>>> On Tuesday, October 23, 2018 at 7:49:48 PM UTC+5:30, Jim S wrote:

 Did you modify the user() function in default.py?  Or, are you using 
 your own custom login functions?

 -Jim

 On Tuesday, October 23, 2018 at 7:59:21 AM UTC-5, Rahul wrote:
>
> Hi Jim, All,
>  Okay I tried this - And I also decorated index() function in 
> controller like below as I want to redirect the user to login page rather 
> than directly jumping to index.html 
>
> #  example index page 
> @auth.requires_login()
> def index():
> response.flash= T("Hello World")
> return dict(message=T('Welcome to web2py!'))
>
> However, now when I put the credentials username and password, it 
> doesnt log me in - I generates the below URL like below and appends it to 
> url box. What might I be missing because it was logging me in fine 
> sometime 
> ago but now it doesnt allow. Note I did cleanup a lot of HTML code from 
> my 
> login page. There sure is something going on here that I am not catching 
> - 
>
>
>
> http://
> 127.0.0.1:8000/scaffolding_app/default/user/login?username=rahul=integer10&_next=%2Fscaffolding_ace_admin%2Fdefault%2Findex&_formkey=0c0c022a-377d-47dd-bd72-a13e8ee6f387&_formname=login
>
>
>
>  
>
> Sincerely, Rahul D. 
>
>
> On Friday, October 19, 2018 at 12:24:19 PM UTC+5:30, Rahul wrote:
>>
>> Hi Jim,
>> That makes sense. I will check it out on which option to go. 
>> Thanks! for all the guidance. 
>>
>> Thank you,
>>
>> *Rahul Dhakate*
>>
>> On Wednesday, October 17, 2018 at 7:57:32 PM UTC+5:30, Jim S wrote:
>>>
>>> Rahul
>>>
>>> First, what I was referring to was common_filters, not common 
>>> fields.  Here is the scenario as I see it.
>>>
>>> In you auth_user table you have a workspace field.  Then in other 
>>> tables that are workspace-specific you also have a workspace field to 
>>> show 
>>> which workspace they relate to
>>>
>>> Here is how I 

[web2py] mobile friendly login page

2018-10-25 Thread lbjc1978
The default login page on the desktop looks absolutely good. The mobile 
page,see attached needs some workup. Is there a way to align the buttons?
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.


Re: [web2py] Re: reference gives error table company has no column named....

2018-10-25 Thread Lovedie JC
I noticed on my part,if I can remember, that the error comes because you
are recreating another table. That's why you can rename are restart web2py
and see if it works.

On Thu, 25 Oct 2018, 13:52 mostwanted  wrote:

> If  i delete it from the database folder and refresh my browser with the
> table using the same name will it not throw the *table exists *error?
>
> On Thursday, October 25, 2018 at 11:13:31 AM UTC+2, Lovedie JC wrote:
>>
>> I used to get that. Delete the db from the database  folder or rename it
>> brhe refresh or restart web2py.
>>
>> On Thu, 25 Oct 2018, 09:36 mostwanted  wrote:
>>
>>> When i do all this it gives me error saying table Customer exists!
>>>
>>> On Friday, August 31, 2018 at 2:53:18 AM UTC+2, Anthony wrote:

 fake_migrate makes pyDAL think the model definition reflects the actual
 schema in the database. Presumably the field in question does not actually
 exist in the database. If that's the only field missing from the database,
 do the following:

1. Delete the *.table file for this table in the /databases folder.
2. Comment out the line defining the missing field.
3. Leave fake_migrate=True and run one request -- that will
re-create the *.table file, but without the missing field, so pyDAL will
know to add the field in the next real migration.
4. Remove fake_migrate everywhere -- you don't need it unless you
are correcting a migration problem.
5. Set migrate=True.
6. Remove the comment from #2 above and run another request --
pyDAL will now create the missing field.

 Anthony

 On Thursday, August 30, 2018 at 4:13:02 PM UTC-4, mostwanted wrote:
>
> I have a database which i recently updated by adding a new table
> called *tlamelo*, the new table is referenced in one of the old
> tables called *company, *when i try to save data into the table
> *company* i get the error bellow *(table company has no column named
> tlamelo)!* I do not understand why i am getting this error, i am not
> sure if it has anything to do with the
> fake_migrate=True
> or not! Can anyone please help me, thank you.
>
>  table company has no column named
> tlamelo
>
> This is the code for my table tlamelo
> db.define_table('tlamelo',
> Field('leina_la_tlamelo', requires=IS_NOT_EMPTY()),
> format='%(leina_la_tlamelo)s', migrate=False,
> fake_migrate=True)
>
> This is the code for my table company
> db.define_table('company',
> Field('logo', 'upload'),
> Field('company_name', requires=IS_NOT_EMPTY()),
> Field('services', 'reference services'),
> Field('tlamelo', 'reference tlamelo'), #tlamelo is
> referenced here
> Field('product', 'reference product'),
> Field('tel', requires=IS_NOT_EMPTY()),
> Field('email', requires=IS_NOT_EMPTY()),
> Field('fax', requires=IS_NOT_EMPTY()),
> Field('cell', requires=IS_NOT_EMPTY()),
> Field('facebook', requires=IS_NOT_EMPTY()),
> Field('twitter', requires=IS_NOT_EMPTY()),
> Field('website', requires=IS_NOT_EMPTY()),
> Field('postal_address', requires=IS_NOT_EMPTY()),
> Field('located_at', requires=IS_NOT_EMPTY()), migrate=
> False, fake_migrate=True)
>
>
> --
>>> 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+un...@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.
>

-- 
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.

Re: [web2py] Re: reference gives error table company has no column named....

2018-10-25 Thread mostwanted
If  i delete it from the database folder and refresh my browser with the 
table using the same name will it not throw the *table exists *error? 

On Thursday, October 25, 2018 at 11:13:31 AM UTC+2, Lovedie JC wrote:
>
> I used to get that. Delete the db from the database  folder or rename it 
> brhe refresh or restart web2py.
>
> On Thu, 25 Oct 2018, 09:36 mostwanted > 
> wrote:
>
>> When i do all this it gives me error saying table Customer exists!
>>
>> On Friday, August 31, 2018 at 2:53:18 AM UTC+2, Anthony wrote:
>>>
>>> fake_migrate makes pyDAL think the model definition reflects the actual 
>>> schema in the database. Presumably the field in question does not actually 
>>> exist in the database. If that's the only field missing from the database, 
>>> do the following:
>>>
>>>1. Delete the *.table file for this table in the /databases folder.
>>>2. Comment out the line defining the missing field.
>>>3. Leave fake_migrate=True and run one request -- that will 
>>>re-create the *.table file, but without the missing field, so pyDAL will 
>>>know to add the field in the next real migration.
>>>4. Remove fake_migrate everywhere -- you don't need it unless you 
>>>are correcting a migration problem.
>>>5. Set migrate=True.
>>>6. Remove the comment from #2 above and run another request -- pyDAL 
>>>will now create the missing field.
>>>
>>> Anthony
>>>
>>> On Thursday, August 30, 2018 at 4:13:02 PM UTC-4, mostwanted wrote:

 I have a database which i recently updated by adding a new table called 
 *tlamelo*, the new table is referenced in one of the old tables called 
 *company, 
 *when i try to save data into the table *company* i get the error 
 bellow *(table company has no column named tlamelo)!* I do not 
 understand why i am getting this error, i am not sure if it has anything 
 to 
 do with the 
 fake_migrate=True
 or not! Can anyone please help me, thank you.

  table company has no column named 
 tlamelo

 This is the code for my table tlamelo
 db.define_table('tlamelo',
 Field('leina_la_tlamelo', requires=IS_NOT_EMPTY()),
 format='%(leina_la_tlamelo)s', migrate=False, 
 fake_migrate=True)

 This is the code for my table company
 db.define_table('company',
 Field('logo', 'upload'),
 Field('company_name', requires=IS_NOT_EMPTY()),
 Field('services', 'reference services'),
 Field('tlamelo', 'reference tlamelo'), #tlamelo is 
 referenced here
 Field('product', 'reference product'),
 Field('tel', requires=IS_NOT_EMPTY()),
 Field('email', requires=IS_NOT_EMPTY()),
 Field('fax', requires=IS_NOT_EMPTY()),
 Field('cell', requires=IS_NOT_EMPTY()),
 Field('facebook', requires=IS_NOT_EMPTY()),
 Field('twitter', requires=IS_NOT_EMPTY()),
 Field('website', requires=IS_NOT_EMPTY()),
 Field('postal_address', requires=IS_NOT_EMPTY()),
 Field('located_at', requires=IS_NOT_EMPTY()), migrate=
 False, fake_migrate=True)


 -- 
>> 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+un...@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.


Re: [web2py] Re: reference gives error table company has no column named....

2018-10-25 Thread Lovedie JC
I used to get that. Delete the db from the database  folder or rename it
brhe refresh or restart web2py.

On Thu, 25 Oct 2018, 09:36 mostwanted  wrote:

> When i do all this it gives me error saying table Customer exists!
>
> On Friday, August 31, 2018 at 2:53:18 AM UTC+2, Anthony wrote:
>>
>> fake_migrate makes pyDAL think the model definition reflects the actual
>> schema in the database. Presumably the field in question does not actually
>> exist in the database. If that's the only field missing from the database,
>> do the following:
>>
>>1. Delete the *.table file for this table in the /databases folder.
>>2. Comment out the line defining the missing field.
>>3. Leave fake_migrate=True and run one request -- that will re-create
>>the *.table file, but without the missing field, so pyDAL will know to add
>>the field in the next real migration.
>>4. Remove fake_migrate everywhere -- you don't need it unless you are
>>correcting a migration problem.
>>5. Set migrate=True.
>>6. Remove the comment from #2 above and run another request -- pyDAL
>>will now create the missing field.
>>
>> Anthony
>>
>> On Thursday, August 30, 2018 at 4:13:02 PM UTC-4, mostwanted wrote:
>>>
>>> I have a database which i recently updated by adding a new table called
>>> *tlamelo*, the new table is referenced in one of the old tables called 
>>> *company,
>>> *when i try to save data into the table *company* i get the error
>>> bellow *(table company has no column named tlamelo)!* I do not
>>> understand why i am getting this error, i am not sure if it has anything to
>>> do with the
>>> fake_migrate=True
>>> or not! Can anyone please help me, thank you.
>>>
>>>  table company has no column named
>>> tlamelo
>>>
>>> This is the code for my table tlamelo
>>> db.define_table('tlamelo',
>>> Field('leina_la_tlamelo', requires=IS_NOT_EMPTY()),
>>> format='%(leina_la_tlamelo)s', migrate=False,
>>> fake_migrate=True)
>>>
>>> This is the code for my table company
>>> db.define_table('company',
>>> Field('logo', 'upload'),
>>> Field('company_name', requires=IS_NOT_EMPTY()),
>>> Field('services', 'reference services'),
>>> Field('tlamelo', 'reference tlamelo'), #tlamelo is
>>> referenced here
>>> Field('product', 'reference product'),
>>> Field('tel', requires=IS_NOT_EMPTY()),
>>> Field('email', requires=IS_NOT_EMPTY()),
>>> Field('fax', requires=IS_NOT_EMPTY()),
>>> Field('cell', requires=IS_NOT_EMPTY()),
>>> Field('facebook', requires=IS_NOT_EMPTY()),
>>> Field('twitter', requires=IS_NOT_EMPTY()),
>>> Field('website', requires=IS_NOT_EMPTY()),
>>> Field('postal_address', requires=IS_NOT_EMPTY()),
>>> Field('located_at', requires=IS_NOT_EMPTY()), migrate=
>>> False, fake_migrate=True)
>>>
>>>
>>> --
> 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.
>

-- 
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: reference gives error table company has no column named....

2018-10-25 Thread mostwanted
When i do all this it gives me error saying table Customer exists!

On Friday, August 31, 2018 at 2:53:18 AM UTC+2, Anthony wrote:
>
> fake_migrate makes pyDAL think the model definition reflects the actual 
> schema in the database. Presumably the field in question does not actually 
> exist in the database. If that's the only field missing from the database, 
> do the following:
>
>1. Delete the *.table file for this table in the /databases folder.
>2. Comment out the line defining the missing field.
>3. Leave fake_migrate=True and run one request -- that will re-create 
>the *.table file, but without the missing field, so pyDAL will know to add 
>the field in the next real migration.
>4. Remove fake_migrate everywhere -- you don't need it unless you are 
>correcting a migration problem.
>5. Set migrate=True.
>6. Remove the comment from #2 above and run another request -- pyDAL 
>will now create the missing field.
>
> Anthony
>
> On Thursday, August 30, 2018 at 4:13:02 PM UTC-4, mostwanted wrote:
>>
>> I have a database which i recently updated by adding a new table called 
>> *tlamelo*, the new table is referenced in one of the old tables called 
>> *company, 
>> *when i try to save data into the table *company* i get the error bellow 
>> *(table 
>> company has no column named tlamelo)!* I do not understand why i am 
>> getting this error, i am not sure if it has anything to do with the 
>> fake_migrate=True
>> or not! Can anyone please help me, thank you.
>>
>>  table company has no column named 
>> tlamelo
>>
>> This is the code for my table tlamelo
>> db.define_table('tlamelo',
>> Field('leina_la_tlamelo', requires=IS_NOT_EMPTY()),
>> format='%(leina_la_tlamelo)s', migrate=False, 
>> fake_migrate=True)
>>
>> This is the code for my table company
>> db.define_table('company',
>> Field('logo', 'upload'),
>> Field('company_name', requires=IS_NOT_EMPTY()),
>> Field('services', 'reference services'),
>> Field('tlamelo', 'reference tlamelo'), #tlamelo is 
>> referenced here
>> Field('product', 'reference product'),
>> Field('tel', requires=IS_NOT_EMPTY()),
>> Field('email', requires=IS_NOT_EMPTY()),
>> Field('fax', requires=IS_NOT_EMPTY()),
>> Field('cell', requires=IS_NOT_EMPTY()),
>> Field('facebook', requires=IS_NOT_EMPTY()),
>> Field('twitter', requires=IS_NOT_EMPTY()),
>> Field('website', requires=IS_NOT_EMPTY()),
>> Field('postal_address', requires=IS_NOT_EMPTY()),
>> Field('located_at', requires=IS_NOT_EMPTY()), migrate=
>> False, fake_migrate=True)
>>
>>
>>

-- 
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.