[web2py] Re: web2py -> py4web

2024-07-14 Thread Raul Monares
Hi Massimo
I have several web2py applications in production. Big systems that would be 
difficult to move to py4web as they are growing all the time. But we're 
using Python 3.8.

Also, GAE is not relevant to us

Web2py has been fantastic. 

On Sunday, July 14, 2024 at 2:11:23 AM UTC-6 Clemens wrote:

> Hello Massimo,
>
> I'm a vital web2py user with a 3 systems in production. I've moved to 
> python 3.7+ (currently 3.8) a long time ago.  I'm using postgres as 
> database, thus for me GAE would not be relevant.
>
> But I'm really interested in any support and security updates of web2py.
>
> I would like to migrate to py4web. The only but big obstacle is time. As 
> soon as I find the time I'm gonna move to py4web.
>
> Thanks a lot for web2py and your work!
>
> Best regards
> Clemens
>
>
> On Sunday, July 14, 2024 at 4:10:05 AM UTC+2 Massimo Di Pierro wrote:
>
>> Hello everybody,
>>
>> You may have noticed I am not very active on this mailing list. That is 
>> mostly because I have been concentrating my energy on py4web which I think 
>> is must more modern and faster than web2py.
>>
>> Once again I want to encourage you to move.
>> If you look at this page
>>
>>  https://py4web.com/#why
>>
>> You will find it to be very familiar:
>> - has an admin interface (called _dashboard)
>> - has an dbadmin interface
>> - same pyDAL
>> - same template language
>> - same helpers
>> - same session interface
>> - similar but better Form
>> - similar but better Grid (still evolving)
>> - different request object but compatible with bottlepy
>> - different auth logic but support for more Oauth2 services (github, 
>> okta, facebook, etc.)
>> - different but similar background scheduler
>>
>> Here are some instructions about how to move from web2py to py4web
>>
>> web2py currently works for python2.7 and python3.7+ but they are using a 
>> frozen version of pydal. This no longer works on Google App Engine. So how 
>> do we fix it?
>>
>> I am considering the following:
>> - freezing web2py for Python 2.7 and stopping support.
>> - continuing limited support of web2py for python3.7+ and specifically 
>> upgrade pydal for the lastest. 
>> - upgrade pydal so that it continues to work on Google App Engine for 
>> both web2py and py4web.
>>
>> My questions are: Is this worth it? Have people moved from python2.7 to 
>> 3.7+ already? Are people here interested in continuing to use web2py with 
>> GAE?
>>  
>>
>> Massimo
>>
>>
>>
>>

-- 
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/6794728c-4c38-4826-ad07-d7b9827d0585n%40googlegroups.com.


[web2py] Re: admin table query focus

2024-05-10 Thread Raul Monares
Excellent !!

On Tuesday, April 23, 2024 at 2:31:01 PM UTC-6 snide...@gmail.com wrote:

