[web2py] Re: color picker

2017-07-18 Thread Leonel Câmara
Andrea, lets get one thing clear, what's making input type='color' work is 
not web2py, it's the browser. IE11 and earlier do not support inputs for 
that type. You cannot do this without javascript.  

See:
http://caniuse.com/#feat=input-color
  
Note that the javascript I suggested you use is very simple to use, you 
only need to include its files in the HTML.
  

-- 
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: color picker

2017-07-18 Thread Andrea Fae'
I'm sorry but it's Javascript. I prefer to define a field of web2py db. How 
to implement? Thank you very much

Il giorno martedì 18 luglio 2017 21:57:00 UTC+2, Leonel Câmara ha scritto:
>
> You can use a polyfill such as this one 
> https://briangrinstead.com/blog/input-type-color-polyfill/
>
> I wouldn't support IE11 though, that thing needs to die. Still worth it in 
> this case for the shitty ios safari support.
>

-- 
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: app slow on pythonanywhere

2017-07-18 Thread Bernardo Leon
Thank you for your answer, Indeed I am using several ajax requests and I am 
not able to use session.forget(response) on my components since I need the 
session information. I have installed redis to test but now I am facing 
another problem that I have detailed here: 
https://groups.google.com/forum/#!topic/web2py/fFdQES5Z6oM It seems that 
now I am not able to log into the application if I try to store sessions on 
redis, I am sorry to bother and thank you again!

El lunes, 17 de julio de 2017, 19:23:55 (UTC-5), Leonel Câmara escribió:
>
> That's probably caused by sessions, file based sessions lock the file in 
> the filesystem until you're done with them, you can spend some time there 
> if you do a lot of parallel ajax requests.  
>   
> The first step is to call session.forget(response) as soon as you can in 
> controllers that do not write to the session.
>
> If that doesn't solve your slowness problem it's time to look into using 
> redis to store sessions.
>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Can't log into the application if using redis for sessions

2017-07-18 Thread Bernardo Leon
Hi, I want to use redis to handle my app sessions. I am using the next code 
in my model:

from gluon.tools import Auth
from gluon.contrib.redis_utils import RConn
from gluon.contrib.redis_session import RedisSession

gth_dev_db_connection_string = 'postgres://dev_db:dev_db@[ip]/dev_db'
db = DAL(gth_dev_db_connection_string,
 lazy_tables=True)

auth = Auth(db)
auth.define_tables(username=False, signature=True)

db._common_fields.append(auth.signature)

# Redis session
rconn = RConn('[ip]', 6379)
sessiondb = RedisSession(redis_conn=rconn, session_expiry=False)
session.connect(request, response, db=sessiondb)

If I comment the last line I am able to login to the application but if I 
try to use redis to handle my sessions the application tells me that I am 
logged in but the page is stuck in the Log In form. Is this a bug or am I 
doing something wrong? Thank you!

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: web2py 2.15.0b1

2017-07-18 Thread villas
Hi Leonel

Thanks for your suggestion and I created an issue 
on pyDal.  
The quoting tends to work ok with DBs which default to lowercase,  
unfortunately Firebird is uppercase.  As you say, it would probably be 
better not to use quotes at all because it will probably cause more issues 
than resolve problems. 

Best regards.  

On Tuesday, 18 July 2017 18:59:13 UTC+1, Leonel Câmara wrote:
>
> Villas can you submit an issue to pydal. Seems like a bug if we were not 
> using quotes before we probably should not be using them at all.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] autobuild'ing web2py models from MySQL metadata?

2017-07-18 Thread Jurgis Pralgauskis
Thanks for the link!  :)

On Tue, Jul 18, 2017 at 2:23 PM, Anthony  wrote:

> Have you tried this: https://github.com/web2py/web2py/blob/master/scripts/
> extract_mysql_models.py
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/web2py/ZNr4g6qJm2A/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Jurgis Pralgauskis
tel: 8-616 77613;
Don't worry, be happy and make things better ;)
http://galvosukykla.lt

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: how to calculate time difference in hours, between two dates?

2017-07-18 Thread Alex Glaros
worked Dave!  Thanks.

nullBottle = db(db.InternalMessage.bottleneck_resolve_date == 
None).select()
for r in nullBottle:
db(db.InternalMessage.id == r.id).update(bottleneck_delay_time = 
(request.now - r.created_on).seconds/3660)

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: how to calculate time difference in hours, between two dates?

