[web2py] Administration disable communication is insecure

2020-08-31 Thread Andrea Fae'
Often when I try to modify a record through application it happens this 
error:

"amministrazione disabilitata: comunicazione non sicura"

in english

administration disabled: communication is insecure

What does it means? What I have to do?
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/e1f947da-6b8b-4bd2-b641-10bcde21f531o%40googlegroups.com.


[web2py] Re: login validation

2020-08-31 Thread Andrea Fae'
I noted in the manual. But for your opinion what is the meaning about 
is_active in auth_user?
Why is it useful?
Thank you

Il giorno lunedì 31 agosto 2020 08:46:15 UTC+2, Paco Bernal ha scritto:
>
> I meant registration_key :)
>
> http://web2py.com/books/default/chapter/29/09/access-control?search=blocked#Access-Control
>
> El lunes, 31 de agosto de 2020 a las 0:08:32 UTC+2, Paco Bernal escribió:
>
>> Hi
>> If you set at anytime key_registration='blocked' in auth_user table that 
>> user will not be able to loging. 
>> That's the way I would do it
>> Regards
>>
>> El domingo, 30 de agosto de 2020 a las 14:11:08 UTC+2, and...@gmail.com 
>> escribió:
>>
>>> Hello, maybe it's easy but I don't know exactly if it's possible.
>>> I want that a user can login ONLY if its rescord has is_valid=True. I 
>>> dont' want he logins if is_valid=False in the auth_user table...
>>> Is it possible? In which way? 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/476a08bd-dd5f-4f46-86e4-bde366b36933o%40googlegroups.com.


[web2py] Re: About putting values into database

2020-08-31 Thread Andrea Fae'
thank you for your suggestions. I will try, and eventually. I will inform.
thanks

Il giorno sabato 29 agosto 2020 10:55:42 UTC+2, Dave S ha scritto:
>
>
>
> On Friday, August 21, 2020 at 7:33:54 AM UTC-7, Andrea Fae' wrote:
>  
>
>> [...]
>> What is wrong? How to correct?
>> Thank  you
>>
>
>  I don't know.  I don't use crud(), which seems to never have been more 
> than experimental and has been deprecated for several years.  I use FORM() 
> and SQLFORM().  I'm not sure there are many here with crud() experience, so 
> I'm not sure who to tell you to turn to.
>
> I take it the line illustrating the wrong results is from appadmin.  Can 
> you fill out a new entry using appadmin's "New" button?  Does that get the 
> created_on and created_by fields correct?  When you display your form, does 
> it show the correct defaults in each field?
>
> /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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/b126fefe-cbe8-436d-bac3-b9b5e54bca05o%40googlegroups.com.


Re: [web2py] Re: fake_migrate=True is not working

2020-08-31 Thread Andrea Fae'
Now I understand. thank you so much

Il giorno venerdì 28 agosto 2020 12:08:25 UTC+2, Jose C ha scritto:
>
> thank you Jim, but I don't understand...
>>
>> If I set 
>> migrate=False
>> fake_migrate= True
>>
>> it means that web2py create the .table files without touching the db, 
>> isn'it?
>>
>> If I set
>> migrate=True
>> fake_migrate=True
>>
>> It means what exactly?
>>
>
> migrate=True tells web2py to do the table migration procedure (i.e. make 
> any changes to your db based on your models and update the .table control 
> files) .   
> fake_migrate=True tells web2py to *not* actually create/modify the tables 
> in the db itself but to just create the .table files (without any db action 
> at all).
>
> If migrate=False then web2py does nothing, regardless of the fake_migrate 
> setting.
>
> For more info, see: 
> http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer?search=fake_migrate#table_migrations
>
> HTH,
>
>>  
>>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/1259b4e8-7103-4efc-b1d9-e499743e2725o%40googlegroups.com.


[web2py] login validation

2020-08-30 Thread Andrea Fae'
Hello, maybe it's easy but I don't know exactly if it's possible.
I want that a user can login ONLY if its rescord has is_valid=True. I dont' 
want he logins if is_valid=False in the auth_user table...
Is it possible? In which way? 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/c97db3f4-a27a-4891-b5cf-d768ed6a1b59o%40googlegroups.com.


Re: [web2py] Re: fake_migrate=True is not working

2020-08-27 Thread Andrea Fae'
Hello Clemens, here you are the answers:


   - What about your sql.log? I don't have in the databases folder. I tried 
   with different combinations of migrate and fake_migrate_all but no way
   - Do your have direct access to the database (w/o web2py) using this 
   user/password account? (sorry for that question, but sometimes it's that 
   easy :-) YES
   - Are there any .table files already in your database folder? Yes all 
   tables are now in the databases folder

My application is now fully functional, I could change one table in the 
db_asset.py because maybe with migrate=true and fake_migrate_all=True it 
generates the sql.log. What do you think?
Thank you

Il giorno giovedì 27 agosto 2020 10:51:21 UTC+2, Clemens ha scritto:
>
> Hi,
>
> one more distance try: What does your sql.log file say? It's also to be 
> found in the databases folder. For example, I can find there entries like:
> timestamp: 2020-08-21T17:53:29.984015
> CREATE TABLE "functionality_attributes"(
> "id" SERIAL PRIMARY KEY,
> ...
> );
> success!
>
> I had a similar problem about 2 years ago. I can't remember exactly the 
> problem/solution. But the reason was, that I've tried to switch the uri to 
> another database and therefore the .table files were already existing. That 
> confuses the system since the tables were already processed in the (old) 
> .table files but didn't exist in the (new) database. It's important for the 
> .table files that different databases have different "file IDs" 
> (db['_uri_hash']) since these are used for .table file naming.
>
> Well then:
>
>- What about your sql.log?
>- Do your have direct access to the database (w/o web2py) using this 
>user/password account? (sorry for that question, but sometimes it's that 
>easy :-)
>- Are there any .table files already in your database folder?
>
> Since it's fresh new database I would set fake_migrate to false and 
> migrate to true.
>
> Best regards,
> Clemens
>
> On Thursday, August 27, 2020 at 9:30:39 AM UTC+2 and...@gmail.com wrote:
>
>> thank you Jim, but I don't understand...
>>
>> If I set 
>> migrate=False
>> fake_migrate= True
>>
>> it means that web2py create the .table files without touching the db, 
>> isn'it?
>>
>> If I set
>> migrate=True
>> fake_migrate=True
>>
>> It means what exactly?
>>
>> thank you so much
>>
>>
>> Il giorno mercoledì 26 agosto 2020 17:32:09 UTC+2, Jim S ha scritto:
>>
>>> You still have migrate set to False in your appconfig.ini.
>>>
>>> -Jim
>>>
>>> On Wed, Aug 26, 2020 at 10:14 AM Andrea Fae'  wrote:
>>>
>> Thank you for your suggestions...Like this (see attaached files)?
>>>> but, no way, no .tables created...I don't know why...
>>>>
>>>> Il giorno mercoledì 26 agosto 2020 14:46:05 UTC+2, Jim S ha scritto:
>>>>>
>>>>> Did you remove the apostrophe at the bottom as well?
>>>>>
>>>>> I haven't used migrate / fake migrate in the past the way that you are 
>>>>> implementing.
>>>>>
>>>>> Are you intentionally trying to set it by table?
>>>>>
>>>>> For me, on my DAL statement I'd include:
>>>>>
>>>>> migrate_enabled=myconf.get('db.migrate')
>>>>> fake_migrate_all=myconf.get('db.fake_migrate_all')
>>>>>
>>>>>
>>>>> then in appconfig.ini I'd have:
>>>>>
>>>>> [db]
>>>>> uri = mssql4://sa/Web2PyPassword@TS-SQL2016R2/itassetdb
>>>>> migrate = True
>>>>> fake_migrate_all = True
>>>>>
>>>>>
>>>>>
>>>>> Can you try that and see if it helps?
>>>>>
>>>>> Also, I'd remove all the migrate stuff from auth and all the 
>>>>> individual tables.  I just set it globally, but that may be a personal 
>>>>> preference kind of thing.
>>>>>
>>>>> -Jim
>>>>>
>>>>> On Wednesday, August 26, 2020 at 1:32:13 AM UTC-5, Andrea Fae' wrote:
>>>>>>
>>>>>> Hello, thank you for your answer.
>>>>>> I deleted the character but nothing changes.
>>>>>> Best regards 
>>>>>> Andrea
>>>>>>
>>>>>> Il giorno lunedì 24 agosto 2020 12:39:47 UTC+2, Clemens ha scritto:
>>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> I'm 

Re: [web2py] Re: fake_migrate=True is not working

2020-08-27 Thread Andrea Fae'
thank you Jim, but I don't understand...

If I set 
migrate=False
fake_migrate= True

it means that web2py create the .table files without touching the db, 
isn'it?

If I set
migrate=True
fake_migrate=True

It means what exactly?

thank you so much

Il giorno mercoledì 26 agosto 2020 17:32:09 UTC+2, Jim S ha scritto:
>
> You still have migrate set to False in your appconfig.ini.
>
> -Jim
>
> On Wed, Aug 26, 2020 at 10:14 AM Andrea Fae'  > wrote:
>
>> Thank you for your suggestions...Like this (see attaached files)?
>> but, no way, no .tables created...I don't know why...
>>
>> Il giorno mercoledì 26 agosto 2020 14:46:05 UTC+2, Jim S ha scritto:
>>>
>>> Did you remove the apostrophe at the bottom as well?
>>>
>>> I haven't used migrate / fake migrate in the past the way that you are 
>>> implementing.
>>>
>>> Are you intentionally trying to set it by table?
>>>
>>> For me, on my DAL statement I'd include:
>>>
>>> migrate_enabled=myconf.get('db.migrate')
>>> fake_migrate_all=myconf.get('db.fake_migrate_all')
>>>
>>>
>>> then in appconfig.ini I'd have:
>>>
>>> [db]
>>> uri = mssql4://sa/Web2PyPassword@TS-SQL2016R2/itassetdb
>>> migrate = True
>>> fake_migrate_all = True
>>>
>>>
>>>
>>> Can you try that and see if it helps?
>>>
>>> Also, I'd remove all the migrate stuff from auth and all the individual 
>>> tables.  I just set it globally, but that may be a personal preference kind 
>>> of thing.
>>>
>>> -Jim
>>>
>>> On Wednesday, August 26, 2020 at 1:32:13 AM UTC-5, Andrea Fae' wrote:
>>>>
>>>> Hello, thank you for your answer.
>>>> I deleted the character but nothing changes.
>>>> Best regards 
>>>> Andrea
>>>>
>>>> Il giorno lunedì 24 agosto 2020 12:39:47 UTC+2, Clemens ha scritto:
>>>>>
>>>>> Hi,
>>>>>
>>>>> I'm not very deep in your issue. But opening your appconfig.ini with 
>>>>> my default editor shows that the apostrophe in your authors value could 
>>>>> be 
>>>>> a problem:
>>>>>
>>>>> [image: Untitled.jpg]
>>>>>
>>>>> Thus, just delete it and have try. If it doesn't change anything, 
>>>>> please let me know and I will have a closer look.
>>>>>
>>>>> Best regards
>>>>> Clemens
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Monday, August 24, 2020 at 11:18:32 AM UTC+2 and...@gmail.com 
>>>>> wrote:
>>>>>
>>>>>> Hello, if I chose migrate= False and fake_migrate=True the .tables in 
>>>>>> databases folder are not created.
>>>>>> Why?
>>>>>> I'm attaching appconfig.ini and py.db and my custom db db_asset.py
>>>>>> 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 a topic in the 
>> Google Groups "web2py-users" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/web2py/PLIV6cNvRnc/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> web...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/web2py/e1702e2a-1c5f-4d0b-a27b-67cece00d923o%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/web2py/e1702e2a-1c5f-4d0b-a27b-67cece00d923o%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/323ef7e7-47eb-4f2e-bbc4-46eaacc36d54o%40googlegroups.com.


[web2py] Re: fake_migrate=True is not working

2020-08-26 Thread Andrea Fae'
Thank you for your suggestions...Like this (see attaached files)?
but, no way, no .tables created...I don't know why...

Il giorno mercoledì 26 agosto 2020 14:46:05 UTC+2, Jim S ha scritto:
>
> Did you remove the apostrophe at the bottom as well?
>
> I haven't used migrate / fake migrate in the past the way that you are 
> implementing.
>
> Are you intentionally trying to set it by table?
>
> For me, on my DAL statement I'd include:
>
> migrate_enabled=myconf.get('db.migrate')
> fake_migrate_all=myconf.get('db.fake_migrate_all')
>
>
> then in appconfig.ini I'd have:
>
> [db]
> uri = mssql4://sa/Web2PyPassword@TS-SQL2016R2/itassetdb
> migrate = True
> fake_migrate_all = True
>
>
>
> Can you try that and see if it helps?
>
> Also, I'd remove all the migrate stuff from auth and all the individual 
> tables.  I just set it globally, but that may be a personal preference kind 
> of thing.
>
> -Jim
>
> On Wednesday, August 26, 2020 at 1:32:13 AM UTC-5, Andrea Fae' wrote:
>>
>> Hello, thank you for your answer.
>> I deleted the character but nothing changes.
>> Best regards 
>> Andrea
>>
>> Il giorno lunedì 24 agosto 2020 12:39:47 UTC+2, Clemens ha scritto:
>>>
>>> Hi,
>>>
>>> I'm not very deep in your issue. But opening your appconfig.ini with my 
>>> default editor shows that the apostrophe in your authors value could be a 
>>> problem:
>>>
>>> [image: Untitled.jpg]
>>>
>>> Thus, just delete it and have try. If it doesn't change anything, please 
>>> let me know and I will have a closer look.
>>>
>>> Best regards
>>> Clemens
>>>
>>>
>>>
>>>
>>> On Monday, August 24, 2020 at 11:18:32 AM UTC+2 and...@gmail.com wrote:
>>>
>>>> Hello, if I chose migrate= False and fake_migrate=True the .tables in 
>>>> databases folder are not created.
>>>> Why?
>>>> I'm attaching appconfig.ini and py.db and my custom db db_asset.py
>>>> 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/e1702e2a-1c5f-4d0b-a27b-67cece00d923o%40googlegroups.com.
# -*- coding: utf-8 -*-

# -
# This scaffolding model makes your app work on Google App Engine too
# File is released under public domain and you can use without limitations
# -

if request.global_settings.web2py_version < "2.14.1":
raise HTTP(500, "Requires web2py 2.13.3 or newer")

# -
# if SSL/HTTPS is properly configured and you want all HTTP requests to
# be redirected to HTTPS, uncomment the line below:
# -
# request.requires_https()

# -
# app configuration made easy. Look inside private/appconfig.ini
# -
from gluon.contrib.appconfig import AppConfig

# -
# once in production, remove reload=True to gain full speed
# -
myconf = AppConfig(reload=True)

if not request.env.web2py_runtime_gae:
# -
# if NOT running on Google App Engine use SQLite or other DB
# -
db = DAL(myconf.get('db.uri'),
 pool_size=myconf.get('db.pool_size'),
 migrate_enabled=myconf.get('db.migrate'),
 fake_migrate_all=myconf.get('db.fake_migrate_all'),
 check_reserved=['all'])
else:
# -
# connect to Google BigTable (optional 'google:datastore://namespace')
# -
db = DAL('google:datastore+ndb')
# -
# stor

[web2py] Re: No handlers could be found for logger "web2py"

2020-08-26 Thread Andrea Fae'
hello, I have the same problem.
I don't have logging.conf in web2py folder and I don't have web2py.exe in 
it.

I'm using Windows 10.
thanks

Il giorno giovedì 27 dicembre 2012 14:43:45 UTC+1, Niphlod ha scritto:
>
> do you have a file named logging.conf in the same folder where web2py.py 
> or web2py.exe is ?
>
> Il giorno giovedì 27 dicembre 2012 13:27:44 UTC+1, Ramos ha scritto:
>>
>> hello 
>> im testing scheduler and it works but on the console "command line " i 
>> keep getting the message
>>
>>
>> *No handlers could be found for logger "web2py"*
>>
>> every time the task is run
>>
>> I'm using windows 7
>>
>> thank you
>> António
>>
>>
>>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/830b94c8-ae1d-4e10-9946-b8cf44cabd1ao%40googlegroups.com.


[web2py] Re: fake_migrate=True is not working

2020-08-26 Thread Andrea Fae'
Hello, thank you for your answer.
I deleted the character but nothing changes.
Best regards 
Andrea

Il giorno lunedì 24 agosto 2020 12:39:47 UTC+2, Clemens ha scritto:
>
> Hi,
>
> I'm not very deep in your issue. But opening your appconfig.ini with my 
> default editor shows that the apostrophe in your authors value could be a 
> problem:
>
> [image: Untitled.jpg]
>
> Thus, just delete it and have try. If it doesn't change anything, please 
> let me know and I will have a closer look.
>
> Best regards
> Clemens
>
>
>
>
> On Monday, August 24, 2020 at 11:18:32 AM UTC+2 and...@gmail.com wrote:
>
>> Hello, if I chose migrate= False and fake_migrate=True the .tables in 
>> databases folder are not created.
>> Why?
>> I'm attaching appconfig.ini and py.db and my custom db db_asset.py
>> 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/b5330bed-9c29-4d2c-8f31-0910fd34d0dfo%40googlegroups.com.


[web2py] fake_migrate=True is not working

2020-08-24 Thread Andrea Fae'
) for example
#
# >>> db.define_table('mytable', Field('myfield', 'string'))
#
# Fields can be 'string','text','password','integer','double','boolean'
#   'date','time','datetime','blob','upload', 'reference TABLENAME'
# There is an implicit 'id integer autoincrement' field
# Consult manual for more options, validators, etc.
#
# More API examples for controllers:
#
# >>> db.mytable.insert(myfield='value')
# >>> rows = db(db.mytable.myfield == 'value').select(db.mytable.ALL)
# >>> for row in rows: print row.id, row.myfield
# -

# -
# after defining tables, uncomment below to enable auditing
# ---------
# auth.enable_record_versioning(db)

# personalizzazioni Andrea Fae'
# impostazioni autenticazione AD pnbcc
from gluon.contrib.login_methods.ldap_auth import ldap_auth
auth.settings.login_methods.append(ldap_auth(mode='ad',
 manage_groups=False,
 manage_user=True,
 user_firstname_attrib='displayName:1',
 user_lastname_attrib='displayName:2',
 user_mail_attrib='mail',
 db=db,
 group_name_attrib='cn',
 group_member_attrib='member',
 group_filterstr='objectClass=Group',
 server='bccsi.net',
 logging_level='error',
 base_dn='OU=Office365, OU=BCC_202,OU=BCC_Users,DC=bccsi,DC=net'))

# disabilitazione funzioni utenti
auth.settings.actions_disabled.append('register')
auth.settings.actions_disabled.append('retrieve_username')
auth.settings.actions_disabled.append('request_reset_password')

# se l'utente è loggato ed ha registration_id valorizzato allora è un utente di dominio e pertanto non si dà possibilità di cambiare password
#print auth.is_logged_in()
if auth.is_logged_in() and auth.user.registration_id:
auth.settings.actions_disabled.append('change_password')
# -*- coding: utf-8 -*-
crud = Crud(db)

db.define_table('sede',
Field('nome', requires=[IS_NOT_EMPTY(),IS_NOT_IN_DB(db,'sede.nome')]),
Field('is_active', 'boolean', default=True),
Field('created_on', 'datetime', default=request.now),
Field('created_by', 'integer', default=auth.user_id),
Field('modified_on', 'datetime', update=request.now),
Field('modified_by', 'integer', update=auth.user_id),
singular="Sede",plural="Sedi",migrate='sede.table',
format='%(nome)s')

db.define_table('uo',
Field('nome', requires=[IS_NOT_EMPTY(),IS_NOT_IN_DB(db,'uo.nome')]),
Field('sede', 'reference sede'),
Field('telefono'),
Field('is_active', 'boolean', default=True),
Field('created_on', 'datetime', default=request.now),
Field('created_by', 'integer', default=auth.user_id),
Field('modified_on', 'datetime', update=request.now),
Field('modified_by', 'integer', update=auth.user_id),
singular="Uo",plural="Uo",migrate='uo.table',
format='%(nome)s')

db.define_table('fornitore',
Field('nome', requires=[IS_NOT_EMPTY(),IS_NOT_IN_DB(db,'fornitore.nome')]),
Field('email',requires=[IS_NOT_EMPTY(),IS_EMAIL()]),
Field('is_active', 'boolean', default=True),
Field('created_on', 'datetime', default=request.now),
Field('created_by', 'integer', default=auth.user_id),
Field('modified_on', 'datetime', update=request.now),
Field('modified_by', 'integer', update=auth.user_id),
singular="fornitore",plural="fornitori",migrate='fornitore.table',
format='%(nome)s')

