[web2py] Re: Asking support for MySQL create/alter column "AFTER" keyword

2021-07-22 Thread Alfonso Serra
Hi Massimo

I have created standalone functions that reorders table fields and support 
for indexing regular fields by adding "indexed" to the Field signature at 
objects.py
Before trying the script please add indexed=False to the Field signature 
and self.indexed = indexed in objects.py, or overwrite with the attached 
objects.py file.

Its naive and in progress as it only supports common mysql types.

Please let me know how it looks, ill try to integrate this into pydal on my 
own but i still have to study how.

Thanks
Best Regards.



On Wednesday, 24 January 2018 at 00:01:33 UTC Alfonso Serra wrote:

> This works only on newly created fields over MySQL. Moving fields around 
> on your model wont reorder them. 
>
> Version 2.15.3-stable+timestamp.2017.08.07.12.51.45
> migrator.py line 364
> field_position = sql_fields[key]['sortable']
> after = "FIRST"
> if field_position > 1:
> for f in sql_fields:
> if sql_fields[f]['sortable'] == 
> field_position - 1:
> after = "AFTER `%s`" % f
> break
> query = ['ALTER TABLE %s ADD %s %s %s;' % (
> table._rname, sql_fields[key]['rname'],
> sql_fields_aux[key]['sql'].replace(', ', new_add), 
> after)]
>
> Theres no way to implement column reorder because the db is not being 
> asked for the table schema, this information is read from the migration 
> files. This function only checks whther the fields on your model are in the 
> migration files, in no particular order. It would be nice if there were a 
> way.
>
>

-- 
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/44824305-8c1b-4aac-858f-668e5e065cacn%40googlegroups.com.
<>


[web2py] Re: How to encrypt password

2021-07-22 Thread Dave S


On Thursday, July 22, 2021 at 10:47:08 AM UTC-7 isi_jca wrote:

> Hello!
> I have a historical table where I save  n passwords by users so, I want to 
> validate in the next change password that the user don't repeat the 
> password. I need to encrypt the password and make a query in historical 
> table.
> How can I do to encrypt the password in Web2py?
>
> Best regards.



There are relevant validators in the FORM system.  Take a look at 
http://web2py.com/books/default/chapter/29/07/forms-and-validators#Complexity-and-security-validators>
and see if they help.  The CRYPT() validator should do what you need, I 
think.

This is aside from any tools in your front end.
 
/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/6309c286-25dc-4b3d-88aa-687f15133fbbn%40googlegroups.com.


[web2py] How to encrypt password

2021-07-22 Thread isi_jca
Hello!
I have a historical table where I save  n passwords by users so, I want to 
validate in the next change password that the user don't repeat the 
password. I need to encrypt the password and make a query in historical 
table.
How can I do to encrypt the password in Web2py?

Best regards.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/0eaedf8b-ef31-4d0d-a87b-dc713ad18c6bn%40googlegroups.com.