Re: [web2py] web2py 2.16.01 legacy databases

2018-01-24 Thread Ovidio Marinho
What is the need for you to create a primary key in a field name or char?
look this:
It defines, stores and returns a Table object called "person" containing a
field (column) "name". This object can also be accessed via db.person, so
you do not need to catch the return value.
id: Notes about the primary key

Do not declare a field called "id", because one is created by web2py
anyway. Every table has a field called "id" by default. It is an
auto-increment integer field (starting at 1) used for cross-reference and
for making every record unique, so "id" is a primary key. (Note: the id
counter starting at 1 is back-end specific. For example, this does not
apply to the Google App Engine NoSQL.)

Optionally you can define a Field of type='id' and web2py will use this
field as auto-increment id field. This is not recommended except when
accessing legacy database tables which have a primary key under a different
name. With some limitation, you can also use different primary keys using
the primarykey parameter. primarykey is explained shortly below.
http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#id--Notes-about-the-primary-key

a good practice of development is not creating primary keys are named,
another element would be important to social security + name ,for example.

Hope this helps.




   [image: http://itjp.net.br] 
 http://itjp.net.b r
  *Ovidio Marinho Falcao Neto*
 ovidio...@gmail.com
Brasil


2018-01-24 19:54 GMT-03:00 'DenesL' via web2py-users <
web2py@googlegroups.com>:

> Testing web2py 2.16.01 installed from source on Windows 8 with Python
> 2.7.14
>
> I have two tables on MS SQL Server 2012, one is legacy, the other not:
>
> w2p.define_table('person',
>   Field('name', 'string', length=100, notnull=True),
>   Field('info', 'string', length=100),
>   primarykey=['name']
> )
>
> w2p.define_table('persona',
>   Field('name', 'string', length=100, notnull=True),
>   Field('info', 'string', length=100)
> )
>
> The appadmin shows the records for both tables but the legacy anchors to
> display each record are being incorrectly generated as:
>
> Ana
> 
>
> http://10.0.0.27:8000/test/appadmin/select/%3Cfunction%
> 20%3Clambda%3E%20at%200x071AAEB8%3E/person?name=Ana
>
> Regards,
> Denes
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

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


[web2py] web2py 2.16.01 legacy databases

2018-01-24 Thread 'DenesL' via web2py-users
Testing web2py 2.16.01 installed from source on Windows 8 with Python 2.7.14

I have two tables on MS SQL Server 2012, one is legacy, the other not:

w2p.define_table('person',
  Field('name', 'string', length=100, notnull=True),
  Field('info', 'string', length=100),
  primarykey=['name']
)

w2p.define_table('persona',
  Field('name', 'string', length=100, notnull=True),
  Field('info', 'string', length=100)
)

The appadmin shows the records for both tables but the legacy anchors to 
display each record are being incorrectly generated as:

Ana

http://10.0.0.27:8000/test/appadmin/select/%3Cfunction%20%3Clambda%3E%20at%200x071AAEB8%3E/person?name=Ana

Regards,
Denes

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

2018-01-24 Thread Dave S


On Wednesday, January 24, 2018 at 1:28:05 PM UTC-8, Andrea Fae' wrote:
>
> Web2py integrated ide environment is not bad, but with limited debugging, 
> no intellisense and so on.
> I'd like to know what is a completely free IDE for using with web2py. 
> Visual Studio Community? Visual Code Editor? In which way? How can I 
> integrate web2py with these IDE? Is it possible? 
> Can you suggest the best free IDE for web2py, with HTML, CSS, Javascript 
> and, obviously Python 2?
> Thank you
>

PyCharm seems to be popular, and produces a bunch of hits (we've had a 
poster who actually worked with the PyCharm people to improve web2py 
support).

This post by yours truly is from one of the hits:

  
>
>>
>>> *2.*  As a newbie should I use PyCharm as an IDE or would you recommend 
>>> I use the embedded Web2Py editor?
>>>
>>> *3.*  When using PyCharm, is there any HOW-TO documents on how to get 
>>> PyCharm working with Web2Py?
>>>
>> If you're looking to prototype rapidly, forget all that stuff and just 
>> build something in a text editor (ie Atom) with the pre-installed 
>> Bootstrap. Don't over-complicate it.
>>
>
> Using PyCharm is discussed in the book:
> http://web2py.com/books/default/chapter/29/14/other-recipes#PyCharm>
>  
> It seems to have some popularity in this group, and this thread may be 
> relevant.
> https://groups.google.com/d/topic/web2py/wi25qItKDEo/discussion>
>
> That said, I have never tried it.  I use both the built-in IDE and an 
> external text editor (emacs on linux, the ancient PFE on Windows), choosing 
> based on ephemeral ideas of convenience.
>
> (Long ago, I had a couple of experiences with Eclipse, and still have to 
> deal with Visual Studio sometimes.  But those weren't introduced until 
> after I had a lot of development habits already in place, so IDEs can seem 
> to me like driving a truck rather than a sportscar.  The built-in IDE is 
> much lighter than Eclipse.)
>
> /dps
>

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


[web2py] Re: web2py IDE

2018-01-24 Thread pbreit
If you just need code formatting/coloring a decent text editor works well 
enough: VS Code, Atom, Bracket

Keep it simple.

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

2018-01-24 Thread Philip Kilner

Hi,

On 24/01/18 21:28, Andrea Fae' wrote:
Can you suggest the best free IDE for web2py, with HTML, CSS, Javascript 
and, obviously Python 2?




I've been using Cloud 9 for a while and am happy with it.

I tend to SSH into my own workspace, which required the paid version of 
Cloud 9 - since AWS took them over and created their own cut of Cloud 9 
this is now free. I like it a lot.



--

Regards,

PhilK


'a bell is a cup...until it is struck'

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

2018-01-24 Thread Andrea Fae'
Web2py integrated ide environment is not bad, but with limited debugging, 
no intellisense and so on.
I'd like to know what is a completely free IDE for using with web2py. 
Visual Studio Community? Visual Code Editor? In which way? How can I 
integrate web2py with these IDE? Is it possible? 
Can you suggest the best free IDE for web2py, with HTML, CSS, Javascript 
and, obviously Python 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] Problem with -L or --config= of command line