# la combinazione tipo-seriale deve essere unica
db.define_table('asset',
Field('tipo',requires=IS_IN_SET(['BA','CD','FW','MO','PC','SC','SE','ST','SW','SL'])),
Field('seriale', requires=IS_NOT_EMPTY()),
Field('nome',requires=IS_NOT_EMPTY()),
Field('uo', 'reference uo'),
Field('dataconsegna', type='date', requires=IS_DATE()),
Field('datadismissione', type='date'),
Field('modello', type='string'),
Field('fornitore', 'reference fornitore'),
Field('comoda

[web2py] About putting values into database

2020-08-21 Thread Andrea Fae'
Hello, I'm about 1 year that i don't program in web2py and I don't remember 
nothing!

So, easy question

I have this table (I created esplicitally the field is_active, created_on, 
created_by, do not ask me why...it's another question...)

db.define_table('ticket',
Field('asset', 'reference asset'),
Field('fisso', 'boolean'),
Field('anomalia', type='string', 
requires=[IS_NOT_EMPTY(),IS_LENGTH(200)], 
widget=SQLFORM.widgets.text.widget),
Field('chiuso', 'boolean'),
Field('risoluzione', type='string', 
requires=[IS_LENGTH(100)], widget=SQLFORM.widgets.text.widget, default='In 
attesa'),
Field('is_active', 'boolean', default=True),
Field('created_on', 'datetime', default=request.now),
Field('created_by', 'integer', default=auth.user_id),
Field('modified_on', 'datetime', update=request.now),
Field('modified_by', 'integer', update=auth.user_id),
singular="Ticket", plural="Ticket",migrate='ticket.table',
format='%(asset)s')


And I have this function

# crea il ticket per l'asset specificato
@auth.requires_login()
def ticket():
import datetime
# recupero l'asset di cui fare il ticket
asset = db.asset(request.args(0)) or redirect(URL('sedi'))

#verifico se l'asset è già oggetto di un ticket aperto - se lo è 
impedisco l'apertura del ticket
query = (db.ticket.asset == asset) & (db.ticket.chiuso == False)
row = db(query).select().first()
if (row != None):
session.flash = 'Esiste un ticket aperto per questo asset: non è 
possibile aprire un ulteriore ticket'
redirect(URL('index'))

db.ticket.created_by.readable=db.ticket.created_by.writable=True
db.ticket.created_on.readable=db.ticket.created_on.writable=True
db.ticket.asset.default=asset.id
db.ticket.asset.writable=db.ticket.asset.readable=False
db.ticket.fisso.default=True

db.ticket.chiuso.default=db.ticket.chiuso.readable=db.ticket.chiuso.writable=False
db.ticket.risoluzione.readable=db.ticket.risoluzione.writable=False
db.ticket.risoluzione.default="In attesa"
# db.ticket.is_active.default=True
# db.ticket.created_on.default=request.now
# recupero il tipo di asset del ticket
print request.now, auth.user_id
db.ticket.created_by.default = auth.user_id
db.ticket.created_on.default = request.now
tipo_asset = asset.tipo
# definisco la landing_page
landing_page = 'lista_ticket_asset/' + tipo_asset
# print landing_page
# se il form va a buon fine allora va a finire nella lista dei ticket 
aperti di quel tipo asset
form = crud.create(db.ticket, next=landing_page, onaccept=lambda 
form,asset=asset:send_email_ticket(form,asset), message='ticket creato')
# form = crud.create(db.ticket, next='lista_ticket',onaccept=lambda 
form,asset=asset:send_email_ticket(form,asset))
#form.add_button("Annulla",URL('sedi'))
# form[0][-1][1].append(TAG.BUTTON('Annulla', _class='btn btn-default', 
_type='Cancel',_onclick="document.location='%s';return false" % 
URL('lista_ticket_asset',args=tipo_asset)))
form[0][-1][1].append(TAG.BUTTON('Annulla', _class='btn btn-default', 
_type='Cancel',_onclick="document.location='%s';return false" % 
URL('index')))
db.ticket.chiuso.readable=db.ticket.chiuso.writable=True
db.ticket.risoluzione.readable=db.ticket.risoluzione.writable=True

return dict(form=form, asset=asset)

When I create a "ticket" I'm not able to put into fields created_by and 
created_on the right information

This is the result

1 selezionato
ticket.id 

ticket.asset 

ticket.fisso 

ticket.anomalia 

ticket.chiuso 

ticket.risoluzione 

ticket.is_active 

ticket.created_on 

ticket.created_by 

ticket.modified_on 

ticket.modified_by 

24  PC 
CNU411DJR3  
True ooo False In attesa False None 0 None 0





What is wrong? How to correct?
Thank  you

-- 
Resources:
- http://web2py.com
- http://web2py.com/book 

[web2py] MS SQL and searchable=true

2020-08-21 Thread Andrea Fae'
Using search standard widget with MS SQL server and trying to search only 
typing a string causes this error

for example when I search simply "202h719" it appears this

Query Not Supported: ('42000', u'[42000] [Microsoft][ODBC SQL Server 
Driver][SQL Server]Argument data type text is invalid for argument 1 of 
lower function. (8116) (SQLExecDirectW)')

if I search typing asset.nome = "202H719" it works.


-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/b18f65b0-d5a5-4d94-9fbf-8460684762aeo%40googlegroups.com.


[web2py] Re: DAL Could not create constraint or index

2020-08-21 Thread Andrea Fae'
...but this error is not clear with me

Error ticket for "ITAsset"Ticket ID

127.0.0.1.2020-08-21.09-54-23.77579ea3-20b8-49ca-aed5-76c10960c92f
 ('23000', u"[23000] [Microsoft][ODBC SQL 
Server Driver][SQL Server]Cannot insert the value NULL into column 'id', 
table 'itassetdb.dbo.asset_archive'; column does not allow nulls. INSERT 
fails. (515) (SQLExecDirectW); [23000] [Microsoft][ODBC SQL Server 
Driver][SQL Server]The statement has been terminated. (3621)")

insert a NULL value into culumn'id' on table asset_archive? Why?


Il giorno venerdì 21 agosto 2020 10:04:15 UTC+2, Andrea Fae' ha scritto:
>
> I think the problem with archiving is when I defined archive table in 
> mssql I defined a field named 'current_record" type int. Maybe type int is 
> not correct, isn't it?
> Thank you
>
> Il giorno venerdì 21 agosto 2020 09:43:14 UTC+2, Andrea Fae' ha scritto:
>>
>> Hello, some updates.
>> In the databases I can see only this (see attachment).
>> I'm trying to manage record versionin (table archiving). I create for 
>> example asset.archive in mssql but web2py doesn't "see" the table. In fact 
>> the table is not listend in the appadmin page.
>> The question is that tables definitions are not created in the databases 
>> folder, even if I put migrate=false in appconfig.ini and in db.py I typed 
>> migrate_fake=true... ???
>>
>>
>>
>> Il giorno giovedì 20 agosto 2020 16:57:26 UTC+2, Andrea Fae' ha scritto:
>>>
>>> UPDATES
>>>
>>> in appconfig.ini I changed from migrate= true to migrate=false.
>>>
>>> tha system doesn't create me the sql.log and .table file definitions in 
>>> the folder databases, but the application seems start to work! How is 
>>> posisble?
>>>
>>>
>>> Il giorno giovedì 20 agosto 2020 16:45:35 UTC+2, Andrea Fae' ha scritto:
>>>>
>>>> Hello Villas, first al all...thank  you thank you thank you! But I 
>>>> didn't arrived to the end of the game yet. but I think I'm near with your 
>>>> suggestions.
>>>>
>>>> I followed the "easier solution" and, with a lot of effort, now I have 
>>>> my MSSQL database filled of my data.
>>>> But when I start tha application web2py I have this error:
>>>>
>>>> Error ticket for "ITAsset"Ticket ID
>>>>
>>>> 127.0.0.1.2020-08-20.16-37-26.91c5b362-833d-4bdc-afef-3b727fde37a8
>>>>  ('42S01', u"[42S01] [Microsoft][ODBC 
>>>> SQL Server Driver][SQL Server]There is already an object named 'sede' in 
>>>> the database. (2714) (SQLExecDirectW)")Versione
>>>> web2py™ Version 2.14.6-stable+timestamp.2016.05.10.00.21.47
>>>> Python Python 2.7.15: C:\Python27\python.exe (prefix: C:\Python27)
>>>> Traceback
>>>>
>>>> 1.
>>>> 2.
>>>> 3.
>>>> 4.
>>>> 5.
>>>> 6.
>>>> 7.
>>>> 8.
>>>> 9.
>>>> 10.
>>>> 11.
>>>> 12.
>>>> 13.
>>>> 14.
>>>> 15.
>>>> 16.
>>>> 17.
>>>> 18.
>>>> 19.
>>>>
>>>> Traceback (most recent call last):
>>>>   File "C:\web2py\gluon\restricted.py", line 227, in restricted
>>>> exec ccode in environment
>>>>   File "c:/web2py/applications/ITAsset/models/db_asset.py" 
>>>> <http://127.0.0.1:8000/admin/default/edit/ITAsset/models/db_asset.py>, 
>>>> line 12, in 
>>>> format='%(nome)s')
>>>>   File "C:\web2py\gluon\packages\dal\pydal\base.py", line 834, in 
>>>> define_table
>>>> table = self.lazy_define_table(tablename,*fields,**args)
>>>>   File "C:\web2py\gluon\packages\dal\pydal\base.py", line 873, in 
>>>> lazy_define_table
>>>> polymodel=polymodel)
>>>>   File "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 482, in 
>>>> create_table
>>>> self.create_sequence_and_triggers(query, table)
>>>>   File "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 1369, 
>>>> in create_sequence_and_triggers
>>>> self.execute(query)
>>>>   File "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 1388, 
>>>> in execute
>>>> return self.log_execute(*a, **b)
>>>>   File "C:\web2py\gluon\packages\dal\pydal\adapters\b

[web2py] Re: DAL Could not create constraint or index

2020-08-21 Thread Andrea Fae'
I think the problem with archiving is when I defined archive table in mssql 
I defined a field named 'current_record" type int. Maybe type int is not 
correct, isn't it?
Thank you

Il giorno venerdì 21 agosto 2020 09:43:14 UTC+2, Andrea Fae' ha scritto:
>
> Hello, some updates.
> In the databases I can see only this (see attachment).
> I'm trying to manage record versionin (table archiving). I create for 
> example asset.archive in mssql but web2py doesn't "see" the table. In fact 
> the table is not listend in the appadmin page.
> The question is that tables definitions are not created in the databases 
> folder, even if I put migrate=false in appconfig.ini and in db.py I typed 
> migrate_fake=true... ???
>
>
>
> Il giorno giovedì 20 agosto 2020 16:57:26 UTC+2, Andrea Fae' ha scritto:
>>
>> UPDATES
>>
>> in appconfig.ini I changed from migrate= true to migrate=false.
>>
>> tha system doesn't create me the sql.log and .table file definitions in 
>> the folder databases, but the application seems start to work! How is 
>> posisble?
>>
>>
>> Il giorno giovedì 20 agosto 2020 16:45:35 UTC+2, Andrea Fae' ha scritto:
>>>
>>> Hello Villas, first al all...thank  you thank you thank you! But I 
>>> didn't arrived to the end of the game yet. but I think I'm near with your 
>>> suggestions.
>>>
>>> I followed the "easier solution" and, with a lot of effort, now I have 
>>> my MSSQL database filled of my data.
>>> But when I start tha application web2py I have this error:
>>>
>>> Error ticket for "ITAsset"Ticket ID
>>>
>>> 127.0.0.1.2020-08-20.16-37-26.91c5b362-833d-4bdc-afef-3b727fde37a8
>>>  ('42S01', u"[42S01] [Microsoft][ODBC 
>>> SQL Server Driver][SQL Server]There is already an object named 'sede' in 
>>> the database. (2714) (SQLExecDirectW)")Versione
>>> web2py™ Version 2.14.6-stable+timestamp.2016.05.10.00.21.47
>>> Python Python 2.7.15: C:\Python27\python.exe (prefix: C:\Python27)
>>> Traceback
>>>
>>> 1.
>>> 2.
>>> 3.
>>> 4.
>>> 5.
>>> 6.
>>> 7.
>>> 8.
>>> 9.
>>> 10.
>>> 11.
>>> 12.
>>> 13.
>>> 14.
>>> 15.
>>> 16.
>>> 17.
>>> 18.
>>> 19.
>>>
>>> Traceback (most recent call last):
>>>   File "C:\web2py\gluon\restricted.py", line 227, in restricted
>>> exec ccode in environment
>>>   File "c:/web2py/applications/ITAsset/models/db_asset.py" 
>>> <http://127.0.0.1:8000/admin/default/edit/ITAsset/models/db_asset.py>, line 
>>> 12, in 
>>> format='%(nome)s')
>>>   File "C:\web2py\gluon\packages\dal\pydal\base.py", line 834, in 
>>> define_table
>>> table = self.lazy_define_table(tablename,*fields,**args)
>>>   File "C:\web2py\gluon\packages\dal\pydal\base.py", line 873, in 
>>> lazy_define_table
>>> polymodel=polymodel)
>>>   File "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 482, in 
>>> create_table
>>> self.create_sequence_and_triggers(query, table)
>>>   File "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 1369, in 
>>> create_sequence_and_triggers
>>> self.execute(query)
>>>   File "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 1388, in 
>>> execute
>>> return self.log_execute(*a, **b)
>>>   File "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 1382, in 
>>> log_execute
>>> ret = self.get_cursor().execute(command, *a[1:], **b)
>>> ProgrammingError: ('42S01', u"[42S01] [Microsoft][ODBC SQL Server 
>>> Driver][SQL Server]There is already an object named 'sede' in the database. 
>>> (2714) (SQLExecDirectW)")
>>>
>>>
>>> I will attach you db.py and dbasset.py, my models and the sql.log 
>>> generated...
>>> I tested with all combination of "migrate" and "fake_migrate" but web2py 
>>> try every time to create the table "sede and so the error.
>>> Can you have another suggestion? when I will finish I inveted you yo a 
>>> dinner in the restaurant! :-)
>>>
>>> thank you
>>>
>>>
>>> Il giorno mercoledì 19 agosto 2020 12:32:20 UTC+2, villas ha scritto:
>>>>
>>>> *An easier solution for you could be this!*
>>>> Simply spe

[web2py] Re: DAL Could not create constraint or index

2020-08-21 Thread Andrea Fae'
Hello, some updates.
In the databases I can see only this (see attachment).
I'm trying to manage record versionin (table archiving). I create for 
example asset.archive in mssql but web2py doesn't "see" the table. In fact 
the table is not listend in the appadmin page.
The question is that tables definitions are not created in the databases 
folder, even if I put migrate=false in appconfig.ini and in db.py I typed 
migrate_fake=true... ???



Il giorno giovedì 20 agosto 2020 16:57:26 UTC+2, Andrea Fae' ha scritto:
>
> UPDATES
>
> in appconfig.ini I changed from migrate= true to migrate=false.
>
> tha system doesn't create me the sql.log and .table file definitions in 
> the folder databases, but the application seems start to work! How is 
> posisble?
>
>
> Il giorno giovedì 20 agosto 2020 16:45:35 UTC+2, Andrea Fae' ha scritto:
>>
>> Hello Villas, first al all...thank  you thank you thank you! But I didn't 
>> arrived to the end of the game yet. but I think I'm near with your 
>> suggestions.
>>
>> I followed the "easier solution" and, with a lot of effort, now I have my 
>> MSSQL database filled of my data.
>> But when I start tha application web2py I have this error:
>>
>> Error ticket for "ITAsset"Ticket ID
>>
>> 127.0.0.1.2020-08-20.16-37-26.91c5b362-833d-4bdc-afef-3b727fde37a8
>>  ('42S01', u"[42S01] [Microsoft][ODBC 
>> SQL Server Driver][SQL Server]There is already an object named 'sede' in 
>> the database. (2714) (SQLExecDirectW)")Versione
>> web2py™ Version 2.14.6-stable+timestamp.2016.05.10.00.21.47
>> Python Python 2.7.15: C:\Python27\python.exe (prefix: C:\Python27)
>> Traceback
>>
>> 1.
>> 2.
>> 3.
>> 4.
>> 5.
>> 6.
>> 7.
>> 8.
>> 9.
>> 10.
>> 11.
>> 12.
>> 13.
>> 14.
>> 15.
>> 16.
>> 17.
>> 18.
>> 19.
>>
>> Traceback (most recent call last):
>>   File "C:\web2py\gluon\restricted.py", line 227, in restricted
>> exec ccode in environment
>>   File "c:/web2py/applications/ITAsset/models/db_asset.py" 
>> <http://127.0.0.1:8000/admin/default/edit/ITAsset/models/db_asset.py>, line 
>> 12, in 
>> format='%(nome)s')
>>   File "C:\web2py\gluon\packages\dal\pydal\base.py", line 834, in 
>> define_table
>> table = self.lazy_define_table(tablename,*fields,**args)
>>   File "C:\web2py\gluon\packages\dal\pydal\base.py", line 873, in 
>> lazy_define_table
>> polymodel=polymodel)
>>   File "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 482, in 
>> create_table
>> self.create_sequence_and_triggers(query, table)
>>   File "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 1369, in 
>> create_sequence_and_triggers
>> self.execute(query)
>>   File "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 1388, in 
>> execute
>> return self.log_execute(*a, **b)
>>   File "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 1382, in 
>> log_execute
>> ret = self.get_cursor().execute(command, *a[1:], **b)
>> ProgrammingError: ('42S01', u"[42S01] [Microsoft][ODBC SQL Server 
>> Driver][SQL Server]There is already an object named 'sede' in the database. 
>> (2714) (SQLExecDirectW)")
>>
>>
>> I will attach you db.py and dbasset.py, my models and the sql.log 
>> generated...
>> I tested with all combination of "migrate" and "fake_migrate" but web2py 
>> try every time to create the table "sede and so the error.
>> Can you have another suggestion? when I will finish I inveted you yo a 
>> dinner in the restaurant! :-)
>>
>> thank you
>>
>>
>> Il giorno mercoledì 19 agosto 2020 12:32:20 UTC+2, villas ha scritto:
>>>
>>> *An easier solution for you could be this!*
>>> Simply specify your created_by/modified_by as extra fields (which should 
>>> side-step self-referencing probem).
>>> I didn't test it, but it seems like a good idea to me. You can then use 
>>> normal migrations etc.
>>>
>>> auth.settings.extra_fields['auth_user']= [
>>>
>>>  Field('is_active', 'boolean', default=True),
>>>  Field('created_on', 'datetime', default=request.now),
>>>  Field('created_by', 'integer', default=auth.user_id),
>>>  Field('modified_on', 'datetime', update=request.now),
>>>  

[web2py] Re: DAL Could not create constraint or index

2020-08-20 Thread Andrea Fae'
UPDATES

in appconfig.ini I changed from migrate= true to migrate=false.

tha system doesn't create me the sql.log and .table file definitions in the 
folder databases, but the application seems start to work! How is posisble?


Il giorno giovedì 20 agosto 2020 16:45:35 UTC+2, Andrea Fae' ha scritto:
>
> Hello Villas, first al all...thank  you thank you thank you! But I didn't 
> arrived to the end of the game yet. but I think I'm near with your 
> suggestions.
>
> I followed the "easier solution" and, with a lot of effort, now I have my 
> MSSQL database filled of my data.
> But when I start tha application web2py I have this error:
>
> Error ticket for "ITAsset"Ticket ID
>
> 127.0.0.1.2020-08-20.16-37-26.91c5b362-833d-4bdc-afef-3b727fde37a8
>  ('42S01', u"[42S01] [Microsoft][ODBC SQL 
> Server Driver][SQL Server]There is already an object named 'sede' in the 
> database. (2714) (SQLExecDirectW)")Versione
> web2py™ Version 2.14.6-stable+timestamp.2016.05.10.00.21.47
> Python Python 2.7.15: C:\Python27\python.exe (prefix: C:\Python27)
> Traceback
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
> 10.
> 11.
> 12.
> 13.
> 14.
> 15.
> 16.
> 17.
> 18.
> 19.
>
> Traceback (most recent call last):
>   File "C:\web2py\gluon\restricted.py", line 227, in restricted
> exec ccode in environment
>   File "c:/web2py/applications/ITAsset/models/db_asset.py" 
> <http://127.0.0.1:8000/admin/default/edit/ITAsset/models/db_asset.py>, line 
> 12, in 
> format='%(nome)s')
>   File "C:\web2py\gluon\packages\dal\pydal\base.py", line 834, in define_table
> table = self.lazy_define_table(tablename,*fields,**args)
>   File "C:\web2py\gluon\packages\dal\pydal\base.py", line 873, in 
> lazy_define_table
> polymodel=polymodel)
>   File "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 482, in 
> create_table
> self.create_sequence_and_triggers(query, table)
>   File "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 1369, in 
> create_sequence_and_triggers
> self.execute(query)
>   File "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 1388, in 
> execute
> return self.log_execute(*a, **b)
>   File "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 1382, in 
> log_execute
> ret = self.get_cursor().execute(command, *a[1:], **b)
> ProgrammingError: ('42S01', u"[42S01] [Microsoft][ODBC SQL Server Driver][SQL 
> Server]There is already an object named 'sede' in the database. (2714) 
> (SQLExecDirectW)")
>
>
> I will attach you db.py and dbasset.py, my models and the sql.log 
> generated...
> I tested with all combination of "migrate" and "fake_migrate" but web2py 
> try every time to create the table "sede and so the error.
> Can you have another suggestion? when I will finish I inveted you yo a 
> dinner in the restaurant! :-)
>
> thank you
>
>
> Il giorno mercoledì 19 agosto 2020 12:32:20 UTC+2, villas ha scritto:
>>
>> *An easier solution for you could be this!*
>> Simply specify your created_by/modified_by as extra fields (which should 
>> side-step self-referencing probem).
>> I didn't test it, but it seems like a good idea to me. You can then use 
>> normal migrations etc.
>>
>> auth.settings.extra_fields['auth_user']= [
>>
>>  Field('is_active', 'boolean', default=True),
>>  Field('created_on', 'datetime', default=request.now),
>>  Field('created_by', 'integer', default=auth.user_id),
>>  Field('modified_on', 'datetime', update=request.now),
>>  Field('modified_by', 'integer', update=auth.user_id)
>>
>> ]
>>
>> auth.define_tables(... signature=False )
>>
>> *Otherwise, in answer to your questions...*
>> migrate='asset_archive.table'
>> Personally, I do not specify the table definition name as the one given 
>> automatically by web2py is very good.  I just use migrate=True/False.
>> If you use migrate='asset_archive.table',  you are also specifying 
>> migrate=True
>>
>> fake_migrate=True
>> This is used to recreate the .table file without touching your DB.
>> If you manually create and edit the fields in your DB,  you may wish to 
>> recreate the .table definition file (hence fake_migrate).
>>
>> I am not sure how you are using the archiving etc,  but I do know this:  
>>
>>- you can manually create your own DB on-disk structure with whatever 
>>triggers