2017-07-18 Thread Dave S


On Tuesday, July 18, 2017 at 11:33:33 AM UTC-7, Alex Glaros wrote:
>
> Goal is to compute bottleneck_delay_time in hours by subtracting 
> request.now from created_on date.
>
> What is correct syntaxt?
>
> Below is wrong but shows intent.
>
> MODEL
>
> db.define_table('InternalMessage', 
> Field('bottleneck_resolve_date', 'datetime', default = None), 
> Field('bottleneck_delay_time', 'integer', label = 'Bottleneck Delay 
> Time In hours'))
>
> CONTROLLER
>
> from datetime import timedelta
> db(db.InternalMessage.bottleneck_resolve_date == 
> None).update(bottleneck_delay_time = (timedelta(request.now) - 
>  timedelta(db.InternalMessage.created_on)))
>
> thanks
>
> Alex Glaros
>


I don't think you wrap the timestamps with a timedelta.

The difference between two datetime.datetime objects is automatically a 
datetime.timedelta.  I think you need
db(db.InternalMessage.bottleneck_resolve_date == 
None).update(bottleneck_delay_time 
= ((request.now) -  db.InternalMessage.created_on).total_seconds()/3660)

/dps


-- 
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: color picker

2017-07-18 Thread Leonel Câmara
You can use a polyfill such as this 
one https://briangrinstead.com/blog/input-type-color-polyfill/

I wouldn't support IE11 though, that thing needs to die. Still worth it in 
this case for the shitty ios safari support.

-- 
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] color picker

2017-07-18 Thread Andrea Fae'
Hello, how to implement a field color picker like
Field('colore', 'string', widget=lambda f,v: 
SQLFORM.widgets.string.widget(f,v, _value=v, 
_type='color',_data_text='hidden', _hex='true')),

This above is working in Chrome and Firefox but not in IE 11...  

-- 
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 calculate time difference in hours, between two dates?

2017-07-18 Thread Alex Glaros
Goal is to compute bottleneck_delay_time in hours by subtracting 
request.now from created_on date.

What is correct syntaxt?

Below is wrong but shows intent.

MODEL

db.define_table('InternalMessage', 
Field('bottleneck_resolve_date', 'datetime', default = None), 
Field('bottleneck_delay_time', 'integer', label = 'Bottleneck Delay 
Time In hours'))

CONTROLLER

from datetime import timedelta
db(db.InternalMessage.bottleneck_resolve_date == 
None).update(bottleneck_delay_time = (timedelta(request.now) - 
 timedelta(db.InternalMessage.created_on)))

thanks

Alex Glaros

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: wrong home page presented

2017-07-18 Thread mostwanted
i dont understand how that could be possible but i'll look into it

On Tuesday, July 18, 2017 at 6:15:10 PM UTC+2, Leonel Câmara wrote:
>
> It seems to me that you have 2 web2py applications in your pythonanywhere. 
> One that you defined as the default application, and the init application 
> which pythonanywhere adds for you.  
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: web2py 2.15.0b1

2017-07-18 Thread Leonel Câmara
Villas can you submit an issue to pydal. Seems like a bug if we were not 
using quotes before we probably should not be using them at all.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: web2py 2.15.0b1

2017-07-18 Thread villas
*Re:  Firebird*

I just tested this version of web2py and I noticed a problem.  See the new 
authapi.py,  line 452:

rows = self.db(self.table_group().role == role).select()

The* new code* produces this SQL:
SELECT "auth_group"."id", "auth_group"."role", "auth_group"."description" 
FROM "auth_group" WHERE ("auth_group"."role" = 'admin')

The *old code* in tools.py produced this:
SELECT  auth_group.id, auth_group.role, auth_group.description FROM 
auth_group WHERE (auth_group.role = 'admin')

*So what's the problem?*
Firebird,  by default,  creates all entity names in uppercase.  This is not 
usually a problem because the SQL is interpreted as case-insensitive. 
However,  when the names are quoted,  they become case-sensitive and 
therefore the new code doesn't work.

*The solution for Firebird?*
Either,  uppercase the entity names before they are quoted,  or dispense 
with the quotes (as in the old code).



-- 
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: wrong home page presented

2017-07-18 Thread Leonel Câmara
It seems to me that you have 2 web2py applications in your pythonanywhere. 
One that you defined as the default application, and the init application 
which pythonanywhere adds for you.  

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: remove "login" from navbar

2017-07-18 Thread JoeCodeswell
Hi Folks,

I didn't know where to put the above.
Here's what worked for me in web2py Version 
2.14.6-stable+timestamp.2016.05.10.00.21.47
In layout.html, I commented out the following as shown below:

 
  


I am posting this so i remember how to do it. :)

Love and peace,
Joe
On Friday, October 7, 2011 at 10:59:46 PM UTC-7, Anthony wrote:
>
> auth.navbar() automatically includes login as the first item, and that is 
> not configurable. However, auth.navbar() simply returns a SPAN helper 
> object, so you can use the server-side DOM to edit it. This should remove 
> the login link:
>
> nav = auth.navbar()
> del nav[1:3]  # deletes the login link and the " | " after it.
>
> Anthony
>
> On Saturday, October 8, 2011 1:37:56 AM UTC-4, lucas wrote:
>>
>> hello one and all, 
>>
>> how do i direct auth to remove the "login" link from the navbar? 
>>
>> i already tried 
>>
>> auth.settings.actions_disabled.append('login') 
>>
>> like you would to remove register, but that didn't seem to work. 
>> ideas?  thank you in advance.  lucas
>
>

-- 
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: FOREIGN KEY constraint failed

2017-07-18 Thread Santiago Cartasegna
Glad that my idea helped!

2017-07-18 6:20 GMT-03:00 mostwanted :

> I was able o solve the problem, when i was creating the tables i copied
> and pasted a code for the '*governmetFormPages' *table but to correct the
> error i had to delete the table and type its code word for word, that
> solved my problem. thanks for the input guys. Santiago Cartasegna  was
> right.
>
> On Sunday, July 2, 2017 at 10:37:22 AM UTC+2, mostwanted wrote:
>>
>> Hi guys, i need help, i'm pulling my hairs out over here, i have a
>> website where when i'm trying to record an entry i get an error:
>>  FOREIGN KEY constraint failed
>>
>>
>> I have been able to create 2 forms but other attempts to create more
>> forms fail!!
>>
>>
>> These are my tables;
>>
>>
>> db.define_table('government',
>> Field('govName', requires=IS_NOT_EMPTY()),
>> Field('tel', requires=IS_NOT_EMPTY()),
>> Field('email', requires=IS_NOT_EMPTY()),
>> format='%(govName)s',  migrate=False,fake_migrate=True)
>>
>>
>> db.define_table('governmenttForm',
>> Field('formImage', 'upload'),
>> Field('filledformImage', 'upload'),
>> Field('formName',requires=IS_NOT_EMPTY()),
>> Field('governmentName', 'reference government'),
>> format='%(formName)s',migrate=False,fake_migrate=True)
>>
>> db.define_table('governmetFormPages',
>> Field('formImage', 'upload'),
>> Field('formTitle',requires=IS_NOT_EMPTY()),
>> Field('formName', 'reference
>> govmntForm'),migrate=False,fake_migrate=True)
>>
>>
>> I am able to create a form for the governmentForm table but when i try to
>> load up the pages for governmentFormPages table i get the error
>>  FOREIGN KEY constraint failed
>>
>>
>> Below is the stack
>> Error ticket for "formulator" Ticket ID
>>
>> 127.0.0.1.2017-07-02.10-06-22.18c363e3-13c2-47f7-ace4-3692239493c4
>>  FOREIGN KEY constraint failed Version
>> web2py™ Version 2.14.6-stable+timestamp.2016.05.10.00.21.47 Traceback
>>
>> 1.
>> 2.
>> 3.
>> 4.
>> 5.
>> 6.
>> 7.
>> 8.
>> 9.
>> 10.
>> 11.
>> 12.
>> 13.
>> 14.
>> 15.
>> 16.
>>
>> Traceback (most recent call last):
>>   File "/home/mostwanted/web2py/gluon/restricted.py", line 227, in restricted
>> exec ccode in environment
>>   File 
>> "/home/mostwanted/web2py/applications/formulator/controllers/appadmin.py" 
>> ,
>>  line 703, in 
>>   File "/home/mostwanted/web2py/gluon/globals.py", line 417, in 
>> self._caller = lambda f: f()
>>   File 
>> "/home/mostwanted/web2py/applications/formulator/controllers/appadmin.py" 
>> ,
>>  line 151, in insert
>> if form.accepts(request.vars, session):
>>   File "/home/mostwanted/web2py/gluon/sqlhtml.py", line 1746, in accepts
>> self.vars.id = self.table.insert(**fields)
>>   File "/home/mostwanted/web2py/gluon/packages/dal/pydal/objects.py", line 
>> 726, in insert
>> ret = self._db._adapter.insert(self, self._listify(fields))
>>   File "/home/mostwanted/web2py/gluon/packages/dal/pydal/adapters/base.py", 
>> line 746, in insert
>> raise e
>> IntegrityError: FOREIGN KEY constraint failed
>>
>>
>> Please help me, i dont know what to do, i have tried to look for
>> solutions online but i just dont understand them, may someone please give
>> me light on what i'm doing wrong.
>>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/web2py/CPmr9UHWvOA/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Santiago Cartasegna.-

-- 
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: wrong home page presented

2017-07-18 Thread mostwanted
I change the app name to *sesoa *so the URLs are :

*http://sesoa.pythonanywhere.comhttp://sesoa.pythonanywhere.com/init/default/index
 
*

On Tuesday, July 18, 2017 at 5:45:25 PM UTC+2, mostwanted wrote:
>
> Not really, http://sesowa.pythonanywhere.com/ gives a page with the logo 
> in the top left corner and a search text field in the top right corner but 
> this URL http://sesowa.pythonanywhere.com/init/default/index 
> 
>  
> gives  a page without a logo in the top left corner and only the SESOWA 
> EXCHANGE MARKET logo in the top right corner. This 
> (http://sesowa.pythonanywhere.com/init/default/index 
> )
>  
> is the home page i want displayed.
>
> On Tuesday, July 18, 2017 at 2:40:53 PM UTC+2, Leonel Câmara wrote:
>>
>> These 2 give exactly the same result to me:
>> http://sesowa.pythonanywhere.com/
>> http://sesowa.pythonanywhere.com/init/default/index 
>> 
>>
>> Which is expected as the init app is the default in pythonanywhere 
>> standard configuration.
>>
>

-- 
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: wrong home page presented

2017-07-18 Thread mostwanted
Not really, http://sesowa.pythonanywhere.com/ gives a page with the logo in 
the top left corner and a search text field in the top right corner but 
this URL http://sesowa.pythonanywhere.com/init/default/index 

 
gives  a page without a logo in the top left corner and only the SESOWA 
EXCHANGE MARKET logo in the top right corner. This 
(http://sesowa.pythonanywhere.com/init/default/index 
)
 
is the home page i want displayed.

On Tuesday, July 18, 2017 at 2:40:53 PM UTC+2, Leonel Câmara wrote:
>
> These 2 give exactly the same result to me:
> http://sesowa.pythonanywhere.com/
> http://sesowa.pythonanywhere.com/init/default/index 
> 
>
> Which is expected as the init app is the default in pythonanywhere 
> standard configuration.
>

-- 
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: wrong home page presented

2017-07-18 Thread mostwanted
Yes i did

On Tuesday, July 18, 2017 at 1:51:06 PM UTC+2, Marlysson Silva wrote:
>
> Do you clicked in "Reload webapp" in web tab view?
>
> Em terça-feira, 18 de julho de 2017 06:34:15 UTC-3, mostwanted escreveu:
>>
>> Guys i need help, i dont know what i'm doing wrong  or if there is 
>> something wrong with my code, i hosted my application with 
>> pythonanywhere.com but when i go to the url *sesowa.pythonanywhere.com 
>> * i get the wrong home page where as 
>> it is this address*(http://sesowa.pythonanywhere.com/init/default/index 
>> )* of this home 
>> page i want to appear!!!
>>
>> Please 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.


[web2py] Re: Modules not reloading

2017-07-18 Thread António Ramos
And if i change one of the functions i get the same "refresh" problem...

2017-07-18 14:58 GMT+01:00 António Ramos :

> Hello in my db.py
>
> i have this
>
> from gluon.custom_import import track_changes; track_changes(True)
>
> from wf_validates import Validate
> db.define_table(
> "status",
> ...
> Field.Virtual('isavailable', lambda row: Validate().Status(row,db)),
> Format="%(title)s"
> )
>
>
>
> *my wf_validates.py*
>
> from html import *
> from gluon import current
> import datetime
> import importlib
> class Validate(object):
>
> def str_to_class(self,module_name, class_name,db):
>try:
>module_ = importlib.import_module(module_name)
>try:
>class_ = getattr(module_, class_name)()
>except AttributeError:
>logging.error('Class does not exist')
>except ImportError:
>logging.error('Module does not exist')
>return class_ or None
>
>
> def Status(self,row,db):
> wf=db.workflows(id=row["status"]["workflow"])["workflow"]
> theClass = self.str_to_class("applications.fileit.modules."+
> "ficheiros3",wf,db)
>
> cb=getattr(theClass, *"Draft"*)('row["status"]["title"]',db)
> return cb
>
> *ficheiros3* (this is static for now but will be dynamic)
>
> inside *ficheiros3.py* i have
>
> class Ficheiros(object):
> def Draft(self,row,db):
> return "Draft"
> def Approved(self,row,db):
> return "Approved"
> def A(self,row,db):
> return "A"
>
>
>
> The problem is that each time i create another funcion in ficheiros3.py
> that function is not visible to wf_validates  i´m copying ficheiros3 to
> ficheiros4 to see if it works..
>
> How to solve this?
>
>
> 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: After update can't connect Oracle

2017-07-18 Thread Вячеслав Анатольевич


But now i have another error:

File ".bububu.web2py\gluon\packages\dal\pydal\adapters\oracle.py", line 
71, in create_sequence_and_triggers
'MINVALUE -1;' % sequence_name)
TypeError: not all arguments converted during string formatting

-- 
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: After update can't connect Oracle

2017-07-18 Thread Вячеслав Анатольевич

Grandiose mersi!

-- 
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] Modules not reloading

2017-07-18 Thread António Ramos
Hello in my db.py

i have this

from gluon.custom_import import track_changes; track_changes(True)

from wf_validates import Validate
db.define_table(
"status",
...
Field.Virtual('isavailable', lambda row: Validate().Status(row,db)),
Format="%(title)s"
)



*my wf_validates.py*

from html import *
from gluon import current
import datetime
import importlib
class Validate(object):

def str_to_class(self,module_name, class_name,db):
   try:
   module_ = importlib.import_module(module_name)
   try:
   class_ = getattr(module_, class_name)()
   except AttributeError:
   logging.error('Class does not exist')
   except ImportError:
   logging.error('Module does not exist')
   return class_ or None


def Status(self,row,db):
wf=db.workflows(id=row["status"]["workflow"])["workflow"]
theClass =
self.str_to_class("applications.fileit.modules."+"ficheiros3",wf,db)

cb=getattr(theClass, *"Draft"*)('row["status"]["title"]',db)
return cb

*ficheiros3* (this is static for now but will be dynamic)

inside *ficheiros3.py* i have

class Ficheiros(object):
def Draft(self,row,db):
return "Draft"
def Approved(self,row,db):
return "Approved"
def A(self,row,db):
return "A"



The problem is that each time i create another funcion in ficheiros3.py
that function is not visible to wf_validates  i´m copying ficheiros3 to
ficheiros4 to see if it works..

How to solve this?


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: After update can't connect Oracle

2017-07-18 Thread Leonel Câmara
This is fixed in this pull request on the DAL

https://github.com/web2py/pydal/pull/471

We should merge it and include it in the next release.

-- 
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] After update can't connect Oracle

2017-07-18 Thread Вячеслав Анатольевич
HI!
Can anyone explain why after updating web2py to version 2.15.1 I started to 
get errors when connecting to Oracle?
For example, this:
AttributeError: 'Oracle' object has no attribute 'oracle_fix'

-- 
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: wrong home page presented

2017-07-18 Thread Leonel Câmara
These 2 give exactly the same result to me:
http://sesowa.pythonanywhere.com/
http://sesowa.pythonanywhere.com/init/default/index

Which is expected as the init app is the default in pythonanywhere standard 
configuration.

-- 
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: wrong home page presented

2017-07-18 Thread Marlysson Silva
Do you clicked in "Reload webapp" in web tab view?

Em terça-feira, 18 de julho de 2017 06:34:15 UTC-3, mostwanted escreveu:
>
> Guys i need help, i dont know what i'm doing wrong  or if there is 
> something wrong with my code, i hosted my application with 
> pythonanywhere.com but when i go to the url *sesowa.pythonanywhere.com 
> * i get the wrong home page where as it 
> is this address*(http://sesowa.pythonanywhere.com/init/default/index 
> )* of this home page 
> i want to appear!!!
>
> Please 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.


[web2py] autobuild'ing web2py models from MySQL metadata?

2017-07-18 Thread Anthony
Have you tried this: 
https://github.com/web2py/web2py/blob/master/scripts/extract_mysql_models.py

-- 
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] wrong home page presented

