Re: [web2py] Re: Insert data in firebird database

2018-05-14 Thread Raul Monares
The problem with the Firebird adapter is that it inserts blobs as base64 
strings directly in an INSERT statement instead of using the stream 
mechanism that Firebird provides. There's a reported bug about 
this: https://github.com/web2py/web2py/issues/666. At this time, there's no 
workaround.


On Monday, May 14, 2018 at 8:56:43 AM UTC-6, Nico de Groot wrote:
>
> I added blob to the fieldname because in my code DAL checks for reserved 
> SQL names. DATA is not allowed in some databases 
>
> Op zo 13 mei 2018 om 11:39 schreef Константин Комков  >
>
>> Nico de Groot, thank you for example and attention! I already have crud 
>> form and that form work. It load files in folder 'uploads'. I want to save 
>> that files in database now. I sure that 
>> stream=open(filepath + '\\' + i.file, 'rb')
>> and
>> stream.read()
>> made a long base64 string because I saw it on site. Then I decoded it and 
>> got picture.
>> Also I tried to save that file as usual SQL request in Firebird and 
>> web2py interfaces, where field DATA conteined string in base64. Like that:
>> INSERT INTO bin_files (PARENT, SRC_FILENAME, DATA) VALUES 
>> (33,'name.jpg','very 
>> very long base64 string').
>> After that Firebird has hanged. Web2py given an error message.
>> Just in case, are there between names 'DATA' and 'DATAblob'?
>> Yesterday and today I can't test all again because it's day off.
>> Raul Monares, thank you too! I cheked file that contain string in base64 
>> and it's sise 440kb. It's more then size of file in the beginning (name.jpg 
>> - 322kb). What should I do in that case, after all blob field can store 
>> large files.
>>
>> -- 
>> 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/_MVVu9PF0xk/unsubscribe.
>> To unsubscribe from this group and all its topics, 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: SQLFORM.smartgrid - Query Not Supported: (1066, "Not unique table/alias: 'a_table'")

2018-05-14 Thread 98ujko9
I am a weekend coder and my queries probably need to be redesigned. I was 
trying to move everything to a newer environment and immediately weak areas 
fail first. In time I should be able to sort things out. I do enjoy working 
with web2py . Thanks for your input.

On Monday, May 14, 2018 at 10:48:12 AM UTC-4, Anthony wrote:
>
> I don't see the left join queries for 2.16.11. Anyway, maybe try running 
> the different queries in a separate MySQL client and see if you can 
> reproduce the error to isolate the problem.
>
> Anthony
>
> On Saturday, May 12, 2018 at 1:40:51 PM UTC-4, 98u...@gmail.com 
>  wrote:
>>
>> db stats for 2.16.11
>>
>> SELECT `labour`.`lab_description`, `labour`.`lab_id` FROM `labour` WHERE 
>> ((`labour`.`lab_id` IS NOT NULL) AND (`labour`.`lab_term_date` IS NULL)) 
>> ORDER BY `labour`.`lab_description`, `labour`.`lab_id`;
>>
>> 1.11ms
>> ---
>>
>> db stats for 2.9.11
>>
>> SET FOREIGN_KEY_CHECKS=1;
>>
>> 1.31ms
>>
>> SET sql_mode='NO_BACKSLASH_ESCAPES';
>>
>> 1.29ms
>>
>> SELECT  labour.lab_description, labour.lab_id FROM labour WHERE 
>> ((labour.lab_id IS NOT NULL) AND (labour.lab_term_date IS NULL)) ORDER BY 
>> labour.lab_description, labour.lab_id;
>>
>> 9.32ms
>>
>> SELECT  labour.lab_description, labour.lab_id FROM labour WHERE 
>> ((labour.lab_id IS NOT NULL) AND (labour.lab_term_date IS NULL)) ORDER BY 
>> labour.lab_description, labour.lab_id;
>>
>> 9.07ms
>>
>> SELECT  count(*) FROM labour LEFT JOIN labprice ON ((labour.lab_id = 
>> labprice.lp_lab_id) AND (labprice.lp_term_date IS NULL)) WHERE 
>> (labprice.lp_id IS NOT NULL);
>>
>> 2.57ms
>>
>> SELECT  labprice.lp_id, labprice.lp_lab_id, labprice.lp_unit_price, 
>> labprice.lp_comment, labprice.lp_intro_date FROM labour LEFT JOIN labprice 
>> ON ((labour.lab_id = labprice.lp_lab_id) AND (labprice.lp_term_date IS 
>> NULL)) WHERE (labprice.lp_id IS NOT NULL) ORDER BY labour.lab_description;
>>
>> 47.51ms
>>
>> SELECT  labour.lab_id, labour.lab_description, labour.lab_intro_date, 
>> labour.lab_term_date, labour.lab_term_id, labour.lab_comment FROM labour 
>> WHERE ((labour.lab_id = 97) AND (labour.lab_term_date IS NULL)) LIMIT 1 
>> OFFSET 0;
>>
>> 2.12ms
>>
>> SELECT  labour.lab_id, labour.lab_description, labour.lab_intro_date, 
>> labour.lab_term_date, labour.lab_term_id, labour.lab_comment FROM labour 
>> WHERE ((labour.lab_id = 112) AND (labour.lab_term_date IS NULL)) LIMIT 1 
>> OFFSET 0;
>>
>> 2.09ms
>>
>> SELECT  labour.lab_id, labour.lab_description, labour.lab_intro_date, 
>> labour.lab_term_date, labour.lab_term_id, labour.lab_comment FROM labour 
>> WHERE ((labour.lab_id = 113) AND (labour.lab_term_date IS NULL)) LIMIT 1 
>> OFFSET 0;
>>
>> 2.04ms
>>
>> SELECT  labour.lab_id, labour.lab_description, labour.lab_intro_date, 
>> labour.lab_term_date, labour.lab_term_id, labour.lab_comment FROM labour 
>> WHERE ((labour.lab_id = 113) AND (labour.lab_term_date IS NULL)) LIMIT 1 
>> OFFSET 0;
>>
>> 2.03ms
>>
>> SELECT  labour.lab_id, labour.lab_description, labour.lab_intro_date, 
>> labour.lab_term_date, labour.lab_term_id, labour.lab_comment FROM labour 
>> WHERE ((labour.lab_id = 90) AND (labour.lab_term_date IS NULL)) LIMIT 1 
>> OFFSET 0;
>>
>> 2.03ms
>>
>> SELECT  labour.lab_id, labour.lab_description, labour.lab_intro_date, 
>> labour.lab_term_date, labour.lab_term_id, labour.lab_comment FROM labour 
>> WHERE ((labour.lab_id = 90) AND (labour.lab_term_date IS NULL)) LIMIT 1 
>> OFFSET 0;
>>
>> 2.05ms
>>
>> SELECT  labour.lab_id, labour.lab_description, labour.lab_intro_date, 
>> labour.lab_term_date, labour.lab_term_id, labour.lab_comment FROM labour 
>> WHERE ((labour.lab_id = 86) AND (labour.lab_term_date IS NULL)) LIMIT 1 
>> OFFSET 0;
>>
>> 2.04ms
>>
>> SELECT  labour.lab_id, labour.lab_description, labour.lab_intro_date, 
>> labour.lab_term_date, labour.lab_term_id, labour.lab_comment FROM labour 
>> WHERE ((labour.lab_id = 86) AND (labour.lab_term_date IS NULL)) LIMIT 1 
>> OFFSET 0;
>>
>> 2.02ms
>>
>> SELECT  labour.lab_id, labour.lab_description, labour.lab_intro_date, 
>> labour.lab_term_date, labour.lab_term_id, labour.lab_comment FROM labour 
>> WHERE ((labour.lab_id = 125) AND (labour.lab_term_date IS NULL)) LIMIT 1 
>> OFFSET 0;
>>
>> 2.06ms
>>
>> SELECT  labour.lab_id, labour.lab_description, labour.lab_intro_date, 
>> labour.lab_term_date, labour.lab_term_id, labour.lab_comment FROM labour 
>> WHERE ((labour.lab_id = 120) AND (labour.lab_term_date IS NULL)) LIMIT 1 
>> OFFSET 0;
>>
>> 2.06ms
>>
>> SELECT  labour.lab_id, labour.lab_description, labour.lab_intro_date, 
>> labour.lab_term_date, labour.lab_term_id, labour.lab_comment FROM labour 
>> WHERE ((labour.lab_id = 128) AND (labour.lab_term_date IS NULL)) LIMIT 1 
>> OFFSET 0;
>>
>> 2.02ms
>>
>> SELECT  labour.lab_id, labour.lab_description, labour.lab_intro_date, 
>> labour.lab_term_date, labour.lab_term_id, labour.lab_comment FROM labour 
>> WHERE ((labour.lab_id = 118) AND (labour.lab_term_date IS NULL)) LIMIT 1 

Re: [web2py] Re: Insert data in firebird database

2018-05-14 Thread Nico de Groot
I added blob to the fieldname because in my code DAL checks for reserved
SQL names. DATA is not allowed in some databases

Op zo 13 mei 2018 om 11:39 schreef Константин Комков 

> Nico de Groot, thank you for example and attention! I already have crud
> form and that form work. It load files in folder 'uploads'. I want to save
> that files in database now. I sure that
> stream=open(filepath + '\\' + i.file, 'rb')
> and
> stream.read()
> made a long base64 string because I saw it on site. Then I decoded it and
> got picture.
> Also I tried to save that file as usual SQL request in Firebird and web2py
> interfaces, where field DATA conteined string in base64. Like that:
> INSERT INTO bin_files (PARENT, SRC_FILENAME, DATA) VALUES (33,'name.jpg','very
> very long base64 string').
> After that Firebird has hanged. Web2py given an error message.
> Just in case, are there between names 'DATA' and 'DATAblob'?
> Yesterday and today I can't test all again because it's day off.
> Raul Monares, thank you too! I cheked file that contain string in base64
> and it's sise 440kb. It's more then size of file in the beginning (name.jpg
> - 322kb). What should I do in that case, after all blob field can store
> large files.
>
> --
> 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/_MVVu9PF0xk/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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: SQLFORM.smartgrid - Query Not Supported: (1066, "Not unique table/alias: 'a_table'")

2018-05-14 Thread Anthony
I don't see the left join queries for 2.16.11. Anyway, maybe try running 
the different queries in a separate MySQL client and see if you can 
reproduce the error to isolate the problem.

Anthony

On Saturday, May 12, 2018 at 1:40:51 PM UTC-4, 98uj...@gmail.com wrote:
>
> db stats for 2.16.11
>
> SELECT `labour`.`lab_description`, `labour`.`lab_id` FROM `labour` WHERE 
> ((`labour`.`lab_id` IS NOT NULL) AND (`labour`.`lab_term_date` IS NULL)) 
> ORDER BY `labour`.`lab_description`, `labour`.`lab_id`;
>
> 1.11ms
> ---
>
> db stats for 2.9.11
>
> SET FOREIGN_KEY_CHECKS=1;
>
> 1.31ms
>
> SET sql_mode='NO_BACKSLASH_ESCAPES';
>
> 1.29ms
>
> SELECT  labour.lab_description, labour.lab_id FROM labour WHERE 
> ((labour.lab_id IS NOT NULL) AND (labour.lab_term_date IS NULL)) ORDER BY 
> labour.lab_description, labour.lab_id;
>
> 9.32ms
>
> SELECT  labour.lab_description, labour.lab_id FROM labour WHERE 
> ((labour.lab_id IS NOT NULL) AND (labour.lab_term_date IS NULL)) ORDER BY 
> labour.lab_description, labour.lab_id;
>
> 9.07ms
>
> SELECT  count(*) FROM labour LEFT JOIN labprice ON ((labour.lab_id = 
> labprice.lp_lab_id) AND (labprice.lp_term_date IS NULL)) WHERE 
> (labprice.lp_id IS NOT NULL);
>
> 2.57ms
>
> SELECT  labprice.lp_id, labprice.lp_lab_id, labprice.lp_unit_price, 
> labprice.lp_comment, labprice.lp_intro_date FROM labour LEFT JOIN labprice ON 
> ((labour.lab_id = labprice.lp_lab_id) AND (labprice.lp_term_date IS NULL)) 
> WHERE (labprice.lp_id IS NOT NULL) ORDER BY labour.lab_description;
>
> 47.51ms
>
> SELECT  labour.lab_id, labour.lab_description, labour.lab_intro_date, 
> labour.lab_term_date, labour.lab_term_id, labour.lab_comment FROM labour 
> WHERE ((labour.lab_id = 97) AND (labour.lab_term_date IS NULL)) LIMIT 1 
> OFFSET 0;
>
> 2.12ms
>
> SELECT  labour.lab_id, labour.lab_description, labour.lab_intro_date, 
> labour.lab_term_date, labour.lab_term_id, labour.lab_comment FROM labour 
> WHERE ((labour.lab_id = 112) AND (labour.lab_term_date IS NULL)) LIMIT 1 
> OFFSET 0;
>
> 2.09ms
>
> SELECT  labour.lab_id, labour.lab_description, labour.lab_intro_date, 
> labour.lab_term_date, labour.lab_term_id, labour.lab_comment FROM labour 
> WHERE ((labour.lab_id = 113) AND (labour.lab_term_date IS NULL)) LIMIT 1 
> OFFSET 0;
>
> 2.04ms
>
> SELECT  labour.lab_id, labour.lab_description, labour.lab_intro_date, 
> labour.lab_term_date, labour.lab_term_id, labour.lab_comment FROM labour 
> WHERE ((labour.lab_id = 113) AND (labour.lab_term_date IS NULL)) LIMIT 1 
> OFFSET 0;
>
> 2.03ms
>
> SELECT  labour.lab_id, labour.lab_description, labour.lab_intro_date, 
> labour.lab_term_date, labour.lab_term_id, labour.lab_comment FROM labour 
> WHERE ((labour.lab_id = 90) AND (labour.lab_term_date IS NULL)) LIMIT 1 
> OFFSET 0;
>
> 2.03ms
>
> SELECT  labour.lab_id, labour.lab_description, labour.lab_intro_date, 
> labour.lab_term_date, labour.lab_term_id, labour.lab_comment FROM labour 
> WHERE ((labour.lab_id = 90) AND (labour.lab_term_date IS NULL)) LIMIT 1 
> OFFSET 0;
>
> 2.05ms
>
> SELECT  labour.lab_id, labour.lab_description, labour.lab_intro_date, 
> labour.lab_term_date, labour.lab_term_id, labour.lab_comment FROM labour 
> WHERE ((labour.lab_id = 86) AND (labour.lab_term_date IS NULL)) LIMIT 1 
> OFFSET 0;
>
> 2.04ms
>
> SELECT  labour.lab_id, labour.lab_description, labour.lab_intro_date, 
> labour.lab_term_date, labour.lab_term_id, labour.lab_comment FROM labour 
> WHERE ((labour.lab_id = 86) AND (labour.lab_term_date IS NULL)) LIMIT 1 
> OFFSET 0;
>
> 2.02ms
>
> SELECT  labour.lab_id, labour.lab_description, labour.lab_intro_date, 
> labour.lab_term_date, labour.lab_term_id, labour.lab_comment FROM labour 
> WHERE ((labour.lab_id = 125) AND (labour.lab_term_date IS NULL)) LIMIT 1 
> OFFSET 0;
>
> 2.06ms
>
> SELECT  labour.lab_id, labour.lab_description, labour.lab_intro_date, 
> labour.lab_term_date, labour.lab_term_id, labour.lab_comment FROM labour 
> WHERE ((labour.lab_id = 120) AND (labour.lab_term_date IS NULL)) LIMIT 1 
> OFFSET 0;
>
> 2.06ms
>
> SELECT  labour.lab_id, labour.lab_description, labour.lab_intro_date, 
> labour.lab_term_date, labour.lab_term_id, labour.lab_comment FROM labour 
> WHERE ((labour.lab_id = 128) AND (labour.lab_term_date IS NULL)) LIMIT 1 
> OFFSET 0;
>
> 2.02ms
>
> SELECT  labour.lab_id, labour.lab_description, labour.lab_intro_date, 
> labour.lab_term_date, labour.lab_term_id, labour.lab_comment FROM labour 
> WHERE ((labour.lab_id = 118) AND (labour.lab_term_date IS NULL)) LIMIT 1 
> OFFSET 0;
>
> 2.03ms
>
> SELECT  labour.lab_id, labour.lab_description, labour.lab_intro_date, 
> labour.lab_term_date, labour.lab_term_id, labour.lab_comment FROM labour 
> WHERE ((labour.lab_id = 33) AND (labour.lab_term_date IS NULL)) LIMIT 1 
> OFFSET 0;
>
> 2.03ms
>
> SELECT  labour.lab_id, labour.lab_description, labour.lab_intro_date, 
> labour.lab_term_date, labour.lab_term_id, labour.lab_comment FROM labour 
> WHERE ((labour.lab_id = 114) AND (labour.lab_

[web2py] web2py Requires gitpython module

2018-05-14 Thread Anthony
Are you running web2py from source or using the Windows binary version?

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