[web2py] Re: DAL Could not create constraint or index

2020-08-20 Thread Andrea Fae'
Hello Villas, first al all...thank  you thank you thank you! But I didn't 
arrived to the end of the game yet. but I think I'm near with your 
suggestions.

I followed the "easier solution" and, with a lot of effort, now I have my 
MSSQL database filled of my data.
But when I start tha application web2py I have this error:

Error ticket for "ITAsset"Ticket ID

127.0.0.1.2020-08-20.16-37-26.91c5b362-833d-4bdc-afef-3b727fde37a8
 ('42S01', u"[42S01] [Microsoft][ODBC SQL 
Server Driver][SQL Server]There is already an object named 'sede' in the 
database. (2714) (SQLExecDirectW)")Versione
web2py™ Version 2.14.6-stable+timestamp.2016.05.10.00.21.47
Python Python 2.7.15: C:\Python27\python.exe (prefix: C:\Python27)Traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.

Traceback (most recent call last):
  File "C:\web2py\gluon\restricted.py", line 227, in restricted
exec ccode in environment
  File "c:/web2py/applications/ITAsset/models/db_asset.py" 
<http://127.0.0.1:8000/admin/default/edit/ITAsset/models/db_asset.py>, line 12, 
in 
format='%(nome)s')
  File "C:\web2py\gluon\packages\dal\pydal\base.py", line 834, in define_table
table = self.lazy_define_table(tablename,*fields,**args)
  File "C:\web2py\gluon\packages\dal\pydal\base.py", line 873, in 
lazy_define_table
polymodel=polymodel)
  File "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 482, in 
create_table
self.create_sequence_and_triggers(query, table)
  File "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 1369, in 
create_sequence_and_triggers
self.execute(query)
  File "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 1388, in 
execute
return self.log_execute(*a, **b)
  File "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 1382, in 
log_execute
ret = self.get_cursor().execute(command, *a[1:], **b)
ProgrammingError: ('42S01', u"[42S01] [Microsoft][ODBC SQL Server Driver][SQL 
Server]There is already an object named 'sede' in the database. (2714) 
(SQLExecDirectW)")


I will attach you db.py and dbasset.py, my models and the sql.log 
generated...
I tested with all combination of "migrate" and "fake_migrate" but web2py 
try every time to create the table "sede and so the error.
Can you have another suggestion? when I will finish I inveted you yo a 
dinner in the restaurant! :-)

thank you


Il giorno mercoledì 19 agosto 2020 12:32:20 UTC+2, villas ha scritto:
>
> *An easier solution for you could be this!*
> Simply specify your created_by/modified_by as extra fields (which should 
> side-step self-referencing probem).
> I didn't test it, but it seems like a good idea to me. You can then use 
> normal migrations etc.
>
> auth.settings.extra_fields['auth_user']= [
>
>  Field('is_active', 'boolean', default=True),
>  Field('created_on', 'datetime', default=request.now),
>  Field('created_by', 'integer', default=auth.user_id),
>  Field('modified_on', 'datetime', update=request.now),
>  Field('modified_by', 'integer', update=auth.user_id)
>
> ]
>
> auth.define_tables(... signature=False )
>
> *Otherwise, in answer to your questions...*
> migrate='asset_archive.table'
> Personally, I do not specify the table definition name as the one given 
> automatically by web2py is very good.  I just use migrate=True/False.
> If you use migrate='asset_archive.table',  you are also specifying 
> migrate=True
>
> fake_migrate=True
> This is used to recreate the .table file without touching your DB.
> If you manually create and edit the fields in your DB,  you may wish to 
> recreate the .table definition file (hence fake_migrate).
>
> I am not sure how you are using the archiving etc,  but I do know this:  
>
>- you can manually create your own DB on-disk structure with whatever 
>triggers, indexes etc you require.
>- in web2py you can use define_table to create a web2py meta 
>definition (which must be compatible with what is on disk!)
>- you can use fake_migrate if you wish to create a .table definition 
>file (which will reflect your web2py define_table)
>- you can use migrate=False to prevent web2py from attempting to 
>migrate the physical DB on-disk structure
>
> Using the above, the book explanation should make a little more sense.  
>
> 
>
>
>
>
>
> On Wednesday, 19 August 2020 09:43:42 UTC+1, Andrea Fae' wrote:
>
>> Hello Villas, unfortunately other problems to this game...
>> I used archiving, and so this type of table definitions
>>
>> db.define_table('asset_archive',
>> 

[web2py] Re: DAL Could not create constraint or index

2020-08-19 Thread Andrea Fae'
Hello Villas, unfortunately other problems to this game...
I used archiving, and so this type of table definitions

db.define_table('asset_archive',
Field('current_record', db.asset),
db.asset,migrate='asset_archive.table')

but I have the same problem regarding FOREIGN KEYS...no way to recreate the 
tables.

Do I have to give up the record archiving? Waht do you think?

If you can, please can you explain the meaning of fake_migrate? I never 
used and in the book is not very well explained. 

Thank you



Il giorno martedì 18 agosto 2020 22:38:50 UTC+2, villas ha scritto:
>
> I presume therefore that you need those fields.  This is the kind of thing 
> I do to get things working.  Please forgive me if I've missed something.
>
>- I would create those required fields manually in your database 
>(without the constraint that causes the problem).
>- Set auth.define_tables(migrate = True, fake_migrate=True)
>- Run the app.  This will create the .table definition file in the 
>databases dir.  You may have had to delete the old .table file.  If 
>necessary delete that.
>- Set auth.define_tables(migrate =False) again.
>
>
> Sorry if this seems strange, but it is a work around solution.
> I am hoping that someone will eventually fix this contraint problem in 
> pyDal.
>
>
> On Tuesday, 18 August 2020 20:51:57 UTC+1, Andrea Fae' wrote:
>>
>> Thank you Villas. I'm using option 2 and now I have the tables without 
>> "created_by" and "modified_by".
>> Now I will try to reset signature=true and see what will happen. If it 
>> causes the same error I could add but they will not managed automatically 
>> by web2py, or I'm wrong?
>> What do you suggest?
>> Thank you for your precious information.
>>
>> Il giorno lunedì 17 agosto 2020 14:24:25 UTC+2, villas ha scritto:
>>>
>>> Hi Andrea
>>> I was pleased to see you are making progress with the DB connection etc.
>>> I can see why mssql does not like the cascade from the same auth_user 
>>> table.  This may be an issue which needs fixing...
>>> To get things moving, and this might not be ideal, but I propose you 
>>> consider either of these options:
>>>
>>>1. Create manually your own tables without those contraints.  You 
>>>then set this:  auth.define_tables(... migrate=False ) so that pyDal 
>>>skips creation. 
>>>2. Do not include the signature fields with your auth.  
>>>auth.define_tables(... signature=False )
>>>
>>> Incidentally,  I use option 2 and I therefore do not benefit from the 
>>> created and modified info,  but I could easily remedy this by adding the 
>>> fields if I wished.
>>> Hope this helps.
>>>
>>>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/6abf4f78-8ed7-4332-8ba4-621f897b7dd9o%40googlegroups.com.


[web2py] Re: DAL Could not create constraint or index

2020-08-18 Thread Andrea Fae'
Thank you Villas. I'm using option 2 and now I have the tables without 
"created_by" and "modified_by".
Now I will try to reset signature=true and see what will happen. If it 
causes the same error I could add but they will not managed automatically 
by web2py, or I'm wrong?
What do you suggest?
Thank you for your precious information.

Il giorno lunedì 17 agosto 2020 14:24:25 UTC+2, villas ha scritto:
>
> Hi Andrea
> I was pleased to see you are making progress with the DB connection etc.
> I can see why mssql does not like the cascade from the same auth_user 
> table.  This may be an issue which needs fixing...
> To get things moving, and this might not be ideal, but I propose you 
> consider either of these options:
>
>1. Create manually your own tables without those contraints.  You then 
>set this:  auth.define_tables(... migrate=False ) so that pyDal skips 
>creation. 
>2. Do not include the signature fields with your auth.  
>auth.define_tables(... signature=False )
>
> Incidentally,  I use option 2 and I therefore do not benefit from the 
> created and modified info,  but I could easily remedy this by adding the 
> fields if I wished.
> Hope this helps.
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/b08c2ba6-3847-4571-a3d3-27258637c1d9o%40googlegroups.com.


[web2py] Re: URI for mssql

2020-08-18 Thread Andrea Fae'
if you use mssql 2016 you maybe it's better to use this: 
mssql4://user:password@servername/databasename

I'm not specifying instance, and it seems working. Maybe I will try with 
the instance too.
thanks

Il giorno martedì 18 agosto 2020 07:18:06 UTC+2, T.R.Rajkumar ha scritto:
>
> I use the following.
> mssql2://user:pwd@servername\instance/databasename
> for connecting to mssql 2016
> I have my webserver apache and web2py running in windows8.
> mssql in windows 2016 server.
> In servername I use the IP of the machine.
> In instancename I have SQL16S7INS1   --- the instance name created by me 
> when installing mssql
> In databasename I have ocms_nlc   which is the database I have created 
> in mssql
> In username I give sa. You can give restricted username also if you have 
> created one and given permission for that user to the concerned database.
>
>
> On Sunday, August 16, 2020 at 3:24:18 PM UTC+5:30 and...@gmail.com wrote:
>
>> Is it correct this uri to connect to mssql server 2016?
>>
>> uri   = mssql4://user:password@servername\instance/databasename
>>
>> or
>>
>> uri   = mssql4://user:password@servername/databasename
>> (without instance)
>>
>> Do I have to use "/" for all separations or even "\"?
>>
>> how can I be sure to use pyodbc or pypyodbc?
>>
>> 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/03416bd6-9dfd-4592-be22-1f7e821c6c6fo%40googlegroups.com.


[web2py] Re: DAL Could not create constraint or index

2020-08-17 Thread Andrea Fae'
This is my sql.log

timestamp: 2020-08-17T13:02:34.812000
CREATE TABLE auth_user(
id INT IDENTITY PRIMARY KEY,
first_name VARCHAR(128) NULL,
last_name VARCHAR(128) NULL,
email VARCHAR(512) NULL,
username VARCHAR(128) NULL,
password VARCHAR(512) NULL,
registration_key VARCHAR(512) NULL,
reset_password_key VARCHAR(512) NULL,
registration_id VARCHAR(512) NULL,
is_active BIT NULL,
created_on DATETIME NULL,
created_by INT  NULL , CONSTRAINT auth_user_created_by__constraint 
FOREIGN KEY (created_by) REFERENCES auth_user (id) ON DELETE CASCADE,
modified_on DATETIME NULL,
modified_by INT  NULL , CONSTRAINT auth_user_modified_by__constraint 
FOREIGN KEY (modified_by) REFERENCES auth_user (id) ON DELETE CASCADE
); 

Il giorno lunedì 17 agosto 2020 12:51:56 UTC+2, Andrea Fae' ha scritto:
>
> When I try to migrate sqlite to mssql and execute the command
>
> python web2py.py -S ITAsset -M -P
>
> (ITAsset is the name of application)
>
> I see this error
>
> ProgrammingError: ('42000', u"[42000] [Microsoft][ODBC SQL Server 
> Driver][SQL Server]Introducing FOREIGN KEY constraint 
> 'auth_user_created_by__constraint' on table 'auth_user' may cause cycles or 
> multiple cascade paths. Specify ON DELETE NO ACTION or ON UPDATE NO ACTION, 
> or modify other FOREIGN KEY constraints. (1785) (SQLExecDirectW); [42000] 
> [Microsoft][ODBC SQL Server Driver][SQL Server]Could not create constraint 
> or index. See previous errors. (1750)")
>
> auth_user is the standard web2py table. So What can I do to permit to this 
> command to create all the tables?
>
>
> 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/f507f63f-4038-4e28-9604-256541784ed0o%40googlegroups.com.


[web2py] DAL Could not create constraint or index

2020-08-17 Thread Andrea Fae'
When I try to migrate sqlite to mssql and execute the command

python web2py.py -S ITAsset -M -P

(ITAsset is the name of application)

I see this error

ProgrammingError: ('42000', u"[42000] [Microsoft][ODBC SQL Server 
Driver][SQL Server]Introducing FOREIGN KEY constraint 
'auth_user_created_by__constraint' on table 'auth_user' may cause cycles or 
multiple cascade paths. Specify ON DELETE NO ACTION or ON UPDATE NO ACTION, 
or modify other FOREIGN KEY constraints. (1785) (SQLExecDirectW); [42000] 
[Microsoft][ODBC SQL Server Driver][SQL Server]Could not create constraint 
or index. See previous errors. (1750)")

auth_user is the standard web2py table. So What can I do to permit to this 
command to create all the tables?


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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/e8df773b-de4e-4996-96e0-40bce2c7aa44o%40googlegroups.com.


[web2py] URI for mssql

2020-08-16 Thread Andrea Fae'
Is it correct this uri to connect to mssql server 2016?

uri   = mssql4://user:password@servername\instance/databasename

or

uri   = mssql4://user:password@servername/databasename
(without instance)

Do I have to use "/" for all separations or even "\"?

how can I be sure to use pyodbc or pypyodbc?

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/31b69416-068a-408a-a623-42ccfb79dc4fo%40googlegroups.com.


[web2py] Re: Server SQL non existent or access denied

2020-08-16 Thread Andrea Fae'
Hello Villas, first thanks so much. You are gently.
I will have possibility tomorrow to test. I just installed ODBC driver 17 
in my client, so tomorrow I will test first of all if with a windows DSN 
connection it's possible to connect to SQL server 2016. After it I will try 
using web2py...But I don't know the implication about windows ODBC driver, 
pyodbc (it's another odbc driver...so independent from windows ODBC driver 
I think), and I don't know exactly if my DAL syntax is correct or not, 
because I found different syntax in the web.
If there will be anyone who could help me I will be very grateful.
Thank you so much Villas!!

Il giorno sabato 15 agosto 2020 17:27:41 UTC+2, villas ha scritto:
>
> >> Do I have to install any ODBC SQL Server Driver on my client?
>
> Hi Andrea
> I feel your frustration and, although I do not use mssql,  I believe you 
> will certainly require a suitable ODBC driver installed so you can then 
> connect to that datasource using pyobc.
> Maybe this will help  https://github.com/mkleehammer/pyodbc/wiki
> Note that you should be able to use the pyodbc library independently from 
> web2py.
> I hope that other mssql users can give better advice.
> All the best
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/a3fd7654-838e-416b-b7f6-8c531388979ao%40googlegroups.com.


[web2py] Re: Server SQL non existent or access denied

2020-08-15 Thread Andrea Fae'
Please can anyone help me? thank you

Il giorno venerdì 14 agosto 2020 alle 12:47:36 UTC+2 Andrea Fae' ha scritto:

> Hello I have this problem
>
> c:\web2py>python web2py.py -S ITAsset -M -P
> No handlers could be found for logger "web2py"
> web2py Web Framework
> Created by Massimo Di Pierro, Copyright 2007-2020
> Version 2.14.6-stable+timestamp.2016.05.10.00.21.47
> Database drivers available: sqlite3, imaplib, pyodbc, pymysql, pg8000
> Traceback (most recent call last):
>   File "c:\web2py\gluon\restricted.py", line 227, in restricted
> exec ccode in environment
>   File "applications\ITAsset\models\db.py", line 35, in 
> check_reserved=['all'])
>   File "c:\web2py\gluon\packages\dal\pydal\base.py", line 174, in __call__
> obj = super(MetaDAL, cls).__call__(*args, **kwargs)
>   File "c:\web2py\gluon\packages\dal\pydal\base.py", line 473, in __init__
> "Failure to connect, tried %d times:\n%s" % (attempts, tb)
> RuntimeError: Failure to connect, tried 5 times:
> Traceback (most recent call last):
>   File "c:\web2py\gluon\packages\dal\pydal\base.py", line 446, in __init__
> self._adapter = ADAPTERS[self._dbname](**kwargs)
>   File "c:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 60, in 
> __call__
> obj = super(AdapterMeta, cls).__call__(*args, **kwargs)
>   File "c:\web2py\gluon\packages\dal\pydal\adapters\mssql.py", line 159, 
> in __init__
> if do_connect: self.reconnect()
>   File "c:\web2py\gluon\packages\dal\pydal\connection.py", line 125, in 
> reconnect
> self.connection = f()
>   File "c:\web2py\gluon\packages\dal\pydal\adapters\mssql.py", line 157, 
> in connector
> return self.driver.connect(cnxn, **driver_args)
>   File "C:\Python27\lib\site-packages\pypyodbc.py", line 2454, in __init__
> self.connect(connectString, autocommit, ansi, timeout, 
> unicode_results, readonly)
>   File "C:\Python27\lib\site-packages\pypyodbc.py", line 2507, in connect
> check_success(self, ret)
>   File "C:\Python27\lib\site-packages\pypyodbc.py", line 1009, in 
> check_success
> ctrl_err(SQL_HANDLE_DBC, ODBC_obj.dbc_h, ret, ODBC_obj.ansi)
>   File "C:\Python27\lib\site-packages\pypyodbc.py", line 987, in ctrl_err
> raise DatabaseError(state,err_text)
> DatabaseError: (u'08001', u'[08001] [Microsoft][ODBC SQL Server 
> Driver][DBNETLIB]Server SQL inesistente o accesso negato.')
>
>
> My uri is 
>
> uri   = mssql4://sa:password@TS-SQL2016R2\SQLEXPRESS/itassetdb
>
> Do I have to install any ODBC SQL Server Driver on my client? In which 
> way? I think I'm using pyodbc driver with python...
> Can you suggest me anything?
> Thanks so much
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/c277bca4-f4dd-43a7-9155-9c271629ad0bn%40googlegroups.com.


[web2py] Server SQL non existent or access denied

2020-08-14 Thread Andrea Fae'
Hello I have this problem

c:\web2py>python web2py.py -S ITAsset -M -P
No handlers could be found for logger "web2py"
web2py Web Framework
Created by Massimo Di Pierro, Copyright 2007-2020
Version 2.14.6-stable+timestamp.2016.05.10.00.21.47
Database drivers available: sqlite3, imaplib, pyodbc, pymysql, pg8000
Traceback (most recent call last):
  File "c:\web2py\gluon\restricted.py", line 227, in restricted
exec ccode in environment
  File "applications\ITAsset\models\db.py", line 35, in 
check_reserved=['all'])
  File "c:\web2py\gluon\packages\dal\pydal\base.py", line 174, in __call__