2017-07-18 Thread mostwanted
Guys i need help, i dont know what i'm doing wrong  or if there is 
something wrong with my code, i hosted my application with 
pythonanywhere.com but when i go to the url *sesowa.pythonanywhere.com* i 
get the wrong home page where as it is this address
*(http://sesowa.pythonanywhere.com/init/default/index)* of this home page i 
want to appear!!!

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


[web2py] Re: FOREIGN KEY constraint failed

2017-07-18 Thread mostwanted
I was able o solve the problem, when i was creating the tables i copied and 
pasted a code for the '*governmetFormPages' *table but to correct the error 
i had to delete the table and type its code word for word, that solved my 
problem. thanks for the input guys. Santiago Cartasegna  was right.

On Sunday, July 2, 2017 at 10:37:22 AM UTC+2, mostwanted wrote:
>
> Hi guys, i need help, i'm pulling my hairs out over here, i have a website 
> where when i'm trying to record an entry i get an error:
>  FOREIGN KEY constraint failed
>
>
> I have been able to create 2 forms but other attempts to create more forms 
> fail!!
>
>
> These are my tables;
>
>
> db.define_table('government',
> Field('govName', requires=IS_NOT_EMPTY()),
> Field('tel', requires=IS_NOT_EMPTY()),
> Field('email', requires=IS_NOT_EMPTY()),
> format='%(govName)s',  migrate=False,fake_migrate=True)
>
>
> db.define_table('governmenttForm',
> Field('formImage', 'upload'),
> Field('filledformImage', 'upload'),
> Field('formName',requires=IS_NOT_EMPTY()),
> Field('governmentName', 'reference government'), 
> format='%(formName)s',migrate=False,fake_migrate=True)
>
> db.define_table('governmetFormPages',
> Field('formImage', 'upload'),
> Field('formTitle',requires=IS_NOT_EMPTY()), 
> Field('formName', 'reference 
> govmntForm'),migrate=False,fake_migrate=True)
>
>
> I am able to create a form for the governmentForm table but when i try to 
> load up the pages for governmentFormPages table i get the error
>  FOREIGN KEY constraint failed 
>
>
> Below is the stack
> Error ticket for "formulator" Ticket ID 
>
> 127.0.0.1.2017-07-02.10-06-22.18c363e3-13c2-47f7-ace4-3692239493c4
>  FOREIGN KEY constraint failed Version 
> web2py™ Version 2.14.6-stable+timestamp.2016.05.10.00.21.47 Traceback 
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
> 10.
> 11.
> 12.
> 13.
> 14.
> 15.
> 16.
>
> Traceback (most recent call last):
>   File "/home/mostwanted/web2py/gluon/restricted.py", line 227, in restricted
> exec ccode in environment
>   File 
> "/home/mostwanted/web2py/applications/formulator/controllers/appadmin.py" 
> ,
>  line 703, in 
>   File "/home/mostwanted/web2py/gluon/globals.py", line 417, in 
> self._caller = lambda f: f()
>   File 
> "/home/mostwanted/web2py/applications/formulator/controllers/appadmin.py" 
> ,
>  line 151, in insert
> if form.accepts(request.vars, session):
>   File "/home/mostwanted/web2py/gluon/sqlhtml.py", line 1746, in accepts
> self.vars.id = self.table.insert(**fields)
>   File "/home/mostwanted/web2py/gluon/packages/dal/pydal/objects.py", line 
> 726, in insert
> ret = self._db._adapter.insert(self, self._listify(fields))
>   File "/home/mostwanted/web2py/gluon/packages/dal/pydal/adapters/base.py", 
> line 746, in insert
> raise e
> IntegrityError: FOREIGN KEY constraint failed
>
>
> Please help me, i dont know what to do, i have tried to look for solutions 
> online but i just dont understand them, may someone please give me light on 
> what i'm doing wrong.
>

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