> I've long been bugged by going through the appadmin controller to do 
> database maintenance and not having the focus be anywhere useful.  I think 
> I even have a comment about that somewhere in the forum.
>
> I finally figured out a way to fix that ... the following change puts the 
> focus on the query box of the table admin form.  Line numbers are from the 
> 2.22.5 release, but should be close for other recent versions.
>
> File:  .../web2py/applications/myapp/*controllers/appadmin.py:*
> lines 226-230 before:
> form = FORM(TABLE(TR(T('Query:'), '', INPUT(_style='width:400px',
> _name='query', _value=request.vars.query or '', 
> _class='form-control',
> requires=IS_NOT_EMPTY(
> error_message=T('Cannot be empty', TR(T('Update:'),
> INPUT(_name='update_check', _type='checkbox',
>
> lines 226-231 now:
> form = FORM(TABLE(TR(T('Query:'), '', INPUT(_style='width:400px',
> _name='query', _value=request.vars.query or '', 
> _class='form-control',
> requires=IS_NOT_EMPTY(
> error_message=T('Cannot be empty')), 
> _autofocus="autofocus")),TR(T('Update:'),
>   
>   INPUT(_name='update_check', _type='checkbox',
> value=False), INPUT(_style='width:400px',
>
> Note that this is really one big line ... I didn't spend a lot time trying 
> to add escapes to unwrap and reformat the long worm.
>
> I find this little change really helps my work flow on the app where I use 
> appadmin the most.  You may, of course, prefer to add a task-specific 
> controller elsewhere in the app or in a script, but appadmin queries are 
> fairly flexible, and that's often where I figure out what the task-specific 
> details are.
>
> Dave S
> /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/3a0f6c25-7160-4f0d-b549-20026edd69cen%40googlegroups.com.


[web2py] Re: web2py 2.27.1 released

2023-11-18 Thread Raul Monares
Excellent !!!

On Thursday, November 16, 2023 at 1:10:43 AM UTC-7 Massimo Di Pierro wrote:

> web2py 2.27.1 was released
>
> - some linting and formatting
> - added support to Python 3.11
> - fixed regexen and classname
> - removed a circular dependency
>
>

-- 
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/0a15ca8d-d7b0-4805-9d14-3e6f29572923n%40googlegroups.com.


[web2py] Re: web2py 2.26.1 released

2023-10-29 Thread Raul Monares
Great news. I appreatiate your work on both platforms

On Sunday, October 29, 2023 at 3:13:31 PM UTC-6 Massimo Di Pierro wrote:

> Changelog:
> - adds support of python up to version 3.11
> - fixes a bug with serialization of headers introduced in version 2.25.1
> - improves handling of unstable db connections in the scheduler
>
> I remind you that py4web has been out for 5 years now as successor of 
> web2py.
> It has the same template language and dal as web2py but it is a lot faster.
> It has a better grid, form handling, and auth integrations.
>
> Massimo
>
>

-- 
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/22e4071c-f4e6-4b67-b63b-087db6fd2645n%40googlegroups.com.


[web2py] Re: web2py 2.24.1 released

2023-04-02 Thread Raul Monares
Excelent news. Thanks !!

On Thursday, March 23, 2023 at 5:43:34 AM UTC-6 xgp.l...@gmail.com wrote:

> Thank you Massimo!
>
> El jueves, 23 de marzo de 2023 a las 0:20:20 UTC-5, Massimo Di Pierro 
> escribió:
>
>> Hello everybody,
>>
>> web2py 2.24.1 has been released.
>>
>> Thanks to Leonel, Cem, and Mark for bug fixes including:
>> - handling corrupt disk cache
>> - broken application packaging
>> - compare function logic
>>
>>
>>

-- 
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/da2cdaf3-1e7c-4841-a03f-495bdfeeb265n%40googlegroups.com.


[web2py] Re: web2py 2.23.0 released

2022-12-29 Thread Raul Monares
Great news. Thanks a lot !!

On Thursday, December 29, 2022 at 3:15:56 AM UTC-7 Stephan wrote:

> Thank you!!
>
> Massimo Di Pierro schrieb am Dienstag, 27. Dezember 2022 um 08:26:00 UTC+1:
>
>> Hello Everybody,
>>
>> My apologies for not being as engaged in this group as I used to be.
>>
>> web2py 2.23.0 was released.
>>
>> It includes:
>> - DKIM support to emails
>> - More configuration options for 2-factor authentication
>> - Fixed an open redirect vulnerability
>> - Some bugs fixes.
>>
>> Thanks everybody who contributed, especially Leonel.
>>
>> As you noticed the pace of changes in web2py is very slow. Once again I 
>> recommend that you take a look at py4web, also based on pydal and the same 
>> template language and helpers as web2py. Yet it is much faster and designed 
>> from scratch to work with python 3.
>>
>> Massimo
>>
>

-- 
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/c7ea8756-2145-4620-8f61-ba2b5f5e9e8en%40googlegroups.com.


[web2py] Re: Should I run sessions2trash.py even if I use Redis for sessions and set an expiration time?

2022-08-16 Thread Raul Monares
Thanks for sharing

On Saturday, August 6, 2022 at 4:56:41 AM UTC-6 Lisandro wrote:

> I'll try to answer my own question, in case it helps someone else.
> Yes, you should run sessions2trash periodically, even if you're using 
> Redis and you're setting an expiration time for every session.
>
> As the documentation states: *"... when session_expiry is set [...] you 
> should ocassionally run sessions2trash.py just to clean the key holding the 
> set of all the sessions previously issued..."*
>
> In my deployment I have around 1000 applications running in one web2py 
> instance. All of them set session_expiry to 2 days. The load is very 
> stable: about 2 millon sessions in memory, using about 1gb of memory. 
> However, while the number of sessions stays stable in time, memory usage 
> increases slowly. I've found that running sessions2trash makes memory usage 
> to go down to 1gb. And yes, you have to run it once for every installed 
> app. I've inspected the source code of sessions2trash.py and I can't 
> realise what is it that it deletes (besides the expired sessions). 
>
> It would be nice to have a script that only takes care of cleaning "the 
> other stuff", so it doesn't take too much time to run. Consider that 
> sessions2trash.py iterates over all the stored sessions, and if you're 
> using Redis and you're setting an expiration time for every session, it 
> doesn't make sense to iterate over all the dataset just to clean "that 
> other stuff".
>
> Hope it helps someone :)
>
> El martes, 26 de julio de 2022 a la(s) 08:40:04 UTC-3, Lisandro escribió:
>
>> Hey there! 
>> I'm using Redis to store sessions. Every session has an expiration time 
>> of two days. Should I still run sessions2trash.py from time to time?
>> The answer is not clear to me. The documentation says:
>>
>>
>> *If session_expiry is not set, sessions will be handled as usual, you'd 
>> need to cleanup sessions as usual once a while.*
>> *However, when session_expiry is set will delete automatically sessions 
>> after n seconds (e.g. if set to 3600, session will expire exactly one hour 
>> later having been updated the last time), you should occasionally run 
>> sessions2trash.py just to clean the key holding the set of all the sessions 
>> previously issued.*
>>
>> If the answer is affirmative:
>>  - How frequently should I run sessions2trash.py? 
>>  - If my web2py instance runs several applications, lets say, a thousand 
>> apps, will I have to run sessions2trash.py a thousand times, one time for 
>> each app?
>>
>> Thanks in advance!
>> Warm regards,
>> Lisandro 
>>
>

-- 
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/747a055c-4285-4134-ad5a-e696936747f7n%40googlegroups.com.


[web2py] web2py.com down

2022-01-30 Thread Raul Monares
The site is down :(

-- 
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/9c157f12-f3ee-4b25-82d8-352057d94661n%40googlegroups.com.


[web2py] Re: string validation

2021-05-12 Thread Raul Monares
I found this code on the web

# Python code to find the URL from an input string
# Using the regular expression
import re

def Find(string):

# findall() has been used
# with valid conditions for urls in string
regex = 
r"(?i)\b((?:https?://|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'\".,<>?«»“”‘’]))"
url = re.findall(regex,string) 
return [x[0] for x in url]
# Driver Code
string = 'My Profile: 
https://auth.geeksforgeeks.org/user/Chinmoy%20Lenka/articles in the portal 
of http://www.geeksforgeeks.org/'
print("Urls: ", Find(string))


On Wednesday, May 12, 2021 at 1:22:01 AM UTC-6 Manuele wrote:

> Hi!
>
> I have a quite specific question... can anyone help me to implement a 
> validator that reject all text containing a URL inside?
>
> Some spammers are annoying me registering some fake account introducing 
> links in registration fields such like first name, last name... I hope 
> in this way to limit it. Adding Google reCaptcha v2 to the registration 
> forms didn't help.
>
> Thanks a lot
>
> Manuele
>
>

-- 
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/91925a1b-ed3e-46e8-9f75-b9d6949656c7n%40googlegroups.com.


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 Константин Комков <firean...@gmail.com 
> >
>
>> 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: Insert data in firebird database

2018-05-12 Thread Raul Monares
Take into account that the Firebird DAL adapter has a 64kb limit for 
inserting blobs. 

On Friday, April 27, 2018 at 4:27:48 AM UTC-6, Константин Комков wrote:
>
> Hello! I'm trying add data in my table.
> tables.py
> db_xml.define_table('xml_files',
> Field('F'),
> Field('I'), 
> Field('O'),
> Field('IS_IMPORTED'),
> Field('XML_FILE'),
> format='%(id)s %(F)s %(I)s %(O)s %(IS_IMPORTED)s %(XML_FILE)s',
> migrate=False)
> default.py
>
> db_xml.xml_files.insert(F='Castle', I='Rick' O='Middlename' IS_IMPORTED='0' 
> XML_FILE='something')
>
> DatabaseError: ('Error while preparing SQL statement:\n- SQLCODE: -104\n- 
> invalid request BLR at offset 51\n- generator GENID_XML_FILES is not 
> defined', -104, 335544343)
>
> (('Error while preparing SQL statement:\n- 
> SQLCODE: -104\n- invalid request BLR at offset 51\n- generator 
> GENID_XML_FILES is not defined', -104, 335544343))
>
>
> 
>
>
>

-- 
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: Insert data in firebird database

2018-04-28 Thread Raul Monares
If web2py didn't create the generator and trigger, you can do it manually 
with this DDL

CREATE GENERATOR GENID_XML_FILES;

SET TERM !! ;
CREATE TRIGGER XML_FILES_BI FOR XML_FILES
ACTIVE BEFORE INSERT POSITION 0
AS
DECLARE VARIABLE tmp DECIMAL(18,0);
BEGIN
  IF (NEW.ID IS NULL) THEN
NEW.ID = GEN_ID(GENID_XML_FILES, 1);
  ELSE
  BEGIN
tmp = GEN_ID(GENID_XML_FILES, 0);
if (tmp < new.ID) then
  tmp = GEN_ID(GENID_XML_FILES, new.ID-tmp);
  END
END!!
SET TERM ; !!


On Friday, April 27, 2018 at 4:27:48 AM UTC-6, Константин Комков wrote:
>
> Hello! I'm trying add data in my table.
> tables.py
> db_xml.define_table('xml_files',
> Field('F'),
> Field('I'), 
> Field('O'),
> Field('IS_IMPORTED'),
> Field('XML_FILE'),
> format='%(id)s %(F)s %(I)s %(O)s %(IS_IMPORTED)s %(XML_FILE)s',
> migrate=False)
> default.py
>
> db_xml.xml_files.insert(F='Castle', I='Rick' O='Middlename' IS_IMPORTED='0' 
> XML_FILE='something')
>
> DatabaseError: ('Error while preparing SQL statement:\n- SQLCODE: -104\n- 
> invalid request BLR at offset 51\n- generator GENID_XML_FILES is not 
> defined', -104, 335544343)
>
> (('Error while preparing SQL statement:\n- 
> SQLCODE: -104\n- invalid request BLR at offset 51\n- generator 
> GENID_XML_FILES is not defined', -104, 335544343))
>
>
> 
>
>
>

-- 
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: ImportError with packages in site-packages.

2018-04-12 Thread Raul Monares
I have same problem. From command line the modules are imported correctly. 
Using python web2py.py also loads the modules. But nginx + uwsgi doesn't 
work. 

On Thursday, March 29, 2018 at 6:57:47 PM UTC-6, AlighaThor wrote:
>
> And yes...I restarted the server several times without any effect. The 
> same ImportError excepction.
>

-- 
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] embed a pdf

2018-02-26 Thread Raul Monares


I have this code that shows a PDF stored in a field "archivopdf" of table 
"facturas". It is embedded in an iframe

request.args(0) has the primary key


def facturasprevista():
facturas=db.facturas[request.args(0)]
response.headers['Content-Type']='application/pdf'
return facturas.archivopdf


On Monday, February 26, 2018 at 12:35:14 AM UTC-7, mweissen wrote:
>
> Did not solve the problem. The pdf data is stored in the table (it can be 
> retrieved manually).
> The question is how to show the pdf in an iframe or an embed field.
>
> 2018-02-26 8:00 GMT+01:00 Marco Mansilla  >:
>
>> Take a look to this
>>
>> https://groups.google.com/forum/m/#!topic/web2py/qgmh5C0XXkY
>>
>> El 26 feb. 2018 03:36, "Martin Weissenboeck" > > escribió:
>>
>>> Sorry, it does not work.
>>> The same results with or without "default"
>>>
>>> 2018-02-26 4:20 GMT+01:00 Marco Mansilla >> >:
>>>
 This 

 download = URL("download", args=p.pdf)

 Should be

 download = URL("default", "download", args=p.pdf)

 You can do that on the view. But the change on the controller should do.

 El 25 feb. 2018 15:54, "Martin Weissenboeck"  escribió:

 What I want to do:

 I store a pdf-file in a database table.
 Then I want to show this file.

 The model:

 db.define_table("pdfs",
 Field("pdf", "upload", uploadfield="pdfdata"),
 Field("description", "text"),
 Field("pdfdata","blob")
 )



 The controller:

 def showpdf():
 id = int(request.args[0])
 p=db.pdfs(id)
 download = URL("download", args=p.pdf)
 return dict(p=p, download=download)

 

 The view:

 {{extend 'layout.html'}}
 Description: {{=p.description}}
 
 
 
 Cannot display embed
 
 
 
 
 
 Cannot display iframe
 
 



 ​The  section show an error "Error on loading pdf".

 The  section shows an empty iframe and opens the Adobe Acrobat 
 Reader with the required pdf.

 Any ideas?

 Regards Martin

 -- 
 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+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+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+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: Auto Complete Forms

2017-06-20 Thread Raul Monares
Take a look at the AJAX function

http://www.web2py.com/books/default/chapter/29/11/jquery-and-ajax#The-ajax-function

You could assing to trigger it on blur



On Tuesday, June 20, 2017 at 10:01:06 AM UTC-6, Rodrigo Corvalan wrote:
>
>
> Dear I am new to web2py I would like to know if it is possible to auto 
> complete a form from an input.
> This would be so. I would like to load the product code and autocomplete 
> the rest of the form through a query.
>
>
> 
> This is possible?.
>
> Muchisismas gracias, y disculpen mi mal ingles.
>

-- 
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: Validation error, field:email while trying to conect to SQL Express

2017-02-21 Thread Raul Monares
I changed from SQL Server Express 2016 to SQL Server Express 2012 and had 
no problems.

On Saturday, February 18, 2017 at 12:00:16 PM UTC-7, Leonel Câmara wrote:
>
> The error is not in the connection string or with the migrate settings.
>
> I would try this in the command line to see what the problem is:
>
> cd web2pydirectoryhere
> python web2py.py -S nameofyourapplication -M
> IS_NOT_IN_DB(db, 'auth_user.email')('em...@youknowisnotthere.com 
> ')
>
>
> If everything is working fine then it should return:
> ('em...@youknowisnotthere.com ', None)
>
> If it doesn't, then show us the full traceback here.
>
>
>

-- 
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: Validation error, field:email while trying to conect to SQL Express

2017-02-17 Thread Raul Monares
The database is new and completely empty. migrate = true is working because 
the auth tables are created automatically.
I've used in the past Mysql, Postgresql, Firebird, DB/2 and this has never 
happened. It's as if the validator is not recognizing the existing table 
auth_user.


On Friday, February 17, 2017 at 2:16:24 PM UTC-7, Dave S wrote:
>
>
>
> On Friday, February 17, 2017 at 12:36:01 PM UTC-8, Raul Monares wrote:
>>
>> I'm trying to use SQL Express for a project. When I try to sign up using 
>> the demo app, I get this error
>>  Validation error, field:email > 0x049114E0>
>> All auth tables are created in the database. I tried migrate = false, 
>> migrate = true. Same result.
>>
>> The connection string is mssql4://tarkus:rushrush@localhost/DNC_TRAINING. 
>> I'm using IIS7, SQL Server Express 13.0.4001.0, db_codec = 
>> 'SQL_Latin1_General_CP1_CI_AS'
>>
>
> Validation errors don't usually involve the connection string.  In this 
> case, you either have an existing entry with the same email field as you're 
> trying to use, or perhaps you haven't supplied a value for this field and 
> the validator is considering the NULL to match a NULL entry (not all the 
> validators would do that, though).
>
> Is this a demo database, or a database you've created?  Can you use a 
> non-web2py tool to connect to the database and examine what's in the 
> fields?  Such as a console app or a portal site?
>
> Dave
> /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] Validation error, field:email while trying to conect to SQL Express

2017-02-17 Thread Raul Monares
I'm trying to use SQL Express for a project. When I try to sign up using 
the demo app, I get this error
 Validation error, field:email 
All auth tables are created in the database. I tried migrate = false, 
migrate = true. Same result.

The connection string is mssql4://tarkus:rushrush@localhost/DNC_TRAINING. 
I'm using IIS7, SQL Server Express 13.0.4001.0, db_codec = 
'SQL_Latin1_General_CP1_CI_AS'

-- 
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: Empty strings stored as null in database

2016-04-14 Thread Raul Monares
I just tested 2.14.5 and the solution is working. Great job !!

On Thursday, April 14, 2016 at 7:46:57 AM UTC-6, Richard wrote:
>
> Let test then!!
>
> On Thu, Apr 14, 2016 at 9:15 AM, Niphlod  
> wrote:
>
>> I hear you and I'm happy (or not, not sure) to not being alone ranting 
>> about web2py's code quality and lack of tests. this was a serious bug that 
>> should have had the effect of retiring web2py's release until it was fixed 
>> (or at least loudly advertised).
>>
>>
>> On Thursday, April 14, 2016 at 5:08:24 AM UTC+2, Leonel Câmara wrote:
>>>
>>> Ok I've fixed it:
>>> https://github.com/web2py/web2py/pull/1294
>>>
>>> And now I hate you guys with a tremendous passion. It took me a huge 
>>> amount of time for a fix that ended up being a oneliner.
>>>
>>> html.py is horrible, Cthulhu level horrible, it couldn't be harder to 
>>> follow its execution flow if it had goto statements and afterwards you 
>>> minified it.
>>>
>>> To understand the bug first you need to look at the _validate method of 
>>> the INPUT helper.
>>>
>>> Then you also need sqlhtml.py and see that it sets some default 
>>> validators
>>>
>>> Then look dal.py where those defaults are defined (no it's not inside 
>>> the pydal package)
>>>
>>> Then you need to really understand the IS_EMPTY_OR validator which 
>>> thankfully I do because I have been making tests for validators.
>>>
>>> Someone please contribute to the book how important the null argument is 
>>> to IS_EMPTY_OR because otherwise you're getting a None which will be a NULL 
>>> in the database since IS_EMPTY_OR doesn't know what kind of field it's 
>>> dealing with.
>>>
>>>
>>>
>>>
>>> -- 
>> 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: web2py 2.14.4 is OUT

2016-04-13 Thread Raul Monares
I just did some tests. It still saves empty strings as null when using 
SQLFORM or CRUD and the string field has default=''. But when using 
db.table.insert the empty string is stored.

On Tuesday, April 12, 2016 at 3:29:26 PM UTC-6, Massimo Di Pierro wrote:
>
> web2py 2.14.4 is out.
>
> It fixes some a problem with CAS and some style issues with examples.
> It also includes (and passes) a lot of new tests. 
>
> Thanks to Richard Vezina, Simone and Leonel for doing most of the work in 
> this release.
>
> Massimo
>

-- 
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: Empty strings stored as null in database

2016-04-05 Thread Raul Monares
I just did a test using sqlite. It also inserted a column with a null value

Here is a sample code

db.define_table('actividades',

Field('descripcion','string',length=100,label='Descripcion',default='')
)


On Monday, April 4, 2016 at 2:48:10 PM UTC-6, Anthony wrote:
>
> Also, can you check whether the same problem occurs with SQLite?
>
> On Monday, April 4, 2016 at 4:47:33 PM UTC-4, Anthony wrote:
>>
>> Can you show some code? I think Firebird uses the same insert code as the 
>> base adapter, and that appears to correctly insert an empty string.
>>
>> Anthony
>>
>> On Monday, April 4, 2016 at 3:54:10 PM UTC-4, Raul Monares wrote:
>>>
>>> It appears that default='' in the field constructor is being ignored. 
>>> When I later do an update to the same field with an empty string, it is 
>>> stored correctly in the database.
>>>
>>>
>>>
>>> On Friday, April 1, 2016 at 12:41:12 PM UTC-6, Raul Monares wrote:
>>>>
>>>> I'm using Firebird 2.5.4 on Freebsd 10.2
>>>>
>>>>
>>>> On Friday, April 1, 2016 at 12:01:00 PM UTC-6, Dave S wrote:
>>>>>
>>>>> On Thursday, March 31, 2016 at 7:39:23 PM UTC-7, Raul Monares wrote:
>>>>>>
>>>>>> Hello
>>>>>> I just updated to version 2.14.3 and noticed that empty strings are 
>>>>>> being stored as null in database field. This didn't happened in 2.13.4.
>>>>>>
>>>>>> Is this the intended behavior ?
>>>>>>
>>>>>
>>>>> Which database engine are you using?
>>>>>
>>>>> /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: Empty strings stored as null in database

2016-04-04 Thread Raul Monares
It appears that default='' in the field constructor is being ignored. When 
I later do an update to the same field with an empty string, it is stored 
correctly in the database.



On Friday, April 1, 2016 at 12:41:12 PM UTC-6, Raul Monares wrote:
>
> I'm using Firebird 2.5.4 on Freebsd 10.2
>
>
> On Friday, April 1, 2016 at 12:01:00 PM UTC-6, Dave S wrote:
>>
>> On Thursday, March 31, 2016 at 7:39:23 PM UTC-7, Raul Monares wrote:
>>>
>>> Hello
>>> I just updated to version 2.14.3 and noticed that empty strings are 
>>> being stored as null in database field. This didn't happened in 2.13.4.
>>>
>>> Is this the intended behavior ?
>>>
>>
>> Which database engine are you using?
>>
>> /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: Empty strings stored as null in database

2016-04-01 Thread Raul Monares
I'm using Firebird 2.5.4 on Freebsd 10.2


On Friday, April 1, 2016 at 12:01:00 PM UTC-6, Dave S wrote:
>
> On Thursday, March 31, 2016 at 7:39:23 PM UTC-7, Raul Monares wrote:
>>
>> Hello
>> I just updated to version 2.14.3 and noticed that empty strings are being 
>> stored as null in database field. This didn't happened in 2.13.4.
>>
>> Is this the intended behavior ?
>>
>
> Which database engine are you using?
>
> /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] Empty strings stored as null in database

2016-03-31 Thread Raul Monares
Hello
I just updated to version 2.14.3 and noticed that empty strings are being 
stored as null in database field. This didn't happened in 2.13.4.

Is this the intended behavior ?

-- 
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 2.13.1 is OUT

2015-12-19 Thread Raul Monares
Excellent !!

On Thursday, December 17, 2015 at 11:31:38 PM UTC-7, Massimo Di Pierro 
wrote:
>
> CHANGELOG
>
> ## 2.13.1
>
>
> - fixed oauth2 renew token, thanks dokime7
>
> - fixed add_membership, del_membership, add_membership IntegrityError 
> (when auth.enable_record_versioning)
>
> - allow passing unicode to template render
>
> - allow IS_NOT_IN_DB to work with custom primarykey, thanks timmyborg
>
> - allow HttpOnly cookies
>
> - added fabfile.py
>
> - french pluralizaiton rules, thanks Mathieu Clabaut
>
> - fixed bug in redirect to cas service, thanks Fernando González
>
> - allow deploying to pythonanywhere from the web2py admin that you're 
> running locally, thanks Leonel
>
> - better tests
>
> - many more bug fixes
>

-- 
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: BLOB fields in MSSQL Server

2015-02-10 Thread Raul Monares
I had a similar problem with truncated info in blob fields. This line fixed 
for me:

db.executesql('SET TEXTSIZE 2147483647')

right after the DAL connection

On Tuesday, February 10, 2015 at 8:24:19 AM UTC-7, Jose wrote:

 Hello everyone

 I have the following:

 Web2py on Freebsd.
 Database: SQLServer 2008

 Connection: web2py - pyodbc - UnixODBC - FreeTDS - SQLServer

 I'm trying to store some uploaded files into a blob field, instead than on 
 the file system.

 The table was created by the administrator SQLServer

 CREATE TABLE [dbo].[DocumentosBlob](
 [Id] [numeric](18, 0) IDENTITY(1,1) NOT NULL,
 [Nombre] [varchar](50) NULL,
 [Archivo] [varchar](512) NULL,
 [Archivo_Blob] [text] NULL,
 [Archivo_Blob2] [image] NULL
 ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]




 The adapter defines SQLServer blob fields as IMAGE ('blob': 'IMAGE',). 
 Then use for testing the Archivo_Blob2 field is set to IMAGE
 In my model I have:

 tb_documentos_blob = db.define_table('DocumentosBlob',
 Field('nombre', length=50),
 Field('archivo', 'upload', uploadfield='archivo_blob2'),
 Field('archivo_blob2', 'blob', writable=False, readable=False),
 migrate=False,
 )



 But it happens that when trying to upload a file upload the following 
 error occurs:

 *DataError: ('22018', '[22018] [FreeTDS][SQL Server]Operand type clash: 
 text is incompatible with image (206) (SQLExecDirectW)')*

 Then I changed the field, using one type TEXT (Archivo_Blob). The model 
 will now be:

 tb_documentos_blob = db.define_table('DocumentosBlob',
 Field('nombre', length=50),
 Field('archivo', 'upload', uploadfield='archivo_blob'),
 Field('archivo_blob', 'blob', writable=False, readable=False),
 migrate=False,
 )



 Now it works, I can upload and download files, but only with very small 
 files. Tested with 20KB. With one of 250KB upload it, but at download it is 
 broken. I imagine that was truncated when stored in the database.

 How I can fix this?

 Best Regards
 José



-- 
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: FDB (firebird) adapter can't store blobs greater than 64k

2013-11-28 Thread Raul Monares
I think the solution is to use streamed blobs (from FDB documentation):

# Insertion:cur.execute(insert into blob_test values (?), 
(StringIO('abcdef'),))

# Retrieval using the file-like methods of BlobReader:

cur.execute(select a from blob_test)cur.set_stream_blob('A') # Note the 
capital letter
readerA = cur.fetchone()[0]

value = readerA.read()


On Tuesday, November 26, 2013 2:16:12 PM UTC-7, Jose wrote:

 Hi,

 I was watching this. I have a little dizzy with the code. Now I can not 
 prove. The solution is to redefine represent_exceptions in 
 FireBirdAdapter? It is that way?

 José


-- 
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/groups/opt_out.


[web2py] Re: web2py 2.6.3 is OUT (security update)

2013-09-15 Thread Raul Monares
Thanks Massimo

On Sunday, September 15, 2013 11:13:21 AM UTC-6, Massimo Di Pierro wrote:

 This is very similar to 2.6.1 but fixes some problem with a missing admin 
 file (also fixed in 2.6.2) and a potential DoS security issue.

 The issue was first discovered in Django 
 https://www.djangoproject.com/weblog/2013/sep/15/security/ 
 We thank them for discovering and reporting it.

 In web2py 2.5.x and earlier we suffer from the same problem. This is 
 because while the default password validator checks for length, the check 
 is performed after hashing, before inserting the hashed password in 
 database. In 2.6.1/2 we have a different implementation of the hashing 
 algorithm and we do not know how severe the problem is.

 In any case 2.6.3 fixes the problem by truncating the password to 1024 
 chars when passed to the CRYPT validator.

 You should upgrade.

 Massimo


-- 
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/groups/opt_out.


[web2py] Re: FDB (firebird) adapter can't store blobs greater than 64k

2013-07-02 Thread Raul Monares
According to the FDB documentation, an insert or update has to pass 
parameters using an file-like object, like this:

cur.execute(insert into blob_test values (?), (StringIO('abcdef'),))

It appears that currently the DAL passes the parameter as a very long 
string, and Firebird has a 64k limit on the size of the parameters.



On Tuesday, July 2, 2013 12:26:17 AM UTC-6, Niphlod wrote:

 Bummer, than it's probably a problem within the driver itself... need to 
 debug it or wait that someone picks it and see what's going on.

 Il giorno martedì 2 luglio 2013 00:55:43 UTC+2, Raul Monares ha scritto:

 I'm using python fdb 1.4. The field is defined as blob sub_type 0, 
 because I'm storing PDF's



 On Monday, July 1, 2013 1:23:42 PM UTC-6, Niphlod wrote:

 what driver are you using ? DAL creates 'blob' fields as BLOB SUB_TYPE 
 1 can you please check that the field is created indeed as BLOB 
 SUB_TYPE 1 watching your databases/sql.log file ?

 This is an excerpt from firebird documentation

 *Sub-type is 1.** *

 *This blob field sub-type is designed for the storage and manipulation 
 of text. Typically, this is free-form memo or notes data. Typically you 
 would use this blob field sub-type is for storing large amounts of text 
 data. This is more convenient that a large VARCHAR because, unlike a 
 VARCHAR, there is no 32K limit.*

  

 On Monday, July 1, 2013 7:21:03 PM UTC+2, Raul Monares wrote:

 When trying to store a value greater than 64k in a Blob Field, I get 
 this error:

 class 'fdb.fbcore.DatabaseError' ('Error while preparing SQL 
 statement:\n- SQLCODE: -104\n- Dynamic SQL Error\n- SQL error code = 
 -104\n- Unexpected end of command - line 1, column 25', -104, 335544569)
 But with blobs smaller than 64k works fine.



-- 

--- 
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/groups/opt_out.




[web2py] FDB (firebird) adapter can't store blobs greater than 64k

2013-07-01 Thread Raul Monares
When trying to store a value greater than 64k in a Blob Field, I get this 
error:

class 'fdb.fbcore.DatabaseError' ('Error while preparing SQL 
statement:\n- SQLCODE: -104\n- Dynamic SQL Error\n- SQL error code = 
-104\n- Unexpected end of command - line 1, column 25', -104, 335544569)
But with blobs smaller than 64k works fine.

-- 

--- 
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/groups/opt_out.




[web2py] Re: FDB (firebird) adapter can't store blobs greater than 64k

2013-07-01 Thread Raul Monares
I'm using python fdb 1.4. The field is defined as blob sub_type 0, because 
I'm storing PDF's



On Monday, July 1, 2013 1:23:42 PM UTC-6, Niphlod wrote:

 what driver are you using ? DAL creates 'blob' fields as BLOB SUB_TYPE 
 1 can you please check that the field is created indeed as BLOB 
 SUB_TYPE 1 watching your databases/sql.log file ?

 This is an excerpt from firebird documentation

 *Sub-type is 1.** *

 *This blob field sub-type is designed for the storage and manipulation of 
 text. Typically, this is free-form memo or notes data. Typically you would 
 use this blob field sub-type is for storing large amounts of text data. 
 This is more convenient that a large VARCHAR because, unlike a VARCHAR, 
 there is no 32K limit.*

  

 On Monday, July 1, 2013 7:21:03 PM UTC+2, Raul Monares wrote:

 When trying to store a value greater than 64k in a Blob Field, I get this 
 error:

 class 'fdb.fbcore.DatabaseError' ('Error while preparing SQL 
 statement:\n- SQLCODE: -104\n- Dynamic SQL Error\n- SQL error code = 
 -104\n- Unexpected end of command - line 1, column 25', -104, 335544569)
 But with blobs smaller than 64k works fine.



-- 

--- 
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/groups/opt_out.




[web2py] Problem with legacy db and primarykey

2013-03-22 Thread Raul Monares
I have a MSSQL database with a 4 column primary key:

dbcomercial.define_table('libros',
 Field('bloque',writable=False),
 Field('grupo',writable=False),
 Field('sector',writable=False),
 Field('libro',writable=False),
 Field('estatus'),
 Field('id_movil'),
 primarykey=['bloque','grupo','sector','libro'],
 migrate=False
 )

This gives me an error: 'Table' object has no attribute '_id'. 
If I only specity on column in primarykey, I get no error, but can't do any 
updates.
Using w2p 2.4.5

-- 

--- 
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/groups/opt_out.