obj = super(MetaDAL, cls).__call__(*args, **kwargs)
  File "c:\web2py\gluon\packages\dal\pydal\base.py", line 473, in __init__
"Failure to connect, tried %d times:\n%s" % (attempts, tb)
RuntimeError: Failure to connect, tried 5 times:
Traceback (most recent call last):
  File "c:\web2py\gluon\packages\dal\pydal\base.py", line 446, in __init__
self._adapter = ADAPTERS[self._dbname](**kwargs)
  File "c:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 60, in 
__call__
obj = super(AdapterMeta, cls).__call__(*args, **kwargs)
  File "c:\web2py\gluon\packages\dal\pydal\adapters\mssql.py", line 159, in 
__init__
if do_connect: self.reconnect()
  File "c:\web2py\gluon\packages\dal\pydal\connection.py", line 125, in 
reconnect
self.connection = f()
  File "c:\web2py\gluon\packages\dal\pydal\adapters\mssql.py", line 157, in 
connector
return self.driver.connect(cnxn, **driver_args)
  File "C:\Python27\lib\site-packages\pypyodbc.py", line 2454, in __init__
self.connect(connectString, autocommit, ansi, timeout, unicode_results, 
readonly)
  File "C:\Python27\lib\site-packages\pypyodbc.py", line 2507, in connect
check_success(self, ret)
  File "C:\Python27\lib\site-packages\pypyodbc.py", line 1009, in 
check_success
ctrl_err(SQL_HANDLE_DBC, ODBC_obj.dbc_h, ret, ODBC_obj.ansi)
  File "C:\Python27\lib\site-packages\pypyodbc.py", line 987, in ctrl_err
raise DatabaseError(state,err_text)
DatabaseError: (u'08001', u'[08001] [Microsoft][ODBC SQL Server 
Driver][DBNETLIB]Server SQL inesistente o accesso negato.')


My uri is 

uri   = mssql4://sa:password@TS-SQL2016R2\SQLEXPRESS/itassetdb

Do I have to install any ODBC SQL Server Driver on my client? In which way? 
I think I'm using pyodbc driver with python...
Can you suggest me anything?
Thanks so much

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/327092a7-e8b0-4dac-9da5-0a73e425841bo%40googlegroups.com.


[web2py] Re: Migrate web2py sqlite application to mssql

2020-08-14 Thread Andrea Fae'
Hello, I tried and I set in the appconfig.ini this URI

uri   = mssql4://sa:password@TS-SQL2016R2\SQLEXPRESS/itassetdb

TS-SQL2016R2 is the hostname
SQLEXPRESS is the instance
itassetdb is the db created empty

when I try to execute this command

c:\web2py>python web2py.py -S ITAsset -M -P
No handlers could be found for logger "web2py"
web2py Web Framework
Created by Massimo Di Pierro, Copyright 2007-2020
Version 2.14.6-stable+timestamp.2016.05.10.00.21.47
Database drivers available: sqlite3, imaplib, pyodbc, pymysql, pg8000
Traceback (most recent call last):
  File "c:\web2py\gluon\restricted.py", line 227, in restricted
exec ccode in environment
  File "applications\ITAsset\models\db.py", line 34, in 
check_reserved=['all'])
  File "c:\web2py\gluon\packages\dal\pydal\base.py", line 174, in __call__
obj = super(MetaDAL, cls).__call__(*args, **kwargs)
  File "c:\web2py\gluon\packages\dal\pydal\base.py", line 473, in __init__
"Failure to connect, tried %d times:\n%s" % (attempts, tb)
RuntimeError: Failure to connect, tried 5 times:
Traceback (most recent call last):
  File "c:\web2py\gluon\packages\dal\pydal\base.py", line 446, in __init__
self._adapter = ADAPTERS[self._dbname](**kwargs)
  File "c:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 60, in 
__call__
obj = super(AdapterMeta, cls).__call__(*args, **kwargs)
  File "c:\web2py\gluon\packages\dal\pydal\adapters\mssql.py", line 159, in 
__init__
if do_connect: self.reconnect()
  File "c:\web2py\gluon\packages\dal\pydal\connection.py", line 125, in 
reconnect
self.connection = f()
  File "c:\web2py\gluon\packages\dal\pydal\adapters\mssql.py", line 157, in 
connector
return self.driver.connect(cnxn, **driver_args)
  File "c:\web2py\gluon\contrib\pypyodbc.py", line 2434, in __init__
self.connect(connectString, autocommit, ansi, timeout, unicode_results, 
readonly)
  File "c:\web2py\gluon\contrib\pypyodbc.py", line 2483, in connect
check_success(self, ret)
  File "c:\web2py\gluon\contrib\pypyodbc.py", line 988, in check_success
ctrl_err(SQL_HANDLE_DBC, ODBC_obj.dbc_h, ret, ODBC_obj.ansi)
  File "c:\web2py\gluon\contrib\pypyodbc.py", line 966, in ctrl_err
raise DatabaseError(state,err_text)
DatabaseError: (u'08001', u'[08001] [Microsoft][ODBC SQL Server 
Driver][DBNETLIB]Server SQL inesistente o accesso negato.')

I have the error regarding Server SLQ non existent or access denied? What 
can I do?
thank you


Il giorno mercoledì 12 agosto 2020 17:17:17 UTC+2, villas ha scritto:
>
> Here are some notes which you may find helpful...
>
> The basic idea is this:
>
>- Create a new DB using your preferred MSSQL management tool.
>- Change your DAL connection string and run the app.
>- Check that the new DB has all the tables.
>- Migrate your data
>
> Please read the following resources before you start.
>
> *See this section in the book:*  
>
> http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Copy-data-from-one-db-into-another
> The utility script is here:  web2py/scripts/cpdb.py
>
> *Check out this thread:  *
> https://groups.google.com/forum/#!topic/web2py/mQk2hoRf7gw
>
>
> *Appadmin*
> The appadmin allows you to export your data from your old DB.
>
>
> *Be aware of this method:*db.import_from_csv_file()
>
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/ac6b182d-63d2-4500-b10f-3cc479afe047o%40googlegroups.com.


[web2py] Re: Migrate web2py sqlite application to mssql

2020-08-12 Thread Andrea Fae'
Wonderful! I will test. Thank you so much

Il giorno mercoledì 12 agosto 2020 17:17:17 UTC+2, villas ha scritto:
>
> Here are some notes which you may find helpful...
>
> The basic idea is this:
>
>- Create a new DB using your preferred MSSQL management tool.
>- Change your DAL connection string and run the app.
>- Check that the new DB has all the tables.
>- Migrate your data
>
> Please read the following resources before you start.
>
> *See this section in the book:*  
>
> http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Copy-data-from-one-db-into-another
> The utility script is here:  web2py/scripts/cpdb.py
>
> *Check out this thread:  *
> https://groups.google.com/forum/#!topic/web2py/mQk2hoRf7gw
>
>
> *Appadmin*
> The appadmin allows you to export your data from your old DB.
>
>
> *Be aware of this method:*db.import_from_csv_file()
>
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/861f6e7f-10d9-4c71-aab7-d23ad155c7e2o%40googlegroups.com.


[web2py] Migrate web2py sqlite application to mssql

2020-08-12 Thread Andrea Fae'
Hello, can anyone tell me how to migrate a web2py application with simple 
sqlite database to a MSSQL 2016 database?

Only change the DAL? the system create itself all the tables and database? 

Thank you very much to who can answer me!

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/e52da628-f13d-4891-bd4e-5cf44c287934o%40googlegroups.com.


[web2py] Visual Studio Code

2020-04-18 Thread Andrea Fae'
How to use visual Studio Code like IDE and debugger for the last version of 
web2py? 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/55617e7b-de4f-486d-b578-7ed859c799ae%40googlegroups.com.


[web2py] Re: 255

2020-03-29 Thread Andrea Fae'
I'm sorry but is still

Versione
web2py™ Version 2.19.1-stable+timestamp.2020.03.21.21.49.28
Python Python 3.8.2: C:\Python38\python.exe (prefix: C:\Python38)


Il giorno domenica 29 marzo 2020 20:16:57 UTC+2, Dave S ha scritto:
>
>
>
> On Sunday, March 29, 2020 at 8:13:14 AM UTC-7, Andrea Fae' wrote:
>>
>> I have this problem using web2py 2.18 with pyrhon 3.8 and mysql.
>> When I log in int the app it happens this error:
>>
> For 3.8, you may need to update to 2.19.1, just released.
>
> /dps
>
>
>  
>
>>  
>>
>> I don't know id it's an error regarding mysql
>> Versione
>> web2py™ Version 2.19.1-stable+timestamp.2020.03.21.21.49.28
>> Python Python 3.8.2: C:\Python38\python.exe (prefix: C:\Python38)
>> Traceback
>>
>> 1.
>> 2.
>> 3.
>> 4.
>> 5.
>> 6.
>> 7.
>> 8.
>> 9.
>> 10.
>> 11.
>> 12.
>> 13.
>> 14.
>> 15.
>> 16.
>> 17.
>> 18.
>> 19.
>> 20.
>> 21.
>> 22.
>> 23.
>> 24.
>> 25.
>> 26.
>> 27.
>> 28.
>> 29.
>> 30.
>> 31.
>> 32.
>> 33.
>> 34.
>> 35.
>> 36.
>> 37.
>> 38.
>> 39.
>> 40.
>> 41.
>> 42.
>>
>> Traceback (most recent call last):
>>   File "C:\web2py\gluon\restricted.py", line 219, in restricted
>> exec(ccode, environment)
>>   File "C:\web2py\applications\gaweb\controllers/default.py", line 1720, in 
>> 
>>   File "C:\web2py\gluon\globals.py", line 422, in 
>> self._caller = lambda f: f()
>>   File "C:\web2py\applications\gaweb\controllers/default.py", line 1701, in 
>> user
>> return dict(form=auth())
>>   File "C:\web2py\gluon\tools.py", line 1801, in __call__
>> return getattr(self, args[0])()
>>   File "C:\web2py\gluon\tools.py", line 2586, in login
>> user = table_user(**{username: entered_username})
>>   File "C:\web2py\gluon\packages\dal\pydal\objects.py", line 718, in __call__
>> self._db(query)
>>   File "C:\web2py\gluon\packages\dal\pydal\objects.py", line 2634, in select
>> return adapter.select(self.query, fields, attributes)
>>   File "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 878, in 
>> select
>> return self._select_aux(sql, fields, attributes, colnames)
>>   File "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 835, in 
>> _select_aux
>> rows = self._select_aux_execute(sql)
>>   File "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 829, in 
>> _select_aux_execute
>> self.execute(sql)
>>   File "C:\web2py\gluon\packages\dal\pydal\adapters\__init__.py", line 65, 
>> in wrap
>> if not args[0].connection:
>>   File "C:\web2py\gluon\packages\dal\pydal\connection.py", line 32, in 
>> connection
>> return self.get_connection()
>>   File "C:\web2py\gluon\packages\dal\pydal\connection.py", line 65, in 
>> get_connection
>> connection = self.connector()
>>   File "C:\web2py\gluon\packages\dal\pydal\adapters\mysql.py", line 61, in 
>> connector
>> conn = self.driver.connect(**self.driver_args)
>>   File "C:\web2py\gluon\contrib\pymysql\__init__.py", line 90, in Connect
>> return Connection(*args, **kwargs)
>>   File "C:\web2py\gluon\contrib\pymysql\connections.py", line 688, in 
>> __init__
>> self.connect()
>>   File "C:\web2py\gluon\contrib\pymysql\connections.py", line 905, in connect
>> self._get_server_information()
>>   File "C:\web2py\gluon\contrib\pymysql\connections.py", line 1231, in 
>> _get_server_information
>> self.server_charset = charset_by_id(lang).name
>>   File "C:\web2py\gluon\contrib\pymysql\charset.py", line 38, in by_id
>> return self._by_id[id]
>> KeyError: 255
>>
>>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/6ad10c8a-ddf4-4a82-b911-04f771705904%40googlegroups.com.


[web2py] 255

2020-03-29 Thread Andrea Fae'
I have this problem using web2py 2.18 with pyrhon 3.8 and mysql.
When I log in int the app it happens this error:
 255

I don't know id it's an error regarding mysql
Versione
web2py™ Version 2.19.1-stable+timestamp.2020.03.21.21.49.28
Python Python 3.8.2: C:\Python38\python.exe (prefix: C:\Python38)Traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.

Traceback (most recent call last):
  File "C:\web2py\gluon\restricted.py", line 219, in restricted
exec(ccode, environment)
  File "C:\web2py\applications\gaweb\controllers/default.py", line 1720, in 

  File "C:\web2py\gluon\globals.py", line 422, in 
self._caller = lambda f: f()
  File "C:\web2py\applications\gaweb\controllers/default.py", line 1701, in user
return dict(form=auth())
  File "C:\web2py\gluon\tools.py", line 1801, in __call__
return getattr(self, args[0])()
  File "C:\web2py\gluon\tools.py", line 2586, in login
user = table_user(**{username: entered_username})
  File "C:\web2py\gluon\packages\dal\pydal\objects.py", line 718, in __call__
self._db(query)
  File "C:\web2py\gluon\packages\dal\pydal\objects.py", line 2634, in select
return adapter.select(self.query, fields, attributes)
  File "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 878, in 
select
return self._select_aux(sql, fields, attributes, colnames)
  File "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 835, in 
_select_aux
rows = self._select_aux_execute(sql)
  File "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 829, in 
_select_aux_execute
self.execute(sql)
  File "C:\web2py\gluon\packages\dal\pydal\adapters\__init__.py", line 65, in 
wrap
if not args[0].connection:
  File "C:\web2py\gluon\packages\dal\pydal\connection.py", line 32, in 
connection
return self.get_connection()
  File "C:\web2py\gluon\packages\dal\pydal\connection.py", line 65, in 
get_connection
connection = self.connector()
  File "C:\web2py\gluon\packages\dal\pydal\adapters\mysql.py", line 61, in 
connector
conn = self.driver.connect(**self.driver_args)
  File "C:\web2py\gluon\contrib\pymysql\__init__.py", line 90, in Connect
return Connection(*args, **kwargs)
  File "C:\web2py\gluon\contrib\pymysql\connections.py", line 688, in __init__
self.connect()
  File "C:\web2py\gluon\contrib\pymysql\connections.py", line 905, in connect
self._get_server_information()
  File "C:\web2py\gluon\contrib\pymysql\connections.py", line 1231, in 
_get_server_information
self.server_charset = charset_by_id(lang).name
  File "C:\web2py\gluon\contrib\pymysql\charset.py", line 38, in by_id
return self._by_id[id]
KeyError: 255

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/ddbf4973-3890-4e17-9c60-424f562ef040%40googlegroups.com.


Re: [web2py] Fullcalendar v4 and web2py

2020-03-22 Thread Andrea Fae'
thank you. Do you have any guide? Or there is only web site documentation? 
I need to upgrade from version 3...

Il giorno lunedì 16 marzo 2020 10:14:16 UTC+1, Ramos ha scritto:
>
>
>
> {{response.files.append(URL(r=request,c='static/js',f='fullcalendar.min.js'))}}
>
> {{response.files.append(URL(r=request,c='static/css',f='fullcalendar.min.css'))}}
> {{extend 'layout.html'}}
>
> 
> .myclass{
> background-color: white;
>
> }
> #calendar .fc-agenda-axis, #calendar .fc-widget-header {
>   background-color: #C2E6FF;
>   border-color: #AED0EA;
>   font-weight: normal;
>   font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
>   
>   border-radius: 3px ;
> }
> #calendar .fc-event {
>   box-shadow: 2px 2px 2px #706868;
>
> }
> .fc-today {
>background-color: #C2E6FF;
> }
> .fc-day-number {
> font-size: 14px;
> }
> .fc-content{
> text-align:right ;
> cursor:pointer;
> }
> .fc h2 {
>font-size: 20px;
> }
> .fc-scroller {
>overflow-y: hidden !important;
> }
> 
> 
>
> $(document).ready(function() {
> 
> var date = new Date();
> var d = date.getDate();
> var m = date.getMonth();
> var y = date.getFullYear();
>
> $('#calendar').fullCalendar({
> firstDay:1,
> displayEventTime:true,
>
> monthNames: 
> ["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho", "Agosto", 
> "Setembro", "Outubro", "Novembro", "Dezembro" ],
>
> monthNamesShort: 
> ['Jan','Fev','Mar','Abr','Mai','Jun','Jul','Ago','Set','Out','Nov','Dez'],
>
>dayNames: [ 'Domingo', 'Segunda', 'Terça', 'Quarta', 'Quinta', 'Sexta', 
> 'Sábado'],
>dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb'],
>buttonText: {
> today: 'hoje',
> month: 'mês',
> week: 'semana',
> day: 'dia'
>},
> header:{
>   left: 'prev,next today',
> center: 'title',
> right: 'month,basicWeek,basicDay',
>
>   
> },
> eventClick: function(info) {
> alert('Event: ' + info.event.title);
> alert('Coordinates: ' + info.jsEvent.pageX + ',' + info
> .jsEvent.pageY);
> alert('View: ' + info.view.type);
>
> // change the border color just for fun
> info.el.style.borderColor = 'red';
>   },
>   dayClick: function(date, jsEvent, view) {
> $("#inicio").val(date.format()+"T09:00");
> $("#fim").val(date.format()+"T18:00");
>
> },
> editable: false,
> defaultView:'month',
> displayEventTime: true,
> displayEventEnd:true,
>   eventClick: function(event) {
> console.log(event);
> if (event.url) {
> window.open(event.url, "_blank");
> return false;
> }
> },
> height: "auto",
> events: [
> {{for task in ret:}}
>   
>{{color='#f00'}}
>
> {
> {{temp=db.auth_user(id=task["person"])}}
>
> title: '{{=temp["nick"]}}\n   
> </b><br>{{=task["description"]}}',
>  
>          
> color  : '{{=color}}',
> textColor:"#FFF",
> start:'{{=task["eventstart"]}}',
> end: '{{=task["eventend"]}}',
>
>
>
>
> },
> {{pass}}
> ],
> eventRender: function( event, element, view ) {
> var title = element
> .find('.fc-title, .fc-list-item-title');  
> title.html(title.text());
> },
> });
> 
> });
> 
> 
>
>  {{=form}}
> 
>
>
>
> Em dom., 15 de mar. de 2020 às 17:46, Andrea Fae'  > escreveu:
>
>> Anyone have any eocumentation with a examples about using Fullcalendar.io 
>> v4 javascript calendar with web2py?
>> 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

[web2py] Re: web2py with python 2.7 and web2py running on python 3

2020-03-21 Thread Andrea Fae'
I have a windows 10 PC.
I installed c:\python27 and c:\python3 and they are working. I can choose.

But if I try to start web2py it happens this error:

c:\Python3>python.exe c:\web2py\web2py.py
Traceback (most recent call last):
  File "c:\web2py\web2py.py", line 21, in 
import gluon.widget
  File "c:\web2py\gluon\__init__.py", line 37, in 
from .globals import current
  File "c:\web2py\gluon\globals.py", line 24, in 
from gluon.serializers import json, custom_json
  File "c:\web2py\gluon\serializers.py", line 10, in 
from gluon.languages import lazyT
  File "c:\web2py\gluon\languages.py", line 19, in 
from cgi import escape
ImportError: cannot import name 'escape' from 'cgi' (c:\Python3\lib\cgi.py)

I found that changing "from cgi import escape" to "from html import escape" 
it start but I don't knoy why.

Nevertheless If I try to start an app built from Python27 I have this error:

 Failure to connect, tried 5 times: 
Traceback (most recent call last): File 
"C:\web2py\gluon\packages\dal\pydal\base.py", line 454, in __init__ 
self._adapter = adapter(**kwargs) File 
"C:\web2py\gluon\packages\dal\pydal\adapters\__init__.py", line 40, in 
__call__ obj = super(AdapterMeta, cls).__call__(*args, **kwargs) File 
"C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 368, in 
__init__ super(SQLAdapter, self).__init__(*args, **kwargs) File 
"C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 52, in __init__ 
self.reconnect() File "C:\web2py\gluon\packages\dal\pydal\connection.py", 
line 172, in reconnect self.connection = self.connector() File 
"C:\web2py\gluon\packages\dal\pydal\adapters\mysql.py", line 52, in 
connector return self.driver.connect(**self.driver_args) File 
"C:\web2py\gluon\contrib\pymysql\__init__.py", line 90, in Connect return 
Connection(*args, **kwargs) File 
"C:\web2py\gluon\contrib\pymysql\connections.py", line 688, in __init__ 
self.connect() File "C:\web2py\gluon\contrib\pymysql\connections.py", line 
905, in connect self._get_server_information() File 
"C:\web2py\gluon\contrib\pymysql\connections.py", line 1231, in 
_get_server_information self.server_charset = charset_by_id(lang).name File 
"C:\web2py\gluon\contrib\pymysql\charset.py", line 38, in by_id return 
self._by_id[id] KeyError: 255