2018-01-24 Thread Richard
Hello,

I try to pass a logging.conf file as part of a crond tab job that is 
launch, but the web2py command line option -L doesn't accept the 
loggin.conf file... Is there any limitation over which type of 
configuration file that are supported??

If I put the logging.conf in web2py folder it works, but I don't want to 
web2py environnement all the time just for some cron job... I thought I 
could pass the logging.conf at launch of the web2py instance...

Thanks

Richard

-- 
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: auth.messages.subject

2018-01-24 Thread Mark Billion
Sorry, that covers gen emails not the auth section as far as I can see

On Wednesday, January 24, 2018 at 1:50:04 PM UTC-5, Marcelo Huerta wrote:
>
> El miércoles, 24 de enero de 2018, 15:47:50 (UTC-3), Mark Billion escribió:
>>
>> So, this does not work.  Any way to set the subject line? (maybe Im just 
>> missing it)
>>
>
> http://web2py.com/books/default/chapter/29/08/emails-and-sms#Sending-emails
>  
>

-- 
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: auth.messages.subject

2018-01-24 Thread Marcelo Huerta
El miércoles, 24 de enero de 2018, 15:47:50 (UTC-3), Mark Billion escribió:
>
> So, this does not work.  Any way to set the subject line? (maybe Im just 
> missing it)
>

http://web2py.com/books/default/chapter/29/08/emails-and-sms#Sending-emails 

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

2018-01-24 Thread Mark Billion
So, this does not work.  Any way to set the subject line? (maybe Im just 
missing it)

-- 
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] Trouble with reset password

2018-01-24 Thread Julian Sanchez
I'm having troubles with the reset password functionality and I'm hoping 
you guys can give me some pointers on what to check, or how to fix it 
(version 2.16.1 stable, running from source).

When running my application in GAE I can go to the reset password page 
('default/user/request_reset_password') and enter the email address, but 
when I click on 'Request reset password' button It goes straight to the 
internal error page, and the logs show "TypeError: long() argument must be 
a string or a number, not 'auth_user'".

I re-downloaded the web2py source code and put it on a separate location.  
I simply went to the default app and registered a test user.  When I 
clicked on the "Lost Password" menu option it went straight to a "404 NOT 
FOUND".

So at this point I'm not sure if my application is doing something wrong or 
if it's an issue with the actual framework since the default application 
doesn't seem to be working right.  I've seen other posts around password 
reset not working but seem to be related to other issues.  Any 
ideas/suggestions I would greatly appreciate it.

Thanks,
Julian



-- 
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] appadmin CSV Import / Manual insertion ascii "ordinal out of range" error

2018-01-24 Thread Jesse Hunt
Good afternoon all,

I have been coming across errors while trying to work with the built-in 
appadmin to set up tables by manually inserting entries or importing CSVs 
(using MSSQL primarily). Put simply, any text with German umlauts 
(characters with the symbols above them, such as Ä, ö) would cause web2py 
to raise an error:

UnicodeDecodeError: 'ascii' codec can't decode byte ___ in position ___: 
ordinal not in range(128)

I have been searching in vain for months trying to find a solution as most 
queries lead to issues from 2015 with pg8000, etc.

My (dirty but) simple fix:

When you are encountering the DAL hanging up with umlauts, it is most 
likely caused by the pyodbc package. Even if you remove your own pyodbc 
package, web2py still has it’s internal version to go off of.

 

To disable it:


Remove pyodbc from your local environment that web2py is running in.

Remove pypyodbc.py from web2py/gluon/contrib/pypyodbc.py

 

When the pyDAL loads up, it will not complain, as per line 63 from 
web2py/gluon/packages/dal/pydal/drivers.py:

 

 

try:

import pyodbc

DRIVERS['pyodbc'] = pyodbc

#DRIVERS.append('DB2(pyodbc)')

#DRIVERS.append('Teradata(pyodbc)')

#DRIVERS.append('Ingres(pyodbc)')

except ImportError:

try:

import pypyodbc as pyodbc

DRIVERS['pyodbc'] = pyodbc

except ImportError:

pyodbc = None

 
(If the driver is not found, it will just label pyodbc as none)

I hope this saves someone else the trouble in the future.

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