[web2py] Re: URI for mssql

2020-08-17 Thread T.R.Rajkumar
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/23fcb03f-38e4-4c44-b74e-d36ee54647a7n%40googlegroups.com.


[web2py] Re: modules: NameError("name 'reload' is not defined",)

2020-08-17 Thread 'Annet' via web2py-users
I reported the same problem some time ago.

When I edit a module and save it I get this nameError. Since I am
importing the modules into other applications I have to restart web2py
everytime I edit a module.

Further more the module are no longer compiled on first use, which
I also find very annoying.

Annet

Op zondag 16 augustus 2020 om 12:09:28 UTC+2 schreef Vlad:

> same error, though with a lot more than 3 lines
>
> On Wednesday, June 24, 2020 at 5:36:36 AM UTC-5 serge.bo...@gmail.com 
> wrote:
>
>>
>> I have an issue saving my modues with the last version of web2py.
>> Is there something I do wrong?
>>
>> Context: Ubuntu 18.04 / web2py version 2.20.4 / python 3.6.9
>>
>> How to reproduce this issue (a bug??) with a simple example:
>>
>> In the applications examples, create a module (for instance empty.py)
>>
>> Then open it, 
>> => url: 
>> 127.0.0.1:8000/admin/default/edit/examples/modules/empty.py?id=modules__empty__py
>> The file contains 3 lines:
>> #!/usr/bin/env python
>> # -*- coding: utf-8 -*-
>> from gluon import *
>>
>> do not change anything and save it (ctrl + S)...
>>
>> => Since the last version, I get the following message:
>>
>>  Impossible de recharger le module car:
>>  NameError("name 'reload' is not defined",)
>>
>> Thanks for any advise...
>>
>

-- 
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/56370ed0-27a0-4b3d-a984-2fd6ac7bb964n%40googlegroups.com.


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

2020-08-17 Thread villas
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/773a257f-3b89-4353-af71-68485c926ee0o%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.


Re: [web2py] Re: pyDAL looks abandoned?

2020-08-17 Thread AGRogers
That's good news.

On Mon, 17 Aug 2020 at 17:08, Massimo Di Pierro 
wrote:

> yes Peewee is more actcie but I would not say pydal is abandoned. pydal is
> more mature and there were commits as recent as last week. In my opinion it
> needs very little work and I am reluctant to change things. Many of the
> issues are requests for new features, some are how to, or support for
> exhotic features. There are also many issue that have been fixed but the
> issue has not been closed. When I have time I will take a pass and close a
> bunch.
>
> I do not think there are many bugs in pydal that need fixing excecpt for
> the need to support google cloud storage in py3.
>
>
> On Monday, 11 May 2020 13:27:14 UTC-7, Val K wrote:
>>
>>
>> There are 131 issues on pyDAL-GitHub, but the problem is not in the
>> amount but in that more than half of them without any response. Look at
>> peewee that has 7.5k stars and only 2 open issues!... yes, this is impolite
>> comparision - sorry.
>> I've just need to implement CTE + WITH RECURSIVE (like this
>> http://docs.peewee-orm.com/en/latest/peewee/querying.html#recursive-ctes
>> )
>> and I wasted 2 days to figure out how I can do very simple thing like  '1
>> AS foo'  in right way that is (as I suppose):
>> Expression(db, '1', type='integer').with_alias('foo')
>>
>> So, the question is: why is there nothing about that in the book?
>> Why does pyDAL have no that very simple but very necessary method  which
>> allows to do cool things like:
>>  db(...).select(
>> ...,
>> db.exp(
>>'max(product.price) OVER(PARTITION BY product.category)',
>>type = 'decimal(n, m)' # the same as Field(..., type = 'decimal(n,
>> m)')
>> ).with_alias('most_expensive_in_category')
>> )
>>
>> here is used WINDOW-function that allows to get products list with
>> 'most_expensive_in_category' in *one* plain query
>> *without using subquery* with GRUOP BY product.category + join
>>
>> Also there is my PR on web2py book
>> https://github.com/web2py/web2py-book/pull/424
>> it hangs for almost a year - it is just a book, not code
>> I'm sad
>>
> --
> 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/8a858190-e078-44f8-bcff-c88c13dae0b6o%40googlegroups.com
> 
> .
>

-- 
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/CACWMBMNT4SbbjjKeWNT015pWMm44%3Di77mYgWEBYWpwppxK7LVQ%40mail.gmail.com.


[web2py] Re: pyDAL looks abandoned?

2020-08-17 Thread Massimo Di Pierro
yes Peewee is more actcie but I would not say pydal is abandoned. pydal is 
more mature and there were commits as recent as last week. In my opinion it 
needs very little work and I am reluctant to change things. Many of the 
issues are requests for new features, some are how to, or support for 
exhotic features. There are also many issue that have been fixed but the 
issue has not been closed. When I have time I will take a pass and close a 
bunch.

I do not think there are many bugs in pydal that need fixing excecpt for 
the need to support google cloud storage in py3.


On Monday, 11 May 2020 13:27:14 UTC-7, Val K wrote:
>
>
> There are 131 issues on pyDAL-GitHub, but the problem is not in the amount 
> but in that more than half of them without any response. Look at peewee 
> that has 7.5k stars and only 2 open issues!... yes, this is impolite 
> comparision - sorry.
> I've just need to implement CTE + WITH RECURSIVE (like this 
> http://docs.peewee-orm.com/en/latest/peewee/querying.html#recursive-ctes) 
> and I wasted 2 days to figure out how I can do very simple thing like  '1 
> AS foo'  in right way that is (as I suppose):
> Expression(db, '1', type='integer').with_alias('foo')
>
> So, the question is: why is there nothing about that in the book?
> Why does pyDAL have no that very simple but very necessary method  which 
> allows to do cool things like:
>  db(...).select(
> ...,
> db.exp(
>'max(product.price) OVER(PARTITION BY product.category)', 
>type = 'decimal(n, m)' # the same as Field(..., type = 'decimal(n, 
> m)')
> ).with_alias('most_expensive_in_category')
> )
>
> here is used WINDOW-function that allows to get products list with 
> 'most_expensive_in_category' in *one* plain query 
> *without using subquery* with GRUOP BY product.category + join
>
> Also there is my PR on web2py book 
> https://github.com/web2py/web2py-book/pull/424
> it hangs for almost a year - it is just a book, not code
> I'm sad
>

-- 
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/8a858190-e078-44f8-bcff-c88c13dae0b6o%40googlegroups.com.