If I start the same app with web2py on python 2.7 changing back to "from 
cgi import escape" and it's working.
Maybe this is a problem regarding foreign-keys, I had one time in the past 
but really... I don't remember how to fix.

Thank you

Il giorno venerdì 20 marzo 2020 22:05:59 UTC+1, Jonathan Clark ha scritto:
>
> Definitely if you're using the rocket web server. There are various ways 
> to run different versions of python on the same machine but it depends on 
> your OS how to do it. Once you can run different pythons, you can run 
> different versions of web2py at the same time, but you will need to use 
> different ports e.g. 8080, 8081 etc. to direct the traffic to the right 
> web2py instance. That's without Apache.
>
> I also run different web2py instances behind the same Apache instance on a 
> virtual host, but I have set up Apache to forward virtual host one to one 
> port (using .htaccess), and virtual host two to a different port. The 
> rocket server in web2py in each instance is told which port it should 
> respond to. So the browser looks for www.hostone.com, .htaccess forwards 
> that to port number 65789, and a web2py instance is run to service requests 
> to port 65789. For hosttwo, the port number changes.
>
> Here is a snippet of a .htacces file which does what I want:
>
> RewriteCond %{HTTP_HOST}  hostone.com$
> RewriteRule ^(.*)$https://127.0.0.1:65789/$1 [P,QSA,L]
>
> (There is another redirect which directs www.hostone.com to hostone.com).
>
>
> On Saturday, 14 March 2020 19:06:20 UTC, Andrea Fae' wrote:
>>
>> Is it possible to have 2 differents environment on the same PC?
>> web2py running python2.7 and web2py running ppython 3 separated...?
>> 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/74c4d214-c657-4a99-b8a5-0582199f24c9%40googlegroups.com.


[web2py] Fullcalendar v4 and web2py

2020-03-15 Thread Andrea Fae'
Anyone have any eocumentation with a examples about using Fullcalendar.io 
v4 javascript calendar with web2py?
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/113d00b6-37b0-4bcc-8185-4863be823ae4%40googlegroups.com.


[web2py] web2py with python 2.7 and web2py running on python 3

2020-03-14 Thread Andrea Fae'
Is it possible to have 2 differents environment on the same PC?
web2py running python2.7 and web2py running ppython 3 separated...?
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/81ed4136-3600-49a9-8e7b-d6cda7a813c5%40googlegroups.com.


[web2py] 6th book release

2020-03-14 Thread Andrea Fae'
What are the differences between 5th book release and 6th online book 
prerelease?
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/67015dda-37b1-44a4-8dc1-890e7b0b3f83%40googlegroups.com.


[web2py] web2py upgrade from 2.16.1

2020-02-23 Thread Andrea Fae'
I 'm using web2py 2.16.1 stable on my computer and I used it with python 
version 2.7.
I programmed some sites with this RAD system.
So I want to upgrade to the latest 2.18.5 stable and Python 3. What can I 
do to do it?
What could be the implications on my projects made with 2.16 ant python 2?

If all works it's possible to change in the production environment on 
pyrhonanywhere the same? How?
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/e9e7b09c-e421-4c07-aca9-e29f5db0b018%40googlegroups.com.


[web2py] Re: datepicker preserve selecred date after postback

2019-04-26 Thread Andrea Fae'


Il giorno giovedì 25 aprile 2019 21:40:25 UTC+2, Andrea Fae' ha scritto:
>
> How to preserve datepicker selected date after postback using web2py in a 
> javascript view... I think it's a javascript problem but I don't know how 
> to fix it.
> 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] How to intercept the click to the button "search"

2019-04-26 Thread Andrea Fae'
Hello, is it possible to intercept the event regarding click to the 
standard button search?
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: custom search

2019-04-26 Thread Andrea Fae'
They are the standard buttons "Search" and "Reset". I'd like from 
javascript in the html view to execute "Search" by code.
Thank you

Il giorno venerdì 26 aprile 2019 00:05:39 UTC+2, João Matos ha scritto:
>
> You don't have the standard buttons, but have a search button created by 
> you?
>
>
> quinta-feira, 25 de Abril de 2019 às 15:21:41 UTC+1, Andrea Fae' escreveu:
>>
>> I create a custom search, so not standard field with "Search" and "reset" 
>> button standard. How to click the button "Search" programmatically?
>> 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: datepicker preserve selecred date after postback

2019-04-26 Thread Andrea Fae'
Thank you for your answer, but I do not understand the code you wrote...
the 2 fields are only filtering fields, no a db field.

The filtering fields are working well, but I want that the dates selected 
will be preserved after postback. Do I have to read them from the 
querystring? In which way?
thank you

Il giorno venerdì 26 aprile 2019 00:04:39 UTC+2, João Matos ha scritto:
>
> Is the selected date in a db field? Then when editing the same field, the 
> date picker should show the selected date.
>
> If the date is still not saved to a db field but only in js, then you can 
> send it using something similar to this
>
> 
> <!--
> do {
> var correctValues = ["1", "2", "3", ""];
> var retVal = prompt("{{=T('Starting position')}} (1, 
> 2, 3): ", "1");
> } while (!(retVal in correctValues) & retVal !== null);
>
> if (retVal === null) {
> window.location.href = "{{=request.env.http_referer}}"
> ;
> } else {
> window.location.href = "{{
> url = 'https://' if request.is_https else 
> 'http://'
> url += request.env.http_host + request.url + '/'
> =url
> }}" + retVal + "?{{=request.env.query_string}}";
> }
>  //-->
> 
>
>
>
> quinta-feira, 25 de Abril de 2019 às 20:40:25 UTC+1, Andrea Fae' escreveu:
>>
>> How to preserve datepicker selected date after postback using web2py in a 
>> javascript view... I think it's a javascript problem but I don't know how 
>> to fix it.
>> 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] datepicker preserve selecred date after postback

2019-04-25 Thread Andrea Fae'
How to preserve datepicker selected date after postback using web2py in a 
javascript view... I think it's a javascript problem but I don't know how 
to fix it.
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] custom widget search form

2019-04-25 Thread Andrea Fae'
Can anyone help me giving me an example of custom widget search form? 
Better with default values and if is it possible to click "Search" 
programmatically. Thank you very much

-- 
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] custom search

2019-04-25 Thread Andrea Fae'
I create a custom search, so not standard field with "Search" and "reset" 
button standard. How to click the button "Search" programmatically?
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] creating tables with web2py console and mysql

2019-02-19 Thread Andrea Fae'
Hello, why I have this warning?

c:\web2py>python web2py.py -S ga2 -M -P
web2py Web Framework
Created by Massimo Di Pierro, Copyright 2007-2019
Version 2.16.1-stable+timestamp.2017.11.14.05.54.25
Database drivers available: pymysql, imaplib, sqlite3, pg8000, pyodbc, 
mysqlconnector
C:\Python27\lib\site-packages\pymysql\cursors.py:170:* Warning: (3719, 
u"'utf8' is currently an alias for the character set UTF8MB3, but will be 
an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in 
order to be unambiguous.")*
  result = self._query(query)
Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:25:58) [MSC v.1500 64 
bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)

I specified this in the appcoonfig.ini

mysql://root:passwordroot@localhost/ga2db?set_encoding=utf8mb4

If I don't specify ?set_encoding=utf8mb4 the warning is the same
mysql is 8.0.15...

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] mysql import from csv problem

2019-02-19 Thread Andrea Fae'
Hello, when I import with this 
procedure https://www.pythonanywhere.com/forums/topic/1288/ from csv to 
mysql, it alter the ids of some related tables and I have data not 
corresponding to the original exported csv. What can I do?
What is my error? is it depending on charset or something related? 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: Migrate from sqlite to mysql

2019-02-19 Thread Andrea Fae'
Hello, I deleted a foreign key and I was able to import. But I have a 
strange problem. When I export all data is ok, when I import I don't have 
problems to do now but in mysql database some information chenged!

Could it depend on the charset umtf?
Thank you in advance who will answer.

Il giorno lunedì 18 febbraio 2019 08:57:38 UTC+1, Web2_3py ha scritto:
>
> Hi,
>
> I am having the same error (Failure to connect).
>
> I checked the connection to mysql using python command line
> 1
> 2
> >>> import mysql.connector
> >>> mysql.connector.connect(host='localhost',database='mysql',user='root',
> password='')
> and it is success.
>
> What could be the reason of that error?
>
> Thanks.
>
> On Wednesday, February 13, 2019 at 10:55:32 PM UTC+3, Andrea Fae' wrote:
>>
>>
>>  Failure to connect, tried 5 times: 
>> Traceback (most recent call last): File 
>> "C:\web2py\gluon\packages\dal\pydal\base.py", line 454, in __init__ 
>> self._adapter = adapter(**kwargs) File 
>> "C:\web2py\gluon\packages\dal\pydal\adapters\__init__.py", line 40, in 
>> __call__ obj = super(AdapterMeta, cls).__call__(*args, **kwargs) File 
>> "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 368, in 
>> __init__ super(SQLAdapter, self).__init__(*args, **kwargs) File 
>> "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 52, in __init__ 
>> self.reconnect() File "C:\web2py\gluon\packages\dal\pydal\connection.py", 
>> line 172, in reconnect self.connection = self.connector() File 
>> "C:\web2py\gluon\packages\dal\pydal\adapters\mysql.py", line 52, in 
>> connector return self.driver.connect(**self.driver_args) File 
>> "C:\web2py\gluon\contrib\pymysql\__init__.py", line 90, in Connect return 
>> Connection(*args, **kwargs) File 
>> "C:\web2py\gluon\contrib\pymysql\connections.py", line 688, in __init__ 
>> self.connect() File "C:\web2py\gluon\contrib\pymysql\connections.py", line 
>> 905, in connect self._get_server_information() File 
>> "C:\web2py\gluon\contrib\pymysql\connections.py", line 1231, in 
>> _get_server_information self.server_charset = charset_by_id(lang).name File 
>> "C:\web2py\gluon\contrib\pymysql\charset.py", line 38, in by_id return 
>> self._by_id[id] KeyError: 255
>>
>>>
>>>
>>>

-- 
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: Mysql 8.0.15

2019-02-19 Thread Andrea Fae'


Il giorno giovedì 14 febbraio 2019 20:09:22 UTC+1, Andrea Fae' ha scritto:
>
> Hello, I'm sorry but I'm not able to use web2py with this type of db.
>
> I just installed mysql version 8.0.15 on windows 10 pro and I have 
> connector for Python 3.7 and 2.7 installed 
> I created using mysql.exe a db named 'gadb', without any tables.
>
> with web2py I created a new "welcome" application changing db.py in this 
> way (not using appconfig.ini)
>
> i changed only this:
> db = DAL('mysql://root:rootpassword@localhost/gadb',pool_size=20)
> 
> commenting this
> """db = DAL(configuration.get('db.uri'),
>  pool_size=configuration.get('db.pool_size'),
>  migrate_enabled=configuration.get('db.migrate'),
>  check_reserved=['all'])"""
>
> but when I try to start the application I have this error:
>
> Error ticket for "testmysql"Ticket ID
>
> 127.0.0.1.2019-02-14.20-04-44.4a997a45-2232-4144-ab7e-6005309040bb
>  Failure to connect, tried 5 times: 
> Traceback (most recent call last): File 
> "C:\web2py\gluon\packages\dal\pydal\base.py", line 454, in __init__ 
> self._adapter = adapter(**kwargs) File 
> "C:\web2py\gluon\packages\dal\pydal\adapters\__init__.py", line 40, in 
> __call__ obj = super(AdapterMeta, cls).__call__(*args, **kwargs) File 
> "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 368, in 
> __init__ super(SQLAdapter, self).__init__(*args, **kwargs) File 
> "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 52, in __init__ 
> self.reconnect() File "C:\web2py\gluon\packages\dal\pydal\connection.py", 
> line 172, in reconnect self.connection = self.connector() File 
> "C:\web2py\gluon\packages\dal\pydal\adapters\mysql.py", line 52, in 
> connector return self.driver.connect(**self.driver_args) File 
> "C:\web2py\gluon\contrib\pymysql\__init__.py", line 90, in Connect return 
> Connection(*args, **kwargs) File 
> "C:\web2py\gluon\contrib\pymysql\connections.py", line 688, in __init__ 
> self.connect() File "C:\web2py\gluon\contrib\pymysql\connections.py", line 
> 905, in connect self._get_server_information() File 
> "C:\web2py\gluon\contrib\pymysql\connections.py", line 1231, in 
> _get_server_information self.server_charset = charset_by_id(lang).name File 
> "C:\web2py\gluon\contrib\pymysql\charset.py", line 38, in by_id return 
> self._by_id[id] KeyError: 255Versione
> web2py™ Version 2.16.1-stable+timestamp.2017.11.14.05.54.25Traceback
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
> 10.
> 11.
> 12.
> 13.
> 14.
> 15.
> 16.
> 17.
> 18.
> 19.
> 20.
> 21.
> 22.
> 23.
> 24.
> 25.
> 26.
> 27.
> 28.
> 29.
> 30.
> 31.
> 32.
> 33.
> 34.
> 35.
> 36.
>
> Traceback (most recent call last):
>   File "C:\web2py\gluon\restricted.py", line 219, in restricted
> exec(ccode, environment)
>   File "C:/web2py/applications/testmysql/models/db.py" 
> <http://127.0.0.1:8000/admin/default/edit/testmysql/models/db.py>, line 33, 
> in 
> db = DAL('mysql://root:AeDeFsubfi3!@localhost/gadb',pool_size=20)
>   File "C:\web2py\gluon\packages\dal\pydal\base.py", line 169, in __call__
> obj = super(MetaDAL, cls).__call__(*args, **kwargs)
>   File "C:\web2py\gluon\packages\dal\pydal\base.py", line 474, in __init__
> "Failure to connect, tried %d times:\n%s" % (attempts, tb)
> RuntimeError: Failure to connect, tried 5 times:
> Traceback (most recent call last):
>   File "C:\web2py\gluon\packages\dal\pydal\base.py", line 454, in __init__
> self._adapter = adapter(**kwargs)
>   File "C:\web2py\gluon\packages\dal\pydal\adapters\__init__.py", line 40, in 
> __call__
> obj = super(AdapterMeta, cls).__call__(*args, **kwargs)
>   File "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 368, in 
> __init__
> super(SQLAdapter, self).__init__(*args, **kwargs)
>   File "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 52, in 
> __init__
> self.reconnect()
>   File "C:\web2py\gluon\packages\dal\pydal\connection.py", line 172, in 
> reconnect
> self.connection = self.connector()
>   File "C:\web2py\gluon\packages\dal\pydal\adapters\mysql.py", line 52, in 
> connector
> return self.driver.connect(**self.driver_args)
>   File "C:\web2py\gluon\contrib\pymysql\__init__.py", line 90, in Connect
> return Connection(*args, **kwargs)
>   File "C:\web2py\gluon\contrib\pymysql\connections.py", line 688,

[web2py] Re: error connecting to mysql

2019-02-19 Thread Andrea Fae'
I solved the problem. It was a problem regarding foreign keys. I delete 
this binding and it worked. Thank you the same.


Il giorno giovedì 14 febbraio 2019 19:50:21 UTC+1, Andrea Fae' ha scritto:
>
> This database gadb is without tables.
>
> Il giorno mercoledì 13 febbraio 2019 21:46:19 UTC+1, Andrea Fae' ha 
> scritto:
>>
>> Hello. I have this error when I start application "ga"
>>
>> Error ticket for "ga"
>> Ticket ID
>>
>> 127.0.0.1.2019-02-13.20-49-28.fcc1a494-3aa4-42c2-b1a9-ab14a466e72e
>>  Failure to connect, tried 5 times: 
>> Traceback (most recent call last): File 
>> "C:\web2py\gluon\packages\dal\pydal\base.py", line 454, in __init__ 
>> self._adapter = adapter(**kwargs) File 
>> "C:\web2py\gluon\packages\dal\pydal\adapters\__init__.py", line 40, in 
>> __call__ obj = super(AdapterMeta, cls).__call__(*args, **kwargs) File 
>> "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 368, in 
>> __init__ super(SQLAdapter, self).__init__(*args, **kwargs) File 
>> "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 52, in __init__ 
>> self.reconnect() File "C:\web2py\gluon\packages\dal\pydal\connection.py", 
>> line 172, in reconnect self.connection = self.connector() File 
>> "C:\web2py\gluon\packages\dal\pydal\adapters\mysql.py", line 52, in 
>> connector return self.driver.connect(**self.driver_args) File 
>> "C:\web2py\gluon\contrib\pymysql\__init__.py", line 90, in Connect return 
>> Connection(*args, **kwargs) File 
>> "C:\web2py\gluon\contrib\pymysql\connections.py", line 688, in __init__ 
>> self.connect() File "C:\web2py\gluon\contrib\pymysql\connections.py", line 
>> 905, in connect self._get_server_information() File 
>> "C:\web2py\gluon\contrib\pymysql\connections.py", line 1231, in 
>> _get_server_information self.server_charset = charset_by_id(lang).name File 
>> "C:\web2py\gluon\contrib\pymysql\charset.py", line 38, in by_id return 
>> self._by_id[id] KeyError: 255Versione
>> web2py™ Version 2.16.1-stable+timestamp.2017.11.14.05.54.25Traceback
>>
>> 1.
>> 2.
>> 3.
>> 4.
>> 5.
>> 6.
>> 7.
>> 8.
>> 9.
>> 10.
>> 11.
>> 12.
>> 13.
>> 14.
>> 15.
>> 16.
>> 17.
>> 18.
>> 19.
>> 20.
>> 21.
>> 22.
>> 23.
>> 24.
>> 25.
>> 26.
>> 27.
>> 28.
>> 29.
>> 30.
>> 31.
>> 32.
>> 33.
>> 34.
>> 35.
>> 36.
>>
>> Traceback (most recent call last):
>>   File "C:\web2py\gluon\restricted.py", line 219, in restricted
>> exec(ccode, environment)
>>   File "C:/web2py/applications/ga/models/db.py" 
>> <http://127.0.0.1:8000/admin/default/edit/ga/models/db.py>, line 34, in 
>> 
>> check_reserved=['all'])
>>   File "C:\web2py\gluon\packages\dal\pydal\base.py", line 169, in __call__
>> obj = super(MetaDAL, cls).__call__(*args, **kwargs)
>>   File "C:\web2py\gluon\packages\dal\pydal\base.py", line 474, in __init__
>> "Failure to connect, tried %d times:\n%s" % (attempts, tb)
>> RuntimeError: Failure to connect, tried 5 times:
>> Traceback (most recent call last):
>>   File "C:\web2py\gluon\packages\dal\pydal\base.py", line 454, in __init__
>> self._adapter = adapter(**kwargs)
>>   File "C:\web2py\gluon\packages\dal\pydal\adapters\__init__.py", line 40, 
>> in __call__
>> obj = super(AdapterMeta, cls).__call__(*args, **kwargs)
>>   File "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 368, in 
>> __init__
>> super(SQLAdapter, self).__init__(*args, **kwargs)
>>   File "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 52, in 
>> __init__
>> self.reconnect()
>>   File "C:\web2py\gluon\packages\dal\pydal\connection.py", line 172, in 
>> reconnect
>> self.connection = self.connector()
>>   File "C:\web2py\gluon\packages\dal\pydal\adapters\mysql.py", line 52, in 
>> connector
>> return self.driver.connect(**self.driver_args)
>>   File "C:\web2py\gluon\contrib\pymysql\__init__.py", line 90, in Connect
>> return Connection(*args, **kwargs)
>>   File "C:\web2py\gluon\contrib\pymysql\connections.py", line 688, in 
>> __init__
>> self.connect()
>>   File "C:\web2py\gluon\contrib\pymysql\connections.py", line 905, in connect
>> self._get_ser

Re: [web2py] Re: Migrate from sqlite to mysql

2019-02-15 Thread Andrea Fae'
Yesterday night I solved the problem!
It was a problem about python driver...with pip I updated and now I juste 
re-create the database in myslq

But trying to import the csv I have now this problem

>>> db.import_from_csv_file(open('c:\web2py\ga_export.csv','rb'))
Traceback (most recent call last):
  File "", line 1, in 
  File "c:\web2py\gluon\packages\dal\pydal\base.py", line 873, in 
import_from_csv_file
*args, **kwargs)
  File "c:\web2py\gluon\packages\dal\pydal\objects.py", line 1001, in 
import_from_csv_file
curr_id = inserting(**ditems)
  File "c:\web2py\gluon\packages\dal\pydal\objects.py", line 753, in insert
ret = self._db._adapter.insert(self, row.op_values())
  File "c:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 486, in 
insert
raise e
IntegrityError: (1452, u'Cannot add or update a child row: a foreign key 
constraint fails (`gadb`.`auth_user`, CONSTRAINT `auth_user_ibfk_2` FOREIGN 
KEY (`modified_by`) REFERENCES `auth_user` (`id`) ON DELETE CASCADE)')
>>>

Sigh!! What can I do?
Thanks

Il giorno venerdì 15 febbraio 2019 00:11:11 UTC+1, 黄祥 ha scritto:
>
> on the stackoverflow ben's sent seems like problem with mysql ver 8 
> running on windows
> perhaps you can use docker to run mysql or mariadb or percona container 
> (which running on top of linux os)
>
> 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] Mysql 8.0.15

2019-02-14 Thread Andrea Fae'
Hello, I'm sorry but I'm not able to use web2py with this type of db.

I just installed mysql version 8.0.15 on windows 10 pro and I have 
connector for Python 3.7 and 2.7 installed 
I created using mysql.exe a db named 'gadb', without any tables.

with web2py I created a new "welcome" application changing db.py in this 
way (not using appconfig.ini)

i changed only this:
db = DAL('mysql://root:rootpassword@localhost/gadb',pool_size=20)

commenting this
"""db = DAL(configuration.get('db.uri'),
 pool_size=configuration.get('db.pool_size'),
 migrate_enabled=configuration.get('db.migrate'),
 check_reserved=['all'])"""

but when I try to start the application I have this error:

Error ticket for "testmysql"Ticket ID

127.0.0.1.2019-02-14.20-04-44.4a997a45-2232-4144-ab7e-6005309040bb
 Failure to connect, tried 5 times: 
Traceback (most recent call last): File 
"C:\web2py\gluon\packages\dal\pydal\base.py", line 454, in __init__ 
self._adapter = adapter(**kwargs) File 
"C:\web2py\gluon\packages\dal\pydal\adapters\__init__.py", line 40, in 
__call__ obj = super(AdapterMeta, cls).__call__(*args, **kwargs) File 
"C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 368, in 
__init__ super(SQLAdapter, self).__init__(*args, **kwargs) File 
"C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 52, in __init__ 
self.reconnect() File "C:\web2py\gluon\packages\dal\pydal\connection.py", 
line 172, in reconnect self.connection = self.connector() File 
"C:\web2py\gluon\packages\dal\pydal\adapters\mysql.py", line 52, in 
connector return self.driver.connect(**self.driver_args) File 
"C:\web2py\gluon\contrib\pymysql\__init__.py", line 90, in Connect return 
Connection(*args, **kwargs) File 
"C:\web2py\gluon\contrib\pymysql\connections.py", line 688, in __init__ 
self.connect() File "C:\web2py\gluon\contrib\pymysql\connections.py", line 
905, in connect self._get_server_information() File 
"C:\web2py\gluon\contrib\pymysql\connections.py", line 1231, in 
_get_server_information self.server_charset = charset_by_id(lang).name File 
"C:\web2py\gluon\contrib\pymysql\charset.py", line 38, in by_id return 
self._by_id[id] KeyError: 255Versione
web2py™ Version 2.16.1-stable+timestamp.2017.11.14.05.54.25Traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.

Traceback (most recent call last):
  File "C:\web2py\gluon\restricted.py", line 219, in restricted
exec(ccode, environment)
  File "C:/web2py/applications/testmysql/models/db.py" 
, line 33, in 

db = DAL('mysql://root:AeDeFsubfi3!@localhost/gadb',pool_size=20)
  File "C:\web2py\gluon\packages\dal\pydal\base.py", line 169, in __call__
obj = super(MetaDAL, cls).__call__(*args, **kwargs)
  File "C:\web2py\gluon\packages\dal\pydal\base.py", line 474, in __init__
"Failure to connect, tried %d times:\n%s" % (attempts, tb)
RuntimeError: Failure to connect, tried 5 times:
Traceback (most recent call last):
  File "C:\web2py\gluon\packages\dal\pydal\base.py", line 454, in __init__
self._adapter = adapter(**kwargs)
  File "C:\web2py\gluon\packages\dal\pydal\adapters\__init__.py", line 40, in 
__call__
obj = super(AdapterMeta, cls).__call__(*args, **kwargs)
  File "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 368, in 
__init__
super(SQLAdapter, self).__init__(*args, **kwargs)
  File "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 52, in 
__init__
self.reconnect()
  File "C:\web2py\gluon\packages\dal\pydal\connection.py", line 172, in 
reconnect
self.connection = self.connector()
  File "C:\web2py\gluon\packages\dal\pydal\adapters\mysql.py", line 52, in 
connector
return self.driver.connect(**self.driver_args)
  File "C:\web2py\gluon\contrib\pymysql\__init__.py", line 90, in Connect
return Connection(*args, **kwargs)
  File "C:\web2py\gluon\contrib\pymysql\connections.py", line 688, in __init__
self.connect()
  File "C:\web2py\gluon\contrib\pymysql\connections.py", line 905, in connect
self._get_server_information()
  File "C:\web2py\gluon\contrib\pymysql\connections.py", line 1231, in 
_get_server_information
self.server_charset = charset_by_id(lang).name
  File "C:\web2py\gluon\contrib\pymysql\charset.py", line 38, in by_id
return self._by_id[id]
KeyError: 255

In file: C:\web2py\applications\testmysql\models\db.py

1.

 at 126057B0, file 
"C:\web2py\applications\testmysql\models\db.py", line 7


What is my mistake? Thank in advance for who will answer me. Maybe this mysql 
is not compatible with web2py 2.16? How can I test if web2py is able to connect 
to mysql? After this problem I have to migrate a sqlite application to mysql: 
this is my goal. Thank you

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- 

[web2py] Re: error connecting to mysql

2019-02-14 Thread Andrea Fae'
PLEASE HELP ME THANK YOU

Il giorno mercoledì 13 febbraio 2019 21:46:19 UTC+1, Andrea Fae' ha scritto:
>
> Hello. I have this error when I start application "ga"
>
> Error ticket for "ga"
> Ticket ID
>
> 127.0.0.1.2019-02-13.20-49-28.fcc1a494-3aa4-42c2-b1a9-ab14a466e72e
>  Failure to connect, tried 5 times: 
> Traceback (most recent call last): File 
> "C:\web2py\gluon\packages\dal\pydal\base.py", line 454, in __init__ 
> self._adapter = adapter(**kwargs) File 
> "C:\web2py\gluon\packages\dal\pydal\adapters\__init__.py", line 40, in 
> __call__ obj = super(AdapterMeta, cls).__call__(*args, **kwargs) File 
> "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 368, in 
> __init__ super(SQLAdapter, self).__init__(*args, **kwargs) File 
> "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 52, in __init__ 
> self.reconnect() File "C:\web2py\gluon\packages\dal\pydal\connection.py", 
> line 172, in reconnect self.connection = self.connector() File 
> "C:\web2py\gluon\packages\dal\pydal\adapters\mysql.py", line 52, in 
> connector return self.driver.connect(**self.driver_args) File 
> "C:\web2py\gluon\contrib\pymysql\__init__.py", line 90, in Connect return 
> Connection(*args, **kwargs) File 
> "C:\web2py\gluon\contrib\pymysql\connections.py", line 688, in __init__ 
> self.connect() File "C:\web2py\gluon\contrib\pymysql\connections.py", line 
> 905, in connect self._get_server_information() File 
> "C:\web2py\gluon\contrib\pymysql\connections.py", line 1231, in 
> _get_server_information self.server_charset = charset_by_id(lang).name File 
> "C:\web2py\gluon\contrib\pymysql\charset.py", line 38, in by_id return 
> self._by_id[id] KeyError: 255Versione
> web2py™ Version 2.16.1-stable+timestamp.2017.11.14.05.54.25Traceback
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
> 10.
> 11.
> 12.
> 13.
> 14.
> 15.
> 16.
> 17.
> 18.
> 19.
> 20.
> 21.
> 22.
> 23.
> 24.
> 25.
> 26.
> 27.
> 28.
> 29.
> 30.
> 31.
> 32.
> 33.
> 34.
> 35.
> 36.
>
> Traceback (most recent call last):
>   File "C:\web2py\gluon\restricted.py", line 219, in restricted
> exec(ccode, environment)
>   File "C:/web2py/applications/ga/models/db.py" 
> <http://127.0.0.1:8000/admin/default/edit/ga/models/db.py>, line 34, in 
> 
> check_reserved=['all'])
>   File "C:\web2py\gluon\packages\dal\pydal\base.py", line 169, in __call__
> obj = super(MetaDAL, cls).__call__(*args, **kwargs)
>   File "C:\web2py\gluon\packages\dal\pydal\base.py", line 474, in __init__
> "Failure to connect, tried %d times:\n%s" % (attempts, tb)
> RuntimeError: Failure to connect, tried 5 times:
> Traceback (most recent call last):
>   File "C:\web2py\gluon\packages\dal\pydal\base.py", line 454, in __init__
> self._adapter = adapter(**kwargs)
>   File "C:\web2py\gluon\packages\dal\pydal\adapters\__init__.py", line 40, in 
> __call__
> obj = super(AdapterMeta, cls).__call__(*args, **kwargs)
>   File "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 368, in 
> __init__
> super(SQLAdapter, self).__init__(*args, **kwargs)
>   File "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 52, in 
> __init__
> self.reconnect()
>   File "C:\web2py\gluon\packages\dal\pydal\connection.py", line 172, in 
> reconnect
> self.connection = self.connector()
>   File "C:\web2py\gluon\packages\dal\pydal\adapters\mysql.py", line 52, in 
> connector
> return self.driver.connect(**self.driver_args)
>   File "C:\web2py\gluon\contrib\pymysql\__init__.py", line 90, in Connect
> return Connection(*args, **kwargs)
>   File "C:\web2py\gluon\contrib\pymysql\connections.py", line 688, in __init__
> self.connect()
>   File "C:\web2py\gluon\contrib\pymysql\connections.py", line 905, in connect
> self._get_server_information()
>   File "C:\web2py\gluon\contrib\pymysql\connections.py", line 1231, in 
> _get_server_information
> self.server_charset = charset_by_id(lang).name
>   File "C:\web2py\gluon\contrib\pymysql\charset.py", line 38, in by_id
> return self._by_id[id]
> KeyError: 255
>
> In file: C:\web2py\applications\ga\models\db.py
>
> 1.
>
>  at 0AC93830, file 
> "C:\web2py\applications\ga\models\db.py", line 8
>
>
>
> This is my appconfig.ini:
>
> ; App configuration
> [app]
> name= Welcome
> author  = Your Name 
> descripti

[web2py] error connecting to mysql

2019-02-13 Thread Andrea Fae'
Hello. I have this error when I start application "ga"

Error ticket for "ga"
Ticket ID

127.0.0.1.2019-02-13.20-49-28.fcc1a494-3aa4-42c2-b1a9-ab14a466e72e
 Failure to connect, tried 5 times: 
Traceback (most recent call last): File 
"C:\web2py\gluon\packages\dal\pydal\base.py", line 454, in __init__ 
self._adapter = adapter(**kwargs) File 
"C:\web2py\gluon\packages\dal\pydal\adapters\__init__.py", line 40, in 
__call__ obj = super(AdapterMeta, cls).__call__(*args, **kwargs) File 
"C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 368, in 
__init__ super(SQLAdapter, self).__init__(*args, **kwargs) File 
"C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 52, in __init__ 
self.reconnect() File "C:\web2py\gluon\packages\dal\pydal\connection.py", 
line 172, in reconnect self.connection = self.connector() File 
"C:\web2py\gluon\packages\dal\pydal\adapters\mysql.py", line 52, in 
connector return self.driver.connect(**self.driver_args) File 
"C:\web2py\gluon\contrib\pymysql\__init__.py", line 90, in Connect return 
Connection(*args, **kwargs) File 
"C:\web2py\gluon\contrib\pymysql\connections.py", line 688, in __init__ 
self.connect() File "C:\web2py\gluon\contrib\pymysql\connections.py", line 
905, in connect self._get_server_information() File 
"C:\web2py\gluon\contrib\pymysql\connections.py", line 1231, in 
_get_server_information self.server_charset = charset_by_id(lang).name File 
"C:\web2py\gluon\contrib\pymysql\charset.py", line 38, in by_id return 
self._by_id[id] KeyError: 255Versione
web2py™ Version 2.16.1-stable+timestamp.2017.11.14.05.54.25Traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.

Traceback (most recent call last):
  File "C:\web2py\gluon\restricted.py", line 219, in restricted
exec(ccode, environment)
  File "C:/web2py/applications/ga/models/db.py" 
, line 34, in 
check_reserved=['all'])
  File "C:\web2py\gluon\packages\dal\pydal\base.py", line 169, in __call__
obj = super(MetaDAL, cls).__call__(*args, **kwargs)
  File "C:\web2py\gluon\packages\dal\pydal\base.py", line 474, in __init__
"Failure to connect, tried %d times:\n%s" % (attempts, tb)
RuntimeError: Failure to connect, tried 5 times:
Traceback (most recent call last):
  File "C:\web2py\gluon\packages\dal\pydal\base.py", line 454, in __init__
self._adapter = adapter(**kwargs)
  File "C:\web2py\gluon\packages\dal\pydal\adapters\__init__.py", line 40, in 
__call__
obj = super(AdapterMeta, cls).__call__(*args, **kwargs)
  File "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 368, in 
__init__
super(SQLAdapter, self).__init__(*args, **kwargs)
  File "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 52, in 
__init__
self.reconnect()
  File "C:\web2py\gluon\packages\dal\pydal\connection.py", line 172, in 
reconnect
self.connection = self.connector()
  File "C:\web2py\gluon\packages\dal\pydal\adapters\mysql.py", line 52, in 
connector
return self.driver.connect(**self.driver_args)
  File "C:\web2py\gluon\contrib\pymysql\__init__.py", line 90, in Connect
return Connection(*args, **kwargs)
  File "C:\web2py\gluon\contrib\pymysql\connections.py", line 688, in __init__
self.connect()
  File "C:\web2py\gluon\contrib\pymysql\connections.py", line 905, in connect
self._get_server_information()
  File "C:\web2py\gluon\contrib\pymysql\connections.py", line 1231, in 
_get_server_information
self.server_charset = charset_by_id(lang).name
  File "C:\web2py\gluon\contrib\pymysql\charset.py", line 38, in by_id
return self._by_id[id]
KeyError: 255

In file: C:\web2py\applications\ga\models\db.py

1.

 at 0AC93830, file 
"C:\web2py\applications\ga\models\db.py", line 8



This is my appconfig.ini:

; App configuration
[app]
name= Welcome
author  = Your Name 
description = a cool new app
keywords= web2py, python, framework
generator   = Web2py Web Framework

; Host configuration
[host]
names = localhost:*, 127.0.0.1:*, *:*, *

; db configuration
[db]
uri   = mysql://root:passwordroot@localhost/gadb?set_encoding=utf8mb4
migrate   = true
pool_size = 10 ; ignored for sqlite

; smtp address and credentials
[smtp]
server = smtp.gmail.com:587
sender = y...@gmail.com
login  = username:password
tls= true
ssl= true

; form styling
[forms]
formstyle = bootstrap3_inline
separator =

I just created the db "gadb" in mysql.exe. You can see the db, but I only 
created the db with the command

mysql> create database gadb; Query OK, 1 row affected (0.02 sec) mysql> 
show databases; ++ | Database | ++ 
| gadb | | information_schema | | mysql | | performance_schema | | sakila | 
| sys | | world | ++ 7 rows in set (0.00 sec) 

Can you help me what is my mistake?
THANK YOU

-- 
Resources:
- http://web2py.com
- http://web2py.com/book 

[web2py] Re: Migrate from sqlite to mysql

2019-02-13 Thread Andrea Fae'
Hello!
I followed the instruction you wrote me.
But at that point:" load web2py app, ensure migrate is true, so that will 
create the tables defined in web2py"

I have this error:
 
Error ticket for "ga"Ticket ID

127.0.0.1.2019-02-13.20-49-28.fcc1a494-3aa4-42c2-b1a9-ab14a466e72e
 Failure to connect, tried 5 times: 
Traceback (most recent call last): File 
"C:\web2py\gluon\packages\dal\pydal\base.py", line 454, in __init__ 
self._adapter = adapter(**kwargs) File 
"C:\web2py\gluon\packages\dal\pydal\adapters\__init__.py", line 40, in 
__call__ obj = super(AdapterMeta, cls).__call__(*args, **kwargs) File 
"C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 368, in 
__init__ super(SQLAdapter, self).__init__(*args, **kwargs) File 
"C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 52, in __init__ 
self.reconnect() File "C:\web2py\gluon\packages\dal\pydal\connection.py", 
line 172, in reconnect self.connection = self.connector() File 
"C:\web2py\gluon\packages\dal\pydal\adapters\mysql.py", line 52, in 
connector return self.driver.connect(**self.driver_args) File 
"C:\web2py\gluon\contrib\pymysql\__init__.py", line 90, in Connect return 
Connection(*args, **kwargs) File 
"C:\web2py\gluon\contrib\pymysql\connections.py", line 688, in __init__ 
self.connect() File "C:\web2py\gluon\contrib\pymysql\connections.py", line 
905, in connect self._get_server_information() File 
"C:\web2py\gluon\contrib\pymysql\connections.py", line 1231, in 
_get_server_information self.server_charset = charset_by_id(lang).name File 
"C:\web2py\gluon\contrib\pymysql\charset.py", line 38, in by_id return 
self._by_id[id] KeyError: 255Versione
web2py™ Version 2.16.1-stable+timestamp.2017.11.14.05.54.25Traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.

Traceback (most recent call last):
  File "C:\web2py\gluon\restricted.py", line 219, in restricted
exec(ccode, environment)
  File "C:/web2py/applications/ga/models/db.py" 
, line 34, in 
check_reserved=['all'])
  File "C:\web2py\gluon\packages\dal\pydal\base.py", line 169, in __call__
obj = super(MetaDAL, cls).__call__(*args, **kwargs)
  File "C:\web2py\gluon\packages\dal\pydal\base.py", line 474, in __init__
"Failure to connect, tried %d times:\n%s" % (attempts, tb)
RuntimeError: Failure to connect, tried 5 times:
Traceback (most recent call last):
  File "C:\web2py\gluon\packages\dal\pydal\base.py", line 454, in __init__
self._adapter = adapter(**kwargs)
  File "C:\web2py\gluon\packages\dal\pydal\adapters\__init__.py", line 40, in 
__call__
obj = super(AdapterMeta, cls).__call__(*args, **kwargs)
  File "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 368, in 
__init__
super(SQLAdapter, self).__init__(*args, **kwargs)
  File "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 52, in 
__init__
self.reconnect()
  File "C:\web2py\gluon\packages\dal\pydal\connection.py", line 172, in 
reconnect
self.connection = self.connector()
  File "C:\web2py\gluon\packages\dal\pydal\adapters\mysql.py", line 52, in 
connector
return self.driver.connect(**self.driver_args)
  File "C:\web2py\gluon\contrib\pymysql\__init__.py", line 90, in Connect
return Connection(*args, **kwargs)
  File "C:\web2py\gluon\contrib\pymysql\connections.py", line 688, in __init__
self.connect()
  File "C:\web2py\gluon\contrib\pymysql\connections.py", line 905, in connect
self._get_server_information()
  File "C:\web2py\gluon\contrib\pymysql\connections.py", line 1231, in 
_get_server_information
self.server_charset = charset_by_id(lang).name
  File "C:\web2py\gluon\contrib\pymysql\charset.py", line 38, in by_id
return self._by_id[id]
KeyError: 255

In file: C:\web2py\applications\ga\models\db.py

1.

 at 0AC93830, file 
"C:\web2py\applications\ga\models\db.py", line 8



This is my appconfig.ini:

; App configuration
[app]
name= Welcome
author  = Your Name 
description = a cool new app
keywords= web2py, python, framework
generator   = Web2py Web Framework

; Host configuration
[host]
names = localhost:*, 127.0.0.1:*, *:*, *

; db configuration
[db]
uri   = mysql://root:passwordroot@localhost/gadb?set_encoding=utf8mb4
migrate   = true
pool_size = 10 ; ignored for sqlite

; smtp address and credentials
[smtp]
server = smtp.gmail.com:587
sender = y...@gmail.com
login  = username:password
tls= true
ssl= true

; form styling
[forms]
formstyle = bootstrap3_inline
separator =

I just created the db "gadb" in mysql.exe. You can see the db, but I only 
created the db with the command

mysql> create database gadb; Query OK, 1 row affected (0.02 sec) mysql> 
show databases; ++ | Database | ++ 
| gadb | | information_schema | | mysql | | performance_schema | | sakila | 
| sys | | world | ++ 7 rows in 

[web2py] Re: Migrate from sqlite to mysql

2019-02-10 Thread Andrea Fae'
but, what happen if I install python 3.7 on windows? Does web2py still use 
2.7?
Or installinh mysql without this connector?
What does you think? Other suggestions? I don't like to use different 
things because I need to publish my application to pythonanywhere...
thanks

Il giorno domenica 10 febbraio 2019 11:36:52 UTC+1, 黄祥 ha scritto:
>
> pardon, not using windows atm, so cant test it
> perhaps you have 2 options:
> - try mariadb (not sure mariadb required python3 or not)
> or
> - use conda (miniconda (light version) or anaconda) to install python3 and 
> python2 in 1 machine
> *ref:*
> https://www.anaconda.com/distribution/
> https://conda.io/en/latest/miniconda.html
>
> 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: Migrate from sqlite to mysql

2019-02-10 Thread Andrea Fae'
Hello, if I trye to install mysql 8 on my windows pc it tells me I have a 
problem about requirements. I don't have installed python 3.7. But could I 
have problem installing python 3.7 on my web2py based on python 2.17? thank 
you in advance for your gently answers!

Il giorno sabato 9 febbraio 2019 20:40:25 UTC+1, Andrea Fae' ha scritto:
>
> Thank you guys!
> I will do a test and let you known.
> Thank you for now.
>
>
> Il giorno sabato 9 febbraio 2019 17:47:53 UTC+1, Ben Lawrence ha scritto:
>>
>> And turn off lazy-tables until mysql has built all the tables.
>>
>> On Friday, February 8, 2019 at 5:03:29 PM UTC-8, 黄祥 wrote:
>>>
>>> - what version of mysql do I have to install to my PC where I have 2.17 
>>>> version of web2py? Where can I find?
>>>>
>>>  
>>> in windows env there are mysql and mariadb
>>> *ref:*
>>> https://downloads.mariadb.org
>>> https://dev.mysql.com/downloads/mysql/
>>>
>>> - is it necessary to install drivers or it is still included in my 
>>>> web2py installed by windows installation method?
>>>>
>>>
>>> web2py already ship the mysql driver  
>>>
>>> - what is the procedure to migrate the db of my application?
>>>>
>>>
>>> better to export and import in csv file
>>>
>>> *step*:
>>> - create database mysql
>>> - when web2py using sqlite use export_to_csv_file()
>>> - change db uri in private/appconfig.ini from sqlite to mysql 
>>> - load web2py app, ensure migrate is true, so that will create the 
>>> tables defined in web2py
>>> - when web2py using mysql use import_from_csv_file() 
>>>
>>> *ref:*
>>>
>>> http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Exporting-and-importing-data
>>>  
>>>
>>> another way around is web2py have a scripts/cpdb.py
>>> *ref:*
>>>
>>> http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Copy-data-from-one-db-into-another
>>>
>>> - after migrating, how to install the application using pyrhonanywhere 
>>>> site? (I'm just using the app made with SQLite)
>>>>
>>>
>>> *local*
>>> - export your database using mysqldump
>>> - pack your app from web2py admin
>>>
>>> *pythonanywhere*
>>> - login to pythonanywhere, use tab console to import your mysql database
>>> - then in web2py admin just Upload and install packed application
>>>
>>> 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: Migrate from sqlite to mysql

2019-02-09 Thread Andrea Fae'
Thank you guys!
I will do a test and let you known.
Thank you for now.


Il giorno sabato 9 febbraio 2019 17:47:53 UTC+1, Ben Lawrence ha scritto:
>
> And turn off lazy-tables until mysql has built all the tables.
>
> On Friday, February 8, 2019 at 5:03:29 PM UTC-8, 黄祥 wrote:
>>
>> - what version of mysql do I have to install to my PC where I have 2.17 
>>> version of web2py? Where can I find?
>>>
>>  
>> in windows env there are mysql and mariadb
>> *ref:*
>> https://downloads.mariadb.org
>> https://dev.mysql.com/downloads/mysql/
>>
>> - is it necessary to install drivers or it is still included in my web2py 
>>> installed by windows installation method?
>>>
>>
>> web2py already ship the mysql driver  
>>
>> - what is the procedure to migrate the db of my application?
>>>
>>
>> better to export and import in csv file
>>
>> *step*:
>> - create database mysql
>> - when web2py using sqlite use export_to_csv_file()
>> - change db uri in private/appconfig.ini from sqlite to mysql 
>> - load web2py app, ensure migrate is true, so that will create the tables 
>> defined in web2py
>> - when web2py using mysql use import_from_csv_file() 
>>
>> *ref:*
>>
>> http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Exporting-and-importing-data
>>  
>>
>> another way around is web2py have a scripts/cpdb.py
>> *ref:*
>>
>> http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Copy-data-from-one-db-into-another
>>
>> - after migrating, how to install the application using pyrhonanywhere 
>>> site? (I'm just using the app made with SQLite)
>>>
>>
>> *local*
>> - export your database using mysqldump
>> - pack your app from web2py admin
>>
>> *pythonanywhere*
>> - login to pythonanywhere, use tab console to import your mysql database
>> - then in web2py admin just Upload and install packed application
>>
>> 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] Migrate from sqlite to mysql

2019-02-08 Thread Andrea Fae'
Hello everybody
I have some questions about an appllication I want to migrate from SQLite 
db to MySql in windows:
- what version of mysql do I have to install to my PC where I have 2.17 
version of web2py? Where can I find?
- is it necessary to install drivers or it is still included in my web2py 
installed by windows installation method?
- what is the procedure to migrate the db of my application?
- after migrating, how to install the application using pyrhonanywhere 
site? (I'm just using the app made with SQLite)
thank you for youe answers, even if you don't answer to all questions...

-- 
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: searchable=True

2018-10-15 Thread Andrea Fae'
thank you very much Anthony. You are SUPER.

Il giorno lunedì 15 ottobre 2018 14:31:28 UTC+2, Anthony ha scritto:
>
> def custom_search(fields, keywords):
> [generate a DAL query based on fields and keywords]
> return query # Will eventually be used like db(query).select(...)
>
> grid = SQLFORM.grid(..., searchable=custom_search)
>
> The "fields" argument is a list of the DAL field objects from the table 
> used to generate the grid (i.e., same as [f for f in db.mytable]), and 
> "keywords" is the "keywords" string from the URL query string.
>
> Anthony
>
> On Monday, October 15, 2018 at 2:39:33 AM UTC-4, Andrea Fae' wrote:
>>
>> Thank you Anthony, but the code is not easy to understand. could you make 
>> me an easy example about to create a custom search function? Do I have to 
>> write the code in my controller default.py? Or do I have to change the code 
>> in the standard file sqlhtml.py (I don't think so).
>> Thank you
>>
>> Il giorno lunedì 15 ottobre 2018 04:08:51 UTC+2, Anthony ha scritto:
>>>
>>> The "searchable" argument can be a function that takes the list of 
>>> fields in the grid and the submitted keywords and returns a DAL Query 
>>> object, so you can create a custom search function. For an example, see the 
>>> default search function: 
>>> https://github.com/web2py/web2py/blob/master/gluon/sqlhtml.py#L2043.
>>>
>>> Anthony
>>>
>>> On Sunday, October 14, 2018 at 4:05:43 PM UTC-4, Andrea Fae' wrote:
>>>>
>>>> Hello, in a grid, if you type searchable=True default) you can search 
>>>> by EVERY field in the grid. But I want to use the search box not to all 
>>>> fields in te view, but only in some of them. Is it possible or I have to 
>>>> create a specific search form? Can you send me some example?
>>>> 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: searchable=True

2018-10-15 Thread Andrea Fae'
Thank you Anthony, but the code is not easy to understand. could you make 
me an easy example about to create a custom search function? Do I have to 
write the code in my controller default.py? Or do I have to change the code 
in the standard file sqlhtml.py (I don't think so).
Thank you

Il giorno lunedì 15 ottobre 2018 04:08:51 UTC+2, Anthony ha scritto:
>
> The "searchable" argument can be a function that takes the list of fields 
> in the grid and the submitted keywords and returns a DAL Query object, so 
> you can create a custom search function. For an example, see the default 
> search function: 
> https://github.com/web2py/web2py/blob/master/gluon/sqlhtml.py#L2043.
>
> Anthony
>
> On Sunday, October 14, 2018 at 4:05:43 PM UTC-4, Andrea Fae' wrote:
>>
>> Hello, in a grid, if you type searchable=True default) you can search by 
>> EVERY field in the grid. But I want to use the search box not to all fields 
>> in te view, but only in some of them. Is it possible or I have to create a 
>> specific search form? Can you send me some example?
>> 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] searchable=True

2018-10-14 Thread Andrea Fae'
Hello, in a grid, if you type searchable=True default) you can search by 
EVERY field in the grid. But I want to use the search box not to all fields 
in te view, but only in some of them. Is it possible or I have to create a 
specific search form? Can you send me some example?
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] field username in auth_user

2018-06-19 Thread Andrea Fae'
What kind of characters can we use in this field?
Can I use space character in this field? I think no.
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: managing latin characters

2018-06-19 Thread Andrea Fae'
Thank you Leonel, but when I try to insert to db for example this name 
"Donà" in the username field (table auth_user) the system tells me that is 
not possible...So, what to do? Convert "Donà" in "Dona" without accent? 
Which characters can I use in the username field? In the book there is only 
db_codec=latin...where can I find documentation about encoding in 
python documentation? thank you

Il giorno lunedì 18 giugno 2018 23:50:05 UTC+2, Leonel Câmara ha scritto:
>
> Web2py uses utf-8 everywhere by default, you don't need to worry about it. 
> If you're smart you will use utf-8 in the database too and everything 
> pretty much just works, otherwise you will just have to tell the DAL about 
> the encoding the database uses using db_codec.
>

-- 
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] managing latin characters

2018-06-18 Thread Andrea Fae'
How to manage latin character, like italian character like è,é, à, ò
If I want to insert for example à it "translate" to “/xe0153"
How to wotk with this type of charater...Do I need to change from utf-8 to? 
Thanks

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


[web2py] fetching events from DB using fullcalendar javascript event calendar

2018-06-10 Thread Andrea Fae'


I'm using web2py and now I'm fetching all calendar events from db using 
this code in a view:

events: [
{{for row in rowseventi:}}
{
title: '{{=row.evento.titolo}}',
id: '{{=row.evento.id}}',
resourceId: '{{=row.evento.risorsa}}',
start: '{{=row.evento.inizio}}',
end: '{{=row.evento.fine}}',
recurring: '{{=row.evento.ricorrenza}}',
// allDay: false,
color : '{{=row.evento.colore}}',
url: '{{=URL('mostra_evento',args=row.evento.id)}}',
   },
   {{pass}}]

It's working perfectly but now I'd like to fetch only events regarding 
current view using this function 
https://fullcalendar.io/docs/events-function

function( start, end, timezone, callback ) { }

There are some example using php but I want only use python and PyDAL. Can 
someone give me some examples using only python and javascript?

rowseventi it's an array retrieved from controller that contains all 
events...

When I change the view with "next", "prev" or something else I'd like to 
fetch the new events based on the dates showed in the view.

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: multiple conditional fields

2018-06-10 Thread Andrea Fae'
I tried, but it's not working with 2 fields to get hidden...

Il giorno domenica 10 giugno 2018 02:41:12 UTC+2, 黄祥 ha scritto:
>
> perhaps you can use show_if for conditional field or jquery()
> ref:
>
> http://web2py.com/books/default/chapter/29/07/forms-and-validators#Conditional-fields
>
> http://web2py.com/books/default/chapter/29/11/jquery-and-ajax#Conditional-fields-in-forms
>
> 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] multiple conditional fields

2018-06-09 Thread Andrea Fae'
I have this table

db.define_table('evento',
Field('titolo', requires=[IS_NOT_EMPTY()]),
Field('verifica', type='boolean', default=False),
Field('inizio', type='datetime', 
requires=IS_DATETIME(format=T('%d/%m/%Y %H:%M'),error_message='deve essere 
DD/MM/ HH:MM!')),
Field('fine', type='datetime', 
requires=IS_DATETIME(format=T('%d/%m/%Y %H:%M'),error_message='deve essere 
DD/MM/ HH:MM!')),
Field('uniqueid', type='string'),
Field('ricorrenza', requires = IS_IN_SET(['0', '1', '2', 
'3', '4', '5', '6', '7', '8', '9', '10'], error_message='deve essere un 
numero da 0 a 10'), default= '0'),
Field.Virtual('giorno_inizio', lambda 
row:calendar.day_name[row.evento.inizio.weekday()]),
Field('risorsa', 'reference risorsa'),
Field('docente', 'reference auth_user'),
Field('materia', 'reference materia'),
Field('studenti', 'list:reference auth_user'),
Field('colore', default = '#8080ff'),
Field('controllato', type='boolean', default=False),
Field('note'),

auth.signature,singular="Evento",plural="Eventi",migrate='evento.table',
format='%(titolo)s')
db.evento.giorno_inizio.represent = lambda giorno_inizio, row: 
T(giorno_inizio)

When I create the form I need these requirements to these fields:


db.evento.docente.requires=IS_IN_DB(db(query_docente),'auth_user.id','%(last_name)s'
 
' ' '%(first_name)s', zero=T('Scegli il docente/referente...'))

and 

db.evento.docente.widget = wdg_select
db.evento.materia.widget = wdg_select_change

the field "materia" depends on the field "docente" and it's filled with a 
script like:

   url_materia = URL("dropdown.html")
script = SCRIPT("""
  var url_materia = "%s";
  $('#evento_docente').on('change',function(e){
 var v = $(this).val();
 //alert('Docente cambiato: ' + v);
 $.web2py.component(url_materia + '?docente=' + v, 
'evento_materia','no','no',$('#evento_materia'));
 })
""" % url_materia)
 
To  explain better "docente" is the teacher, and "materia" is the subject. 
Every docente has 1 or subject (materia) to teach so when I choose a 
"docente" the other field has to be filled only with the subjects teached 
by this teacher


If the field "verifica" is true, I'd like to hidden the fields (BOTH) 
"docente" and "materia" and, so, I don't want the requirements. about these 
fields...
With a conditional field I can hidden only the "docente" field but if it's 
hidden...after submit the form told me that is not correctly filled like 
required.

I cannot hidden both field and not consider the requirements if the fields 
will be hidden..

Is it possible? Any suggestion?
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] change form field on the basis of another field

2018-06-02 Thread Andrea Fae'
I have 2 datetime fields in a SQLFORM
I want that when I change the date in one the fields, the other field get 
the same date (not the same time) 
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: remove seconds from datetime picker

2018-06-02 Thread Andrea Fae'
I solved with this

var w2p_ajax_date_format = "{{=T('%d/%m/%Y')}}";
var w2p_ajax_datetime_format = "{{=T('%d/%m/%Y %H:%M')}}";

in web2py_ajax.html

Il giorno venerdì 1 giugno 2018 23:37:48 UTC+2, Andrea Fae' ha scritto:
>
> When I select from standard calendar a datetime value it adds :00 seconds! 
> But I don't want, I don't need. How to remove from the datetime field?
>
> I tried to add in the layout.html this
>
> 
> jQuery.timeEntry.setDefaults({show24Hours: true, showSeconds: false});
>  
>
>
> 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] remove seconds from datetime picker

2018-06-01 Thread Andrea Fae'
When I select from standard calendar a datetime value it adds :00 seconds! 
But I don't want, I don't need. How to remove from the datetime field?
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: form fields

2018-06-01 Thread Andrea Fae'
I'm saying thank you Anthony another time...you find every time the right 
way...my compliments.

Tell me...in your opinion what is the best python guide/tutorial (for free 
or cheap money) to use? What do you suggest?
Have a good day.
Thank you!


Il giorno giovedì 31 maggio 2018 23:32:51 UTC+2, Anthony ha scritto:

> On Thursday, May 31, 2018 at 2:27:44 PM UTC-4, Andrea Fae' wrote:
>>
>> thanks Anthony. Could you give me simple example about second idea? It's 
>> noy possible to pass variables to a onvalidation funtion? i.e. onvalidation 
>> doesn't accept parameters...the problem is: how to make that object 
>> available to the onvalidation function?
>>
>
> record = db.mytable(1)
>
> def my_validation(form):
> [now access record, which has been defined in the parent scope]
>
> form =SQLFORM(...).process(onvalidation=my_validation)
>
> or:
>
> record = db.mytable(1)
>
> def my_validation(form, record):
> ...
>
> form = SQLFORM(...).process(onvalidation=lambda form: my_validation(
> form, record))
>
> Anthony
>

-- 
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: form fields

2018-05-31 Thread Andrea Fae'
thanks Anthony. Could you give me simple example about second idea? It's 
noy possible to pass variables to a onvalidation funtion? i.e. onvalidation 
doesn't accept parameters...

Il giorno giovedì 31 maggio 2018 00:24:29 UTC+2, Anthony ha scritto:
>
> SQLFORM shows the values of non-writable fields but does not put those 
> values into HTML form widgets, so they are not submitted with the form. A 
> couple of options:
>
>- Instead of setting writable=False, specify a custom widget for the 
>fields with the HTML readonly attribute set to true (e.g., widget=lambda 
>f, v: SQLFORM.widgets.string.widget(f, v, _readonly=True)). With this 
>approach, be sure to validate the non-writable values as well, as a 
>malicious user can still submit modified values.
>- Create a separate object (e.g., a DAL Row) containing the 
>non-writable field values, and make that object available within the 
>onvalidation function (since those values are not changeable within the 
>form, there is no reason the values must come from the form submission).
>
> Anthony
>
> On Wednesday, May 30, 2018 at 4:28:01 PM UTC-4, Andrea Fae' wrote:
>>
>> Hello I have a SQLFORM but some of them I populate from other variables 
>> and I don't want to change. So I typed field.writable=False...
>> But when I use a custom "onvalidation" function I want to have the 
>> content of all the form fields...
>> In request.vars I see some fields but not all
>> In form.vars I see part of these fields
>> Both without the not writable fields.
>>
>> How is working? request.vars, form.vars. Why do they show different field 
>> values? Why I can't see the not wirtable values? I tried to read the book, 
>> but I didn't find the information yet.
>> Thanks a lot
>>
>

-- 
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] form fields

2018-05-30 Thread Andrea Fae'
Hello I have a SQLFORM but some of them I populate from other variables and 
I don't want to change. So I typed field.writable=False...
But when I use a custom "onvalidation" function I want to have the content 
of all the form fields...
In request.vars I see some fields but not all
In form.vars I see part of these fields
Both without the not writable fields.

How is working? request.vars, form.vars. Why do they show different field 
values? Why I can't see the not wirtable values? I tried to read the book, 
but I didn't find the information yet.
Thanks a lot

-- 
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 Requires gitpython module

2018-05-14 Thread Andrea Fae'
Yes I installed but it's not working showing me the message below.

Il giorno domenica 13 maggio 2018 16:31:41 UTC+2, Andrea Fae' ha scritto:
>
> When I try to "push git " i See the error "requires gitpython module"
>
> Requires gitpython module, but not installed or incompatible version: 
> (ImportError("Cannot import module 'applications.admin.modules.git'",), 
> )
>
>
> Requires gitpython module, but not installed or incompatible version: 
> (ImportError("Cannot import module 'applications.admin.modules.git'",), 
> )
>
> .but..
> Microsoft Windows [Versione 10.0.17134.48]
> (c) 2018 Microsoft Corporation. Tutti i diritti sono riservati.
>
> C:\Python27\Scripts>pip install gitpython
> Requirement already satisfied: gitpython in c:\python27\lib\site-packages 
> (2.1.9)
> Requirement already satisfied: gitdb2>=2.0.0 in 
> c:\python27\lib\site-packages (from gitpython) (2.0.3)
> Requirement already satisfied: smmap2>=2.0.0 in 
> c:\python27\lib\site-packages (from gitdb2>=2.0.0->gitpython) (2.0.3)
>
> C:\Python27\Scripts>
>
>

-- 
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] web2py Requires gitpython module

2018-05-13 Thread Andrea Fae'
When I try to "push git " i See the error "requires gitpython module"

-- 
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: link to a grid

2018-05-11 Thread Andrea Fae'
...I'm sorry...it was written in the book!! Sorry...I need to read again 
some parts of the book! Thank you

Il giorno venerdì 11 maggio 2018 02:06:26 UTC+2, Anthony ha scritto:
>
> The signature of the URL function is URL(a, c, f). If you pass only two 
> arguments, it assumes they are c and f, and if you pass only one, it 
> assumes it is f. You passed only 'static/Etichette', so it assumes that is 
> the function and therefore uses the current application and controller. It 
> should instead be:
>
> URL('static', 'Etichette', args=[row.etichetta])
>
> 'static' is a special value for the controller.
>
> Anthony
>
> On Thursday, May 10, 2018 at 6:59:45 AM UTC-4, Andrea Fae' wrote:
>>
>> Hello I have a grid with certain fields.
>> In a filed there is a name of a pdf file that I have in the folder 
>> "static/Etichette". I have a lot of pdf file in this folder and I'd like, 
>> when I click this link, to open the related file...
>>
>> This is the grid
>> grid = SQLFORM.grid(db.socio, links = [lambda row: A('Etichetta', 
>> _href=URL('static/Etichette', args=[row.etichetta]))], details=False, 
>> create=False, editable=False, deletable=False, maxtextlength=40)
>>
>> or
>>
>> grid = SQLFORM.grid(db.socio, links = [lambda row: A('Etichetta', 
>> _href=URL("static/Etichette/%s" % row.etichetta))], details=False, 
>> create=False, editable=False, deletable=False, maxtextlength=40)
>>
>>
>> This is the table
>>
>> db.define_table('socio',
>> Field('codice', type='integer', 
>> requires=[IS_NOT_EMPTY()]),
>> Field('cognome', requires=[IS_NOT_EMPTY()]),
>> Field('nome', requires=[IS_NOT_EMPTY()]),
>> Field('intestazione', requires=[IS_NOT_EMPTY()]),
>> Field('dnascita', requires=[IS_NOT_EMPTY()]),
>> Field('indirizzo', requires=[IS_NOT_EMPTY()]),
>> Field('cap', requires=[IS_NOT_EMPTY()]),
>> Field('comune', requires=[IS_NOT_EMPTY()]),
>> Field('provincia', requires=[IS_NOT_EMPTY()]),
>> Field('telefono', requires=[IS_NOT_EMPTY()]),
>> Field('codfisc', requires=[IS_NOT_EMPTY()]),
>> Field('etichetta'),
>> 
>> auth.signature,singular="Socio",plural="Soci",migrate='socio.table',
>> format='%(intestazione)s')
>>
>> How can I do?
>>
>> I have this error
>> invalid function (default/static)
>>
>> Yes...I know that there is something wrong but I don't know in this 
>> moment what...
>>
>

-- 
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] link to a grid

2018-05-10 Thread Andrea Fae'
Hello I have a grid with certain fields.
In a filed there is a name of a pdf file that I have in the folder 
"static/Etichette". I have a lot of pdf file in this folder and I'd like, 
when I click this link, to open the related file...

This is the grid
grid = SQLFORM.grid(db.socio, links = [lambda row: A('Etichetta', 
_href=URL('static/Etichette', args=[row.etichetta]))], details=False, 
create=False, editable=False, deletable=False, maxtextlength=40)


This is the table

db.define_table('socio',
Field('codice', type='integer', requires=[IS_NOT_EMPTY()]),
Field('cognome', requires=[IS_NOT_EMPTY()]),
Field('nome', requires=[IS_NOT_EMPTY()]),
Field('intestazione', requires=[IS_NOT_EMPTY()]),
Field('dnascita', requires=[IS_NOT_EMPTY()]),
Field('indirizzo', requires=[IS_NOT_EMPTY()]),
Field('cap', requires=[IS_NOT_EMPTY()]),
Field('comune', requires=[IS_NOT_EMPTY()]),
Field('provincia', requires=[IS_NOT_EMPTY()]),
Field('telefono', requires=[IS_NOT_EMPTY()]),
Field('codfisc', requires=[IS_NOT_EMPTY()]),
Field('etichetta'),

auth.signature,singular="Socio",plural="Soci",migrate='socio.table',
format='%(intestazione)s')

How can I do?

I have this error
invalid function (default/static)

Yes...I know that there is something wrong but I don't know in this moment 
what...

-- 
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] web2py 2.16.1 and login menu on mobile systems NOT WORKING

2018-04-23 Thread Andrea Fae'
Hmm...I don't know if there are any people working on this.
Can you send me what I can change on web2py (I think layout.html, etc) to 
fix this specific problem?
Thank you

Il giorno lunedì 23 aprile 2018 02:16:15 UTC+2, Carlos Cesar Caballero ha 
scritto:
>
> Yes, I usually use a newer bootstrap version, and make some fixes in the 
> layout bar.
>
> Testing the trunk I can see that is fixed, but there are some responsive 
> issues. Is there some issue open about this? If there is no one working I 
> can send some fixes.
>
> Greetings.
>
> El 22/04/18 a las 15:54, Andrea Fae' escribió:
>
> If you try to use welcome application on web2py 2.16.1 login menu 
> (hamburger icon) is not working. Clicking on it nothing happens...it's 
> a bug. 
> Am I right?
> -- 
> 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.


[web2py] web2py 2.16.1 and login menu on mobile systems NOT WORKING

2018-04-22 Thread Andrea Fae'
If you try to use welcome application on web2py 2.16.1 login menu 
(hamburger icon) is not working. Clicking on it nothing happens...it's 
a bug.
Am I right?

-- 
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: Login not working on smartphone - no the same menu layout

2018-04-22 Thread Andrea Fae'
I included tether, and with Chrome I don't see this error

Source map error: request failed with status 404
Resource URL: https://
andfae.pythonanywhere.com/tcf/static/css/bootstrap.min.css
Source Map URL: bootstrap.min.css.map[Learn More]

Did you try with Chrome? I don't have any other error in the console.


Il giorno venerdì 20 aprile 2018 21:59:08 UTC+2, Dave S ha scritto:
>
>
>
> On Friday, April 20, 2018 at 11:15:52 AM UTC-7, Andrea Fae' wrote:
>>
>> Please help me...
>>
>>
> I'm not going to be much help, but I can confirm that the "hamburger" 
> doesn't appear to have any life, where as the "<" and ">" buttons in the 
> regular part of the page do change the date displayed.  This is with Chrome 
> on a Samsung G8.
>
> Opening the page in Firefox on my desktop has a conventional menu that 
> drops down the two login options.
>
> I don't know too much about website developer tools on Android itself, but 
> perhaps you can use a simulator environment to watch more closely what the 
> JS is doing.
>
> Some sites have an "m." variant of the address to signal "mobile 
> environment" and you can use that address on a desktop browser to play with 
> the mobile interface, but I don't think web2py has that built-in.  
> PythonAnywhere might have that as a feature, but that wouldn't help because 
> web2py would still see the desktop user agent.
>
> Oooh, I just tried narrowing the desktop window, and the menu bar switched 
> to hamburger, and the hamburger is silent.  Turning on FF inspector, I see 
> two errors on the console:
>
> Error: Bootstrap tooltips require Tether (http://tether.io/)
> bootstrap.min.js:7:3482
>
> Source map error: request failed with status 404
> Resource URL: https://
> andfae.pythonanywhere.com/tcf/static/css/bootstrap.min.css
> Source Map URL: bootstrap.min.css.map[Learn More]
>
>
> The second error may be relevant.
>
> Dave S
> /dps
>
>
>
>
> Il giorno mercoledì 18 aprile 2018 20:31:38 UTC+2, Andrea Fae' ha scritto:
>>>
>>> this is my application
>>>
>>> https://andfae.pythonanywhere.com/tcf/default/index
>>>
>>> I can't login with android. I don't know. I see in the upper right of 
>>> the smartphone 3 lines but when I click nothing happens...How to fix it?
>>> I didn't find anything about this problem it. 
>>> Maybe is it regarding bootstrap 4 in web2py?
>>> 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] bootstrap.min.js:7 Uncaught Error: Bootstrap tooltips require Tether (http://tether.io/)

2018-04-22 Thread Andrea Fae'
what can I do to include tether in web2py project telling me that bootstrap 
4 (worse than bootstrap 3) require tether? Where and what do I have to 
include?
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: Login not working on smartphone - no the same menu layout

2018-04-20 Thread Andrea Fae'
Please help me...

Il giorno mercoledì 18 aprile 2018 20:31:38 UTC+2, Andrea Fae' ha scritto:
>
> this is my application
>
> https://andfae.pythonanywhere.com/tcf/default/index
>
> I can't login with android. I don't know. I see in the upper right of the 
> smartphone 3 lines but when I click nothing happens...How to fix it?
> I didn't find anything about this problem it. 
> Maybe is it regarding bootstrap 4 in web2py?
> 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] Login not working on smartphone - no the same menu layout

2018-04-18 Thread Andrea Fae'
this is my application

https://andfae.pythonanywhere.com/tcf/default/index

I can't login with android. I don't know. I see in the upper right of the 
smartphone 3 lines but when I click nothing happens...How to fix it?
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.


Re: [web2py] btn-default

2018-03-28 Thread Andrea Fae'
Yes...I know this, but in web2py application I need to change the style. 
Where is the definition of this class in the files css? Inside the web 
application I mean...


Il giorno mercoledì 28 marzo 2018 16:50:15 UTC+2, Richard ha scritto:
>
> Bootstrap : https://getbootstrap.com/
>
> On Tue, Mar 27, 2018 at 4:02 PM, Andrea Fae' <and...@gmail.com 
> > wrote:
>
>> Where is the definition btn-default in any welcome clone application? I 
>> need to change the style...thanks
>>
>> -- 
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to web2py+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.


[web2py] btn-default

2018-03-27 Thread Andrea Fae'
Where is the definition btn-default in any welcome clone application? I 
need to change the style...thanks

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


[web2py] button separation

2018-03-18 Thread Andrea Fae'
Hello, attached there is my login page.
I'd like to separate a little bit the 2 buttons "log in" and "password 
smarrita". They belong to bootstrap btn-default class, but I don't know 
exactly where I have to change the properties of these class in the 
application files...
Thanks

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


login page.docx
Description: MS-Word 2007 document


Re: [web2py] auth.settings.actions_disabled.append('register')

2018-03-16 Thread Andrea Fae'
In layout.html there is an error...


wrong
  

right
  {{=T('Lost Password')}}


Il giorno venerdì 16 marzo 2018 20:07:27 UTC+1, Andrea Fae' ha scritto:
>
> Do you mean that, like in the other versions, it shoud be enogh only to 
> write auth.settings.actions_disabled.append('register') and nothing more?
> I see "password smarrita" in the menu and clicking it I see the same error 
> 404 NOT FOUND and it points to "request_password" controller. Why if in the 
> user function is written
>  http:///[app]/default/user/retrieve_password ?
>
>
> Il giorno venerdì 16 marzo 2018 05:27:32 UTC+1, Massimo Di Pierro ha 
> scritto:
>>
>> That used to be done automatically when registration was disabled. It 
>> made the layout unnecessarily complex. Any action could be disabled and 
>> that;s a lot of if statements.
>>
>> On Saturday, 10 March 2018 21:34:49 UTC-6, alex wrote:
>>>
>>> What about removing this: 
>>>
>>> >> href="{{=URL('default','user/register')}}">{{=T('Sign up')}}
>>>
>>> from layout.html?
>>>
>>>
>>> On March 11, 2018 at 4:42:52, Andrea Fae' (and...@gmail.com) wrote:
>>>
>>> Sometimes problems arises. I need to eliminate "sign up" menu item from 
>>> LOGIN but nevertheless I inserted this line
>>>
>>> auth.settings.actions_disabled.append('register')
>>>
>>> or this
>>>
>>> auth.settings.actions_disabled = ['register']
>>>
>>> in the db.py I can see the item in the menu, and when I click I see "404 
>>> NOT FOUND" page.
>>>
>>> One time only this line could delete this menu item.
>>>
>>> Do I forgot anything?
>>> Thanks 
>>> --
>>> Resources:
>>> - http://web2py.com
>>> - http://web2py.com/book (Documentation)
>>> - http://github.com/web2py/web2py (Source code)
>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>> ---
>>> You received this message because you are subscribed to the Google 
>>> Groups "web2py-users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to web2py+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] auth.settings.actions_disabled.append('register')

2018-03-16 Thread Andrea Fae'
Do you mean that, like in the other versions, it shoud be enogh only to 
write auth.settings.actions_disabled.append('register') and nothing more?
I see "password smarrita" in the menu and clicking it I see the same error 
404 NOT FOUND and it points to "request_password" controller. Why if in the 
user function is written
 http:///[app]/default/user/retrieve_password ?


Il giorno venerdì 16 marzo 2018 05:27:32 UTC+1, Massimo Di Pierro ha 
scritto:
>
> That used to be done automatically when registration was disabled. It made 
> the layout unnecessarily complex. Any action could be disabled and that;s a 
> lot of if statements.
>
> On Saturday, 10 March 2018 21:34:49 UTC-6, alex wrote:
>>
>> What about removing this: 
>>
>> > href="{{=URL('default','user/register')}}">{{=T('Sign up')}}
>>
>> from layout.html?
>>
>>
>> On March 11, 2018 at 4:42:52, Andrea Fae' (and...@gmail.com ) 
>> wrote:
>>
>> Sometimes problems arises. I need to eliminate "sign up" menu item from 
>> LOGIN but nevertheless I inserted this line
>>
>> auth.settings.actions_disabled.append('register')
>>
>> or this
>>
>> auth.settings.actions_disabled = ['register']
>>
>> in the db.py I can see the item in the menu, and when I click I see "404 
>> NOT FOUND" page.
>>
>> One time only this line could delete this menu item.
>>
>> Do I forgot anything?
>> Thanks 
>> --
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> ---
>> You received this message because you are subscribed to the Google Groups 
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to web2py+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.


[web2py] change button form style

2018-03-15 Thread Andrea Fae'
Can I have any examples about changing some style of form components, like 
for example buttons, text fields, labels,etc?
Thanks

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


[web2py] 'FieldVirtual' object has no attribute 'listable'

2018-03-12 Thread Andrea Fae'
I don't know because I'm sure mounths ago it was working...


form = SQLFORM.grid(query, args=[studente], fields=[db.evento.titolo, 
db.evento.ricorrenza, db.evento.giorno_inizio, db.evento.inizio, 
db.evento.fine, db.evento.risorsa, db.evento.materia, 
db.evento.docente],headers=headers,create=False, details=False, 
editable=False, deletable=False, searchable=False, maxtextlength=60, 
exportclasses = exportcls)


this is the table...

db.define_table('evento',
Field('titolo', requires=[IS_NOT_EMPTY()]),
Field('inizio', type='datetime'),
Field('fine', type='datetime'),
Field('uniqueid', type='string'),
Field('ricorrenza', requires = IS_IN_SET(['0', '1', '2', 
'3', '4', '5', '6', '7', '8', '9', '10'], error_message='deve essere un 
numero da 0 a 10'), default= '0'),
Field.Virtual('giorno_inizio', lambda 
row:calendar.day_name[row.evento.inizio.weekday()]),
Field('risorsa', 'reference risorsa'),
Field('docente', 'reference auth_user'),
Field('materia', 'reference materia'),
Field('studenti', 'list:reference auth_user'),
Field('colore', default = '#8080ff'),
Field('controllato', type='boolean', default=False),
Field('note'),

auth.signature,singular="Evento",plural="Eventi",migrate='evento.table',
format='%(titolo)s')
# questa impostazione serve per rappresentare inizio senza i secondi
db.evento.inizio.represent = lambda value, row: value.strftime("%d/%m/%Y 
%H:%M")
db.evento.fine.represent = lambda value, row: value.strftime("%d/%m/%Y 
%H:%M")
db.evento.giorno_inizio.represent = lambda giorno_inizio, row: 
T(giorno_inizio)


I think it's a problem about the last version of web2py..

-- 
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: bootstrap very bad

2018-03-12 Thread Andrea Fae'


Il giorno lunedì 12 marzo 2018 20:04:57 UTC+1, Andrea Fae' ha scritto:
>
> Hello, Why I have very bad format in the dialog and in the forms? label is 
> not on the lef of the field and all is white colourhow to change? Look 
> attached file...
>

response.formstyle = 'bootstrap4_inline'  ??
response.form_label_separator = ''  ??

where are in the docs?
 

> thanks 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] bootstrap very bad

2018-03-12 Thread Andrea Fae'
Hello, Why I have very bad format in the dialog and in the forms? label is 
not on the lef of the field and all is white colourhow to change? Look 
attached file...
thanks 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.


errore form.docx
Description: MS-Word 2007 document


[web2py] Python 3

2018-03-11 Thread Andrea Fae'
Can I really use web2py with Python 3? I fell they are a lot of bugs...Is 
it better to stay in the version 2?
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] auth.settings.actions_disabled.append('register')

2018-03-10 Thread Andrea Fae'
Sometimes problems arises. I need to eliminate "sign up" menu item from 
LOGIN but nevertheless I inserted this line

auth.settings.actions_disabled.append('register')

or this

auth.settings.actions_disabled = ['register']

in the db.py I can see the item in the menu, and when I click I see "404 
NOT FOUND" page.

One time only this line could delete this menu item.

Do I forgot anything?
Thanks 

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


Re: [web2py] Re: new style of welcome app

2018-03-09 Thread Andrea Fae'
This is working! Thanks...Why?

Il giorno venerdì 9 marzo 2018 12:42:18 UTC+1, alex ha scritto:
>
> In layout.html, instead of 
>
> 
>
> you can try:
>
> 
>
>
>
>
> On March 9, 2018 at 05:12:50, Andrea Fae' (and...@gmail.com ) 
> wrote:
>
> Yes, I clear the cache 
>
> Look attached file. Thanks
>
> Il giorno giovedì 8 marzo 2018 03:00:53 UTC+1, Anthony ha scritto: 
>>
>>
>>
>> On Wednesday, March 7, 2018 at 2:40:02 PM UTC-5, Andrea Fae' wrote: 
>>>
>>> Thanks Anthony, but LOGIN is still in the left side... 
>>>
>>>
>>> <https://lh3.googleusercontent.com/-JiNYDk5FVV0/WqBABpgofLI/HaM/6h3jC4QW9mUjKzJPhbpkZEh2dPQe13DuQCLcBGAs/s1600/Cattura.JPG>
>>>
>>
>> It's on the right for me:
>>
>>
>> <https://lh3.googleusercontent.com/-1QKQp8DurWI/WqCZCjIYmvI/T0c/WJ6PUHYsOVsGIpCbr09iYJ3eaxaWqq3iQCLcBGAs/s1600/menu.png>
>> What does the HTML for the login dropdown look like in the rendered page?
>>
>> Anthony
>>
> --
> 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.


[web2py] Re: new style of welcome app

2018-03-07 Thread Andrea Fae'
Thanks Anthony, but LOGIN is still in the left side...

<https://lh3.googleusercontent.com/-JiNYDk5FVV0/WqBABpgofLI/HaM/6h3jC4QW9mUjKzJPhbpkZEh2dPQe13DuQCLcBGAs/s1600/Cattura.JPG>


Il giorno lunedì 5 marzo 2018 13:18:50 UTC+1, Anthony ha scritto:
>
> On Sunday, March 4, 2018 at 12:12:45 PM UTC-5, Andrea Fae' wrote:
>>
>> I have different apps in my web2py environments. Web2py apps built before 
>> a certain date have a stile with "login" link in the right upper side of 
>> the web page, while the new apps, for example welcome app are with another 
>> style with login link anchor in the left side, just after the menus, and 
>> after a "search" box. Why?
>> How to delete the search box and have the login in the right part of the 
>> page?
>>
>
> You can copy the layout from the old welcome app if you prefer it. 
> Otherwise, you'll have to customize the new layout to your liking. The 
> search box is just 3 lines that you can delete. Regarding the login, it is 
> already pushed to the right side of the screen.
>
> Anthony
>

-- 
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] new style of welcome app

2018-03-04 Thread Andrea Fae'
I have different apps in my web2py environments. Web2py apps built before a 
certain date have a stile with "login" link in the right upper side of the 
web page, while the new apps, for example welcome app are with another 
style with login link anchor in the left side, just after the menus, and 
after a "search" box. Why?
How to delete the search box and have the login in the right part of the 
page?
Thanks

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


[web2py] Re: $.web2py.component

2018-03-04 Thread Andrea Fae'
Thank you. If I will have time I will analyze the code.


Il giorno sabato 3 marzo 2018 22:21:51 UTC+1, Anthony ha scritto:
>
> On Saturday, March 3, 2018 at 2:14:29 PM UTC-5, Andrea Fae' wrote:
>>
>> Anthony, what is the difference between
>>
>>  $.web2py.component(url_materia + '?docente=' + v, 
>> 'evento_materia');
>>  
>> and
>>
>>  $.web2py.component(url_materia + '?docente=' + v, 
>> 'evento_materia','no','no',$('#evento_materia'));
>>
>> where is the complete syntax about this?
>>
>
> Relevant code is here: 
> https://github.com/web2py/web2py/blob/b16e33ab652d567ba62fd810814864f124504375/applications/welcome/static/js/web2py.js#L401
>
>

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


  1   2   3   >