[web2py] Update bug in Oracle

2012-09-25 Thread SergeyPo
Update operation in Oracle gives ORA-12899 error if update value exceeds length of a string field (VARCHAR2 type in Oracle). This issue is correctly processed in INSERT statement, something like if db.type == 'oracle' and field.type == 'string': value = value[:field.length] Please add same code

[web2py] Re: Error in SQLTABLE in pymysql

2011-05-19 Thread SergeyPo
Maybe on Linux it works better but for me the worst thing is memory leak. Python can not handle more than 1 Gig of RAM, and my process reaches this limit after several hours of processing. Speed loss is also very apparent. On 18 май, 22:48, Vasile Ermicioi wrote: > I also use dal (outside web2py)

[web2py] How to build DAL query with JOIN

2011-05-19 Thread SergeyPo
Please help me to build DAL expression to create this query: select * from addresses t1 join (select id from addresses order by address) t2 on t1.id = t2.id limit %d offset %d FYI, this query does the same as 'select * from addresses order by address limit offset' but works 10x faster (simple que

[web2py] Re: Error in SQLTABLE in pymysql

2011-05-18 Thread SergeyPo
Vasile, I am using Python 2.5 on Windows XP, MySQL mysql Ver 14.14 Distrib 5.1.32, for Win32 (ia32) InnoDB engine, UTF-8 encoding I have large database with lots of data, hard to reproduce here. Application works fine on web2py version 1.86.2 and works with many small errors in web2py 1.95, abou

[web2py] Re: Error in SQLTABLE in pymysql

2011-05-16 Thread SergeyPo
. Best regards, Sergey Podlesny On 16 май, 15:00, SergeyPo wrote: > I get the following error when call SQL table, when I have reference > fields in my data table. > E.g.: > > db.define_table('alarms', >     SQLField('function_name', 'string', le

[web2py] Error in SQLTABLE in pymysql

2011-05-16 Thread SergeyPo
I get the following error when call SQL table, when I have reference fields in my data table. E.g.: db.define_table('alarms', SQLField('function_name', 'string', length=64), SQLField('created_at', 'datetime', default=datetime.datetime.now()), SQLField('header', db.headers), SQLFiel

[web2py] Am I the only one whose webadmin does not work?

2011-04-23 Thread SergeyPo
Python 2.5, MySQL 5.1, OS Windows XP, many different PC's tried both source code version and Windows version of web2py, 1.94.6; same thing on Debian with packed Linux installation... I am experienced web2py user, until this week used version 1.82 all the time and this Friday updgraded... I am stuc

[web2py] Redirect & response.flash

2011-02-25 Thread SergeyPo
Hello everyone! I want to do something like: def selector(): try: x = db.headers[request.vars.ID] if x is None: response.flash = T('ID incorrect') redirect(URL(r=request, f='index', args=(request.args[1]))) except: response.flash = T('ID inc

[web2py] Re: TextWidget maximum

2010-11-01 Thread SergeyPo
you already have a > validator that is limiting the size) > > On Oct 28, 7:11 am, SergeyPo wrote: > > > I need to paste large texts into a db table field using appadmin. > > Table field is defined as 'text' and in MySQL is mapped to 'longtext'. > > L

[web2py] TextWidget maximum

2010-10-28 Thread SergeyPo
I need to paste large texts into a db table field using appadmin. Table field is defined as 'text' and in MySQL is mapped to 'longtext'. Longtext capacity is 4GB or so... I need to paste approx. 1 Mb of text into the field. When I do it in web2py appadmin I get an error "enter from 0 to 65536 char

[web2py] Auth bug when registration requires approval

2010-04-20 Thread SergeyPo
In gluon/tools.py function register() starting from line 1246 must read: elif self.settings.registration_requires_approval: table_user[form.vars.id] = dict(registration_key='pending') Currently it is: elif self.settings.registration_requires_approval: user[form.vars.id] = dict(registrati

[web2py] OLAP using GAE

2010-04-13 Thread SergeyPo
Hi everybody, is it possible in DAL/GAE to aggregate values by several criteri? E.g. SELECT SUM(x) where z <= 100 and z > 0 and y <= 1000 and y >= 200; I have done a simple OLAP engine using 'multidimensional hierarchical clustering' approach, it does not need joins and works pretty fast in MySQL

[web2py] Re: googling web2py

2010-03-28 Thread SergeyPo
107000 from Russia 107000 from Finland same number after clearing cache. On Mar 28, 6:04 am, "mr.freeze" wrote: > I was getting 108k in Texas but it jumped to 607k after clearing the > browser cache. > > On Mar 27, 9:55 pm, mdipierro wrote: > > > > > this is odd. When I do > > >http://www.googl

[web2py] Re: Limitby not working with Oracle with joins

2010-03-03 Thread SergeyPo
s <<>> FROM %s%s%s) w_tmp WHERE ROWNUM<=%i) %s %s %s;' % (sql_s, sql_f, sql_f, sql_t, sql_w, sql_o, lmax, sql_t, sql_w_row, sql_o) leaving outer select with only the fields requested by SQLSet. Hope this helps, Sergey On Mar 1, 5:22 pm, SergeyPo wrote: > Limitby clause works w

[web2py] Re: Limitby not working with Oracle with joins

2010-03-01 Thread SergeyPo
anyway using a trick (three > nested select as suggested by the oracle docs) but the trick breaks > down with joins. > > On Feb 27, 11:50 am, SergeyPo wrote: > > > If you remove limitby it works. I reported this error about 6 months > > ago, tried many workarounds and th

[web2py] Re: Oracle datetime formatter

2010-03-01 Thread SergeyPo
Disregard previous msg. Problem is in conflict with 'represent' attribute. On 1 мар, 17:04, SergeyPo wrote: > Somehow when it calls formatter in line 2006 of validators.py, it uses > IS EMPTY OR validator, passes empty string there and tries to call > strftime for this

[web2py] Re: Oracle datetime formatter

2010-03-01 Thread SergeyPo
Somehow when it calls formatter in line 2006 of validators.py, it uses IS EMPTY OR validator, passes empty string there and tries to call strftime for this string. URGENT On 1 мар, 16:43, SergeyPo wrote: > I have the following definition in models: > > SQLField('created

[web2py] Oracle datetime formatter

2010-03-01 Thread SergeyPo
I have the following definition in models: SQLField('createdat', 'datetime', default=datetime.datetime.now()) It automatically timestamps record when it's created. Used to work well with oracle under web2py version 1.65.1 Now it stopped working, error is validators.py line 2006. Str object has n

[web2py] Re: Limitby not working with Oracle with joins

2010-02-27 Thread SergeyPo
imb here. > > Have you tried the query where it selects all columns instead of just > name and komment? > > -Thadeus > > 2010/2/27 SergeyPo : > > > > > SELECT headers1.name, alarms1.komment FROM (SELECT w_tmp.*, ROWNUM > > w_row FROM (SELECT headers1.name

[web2py] Re: Limitby not working with Oracle with joins

2010-02-27 Thread SergeyPo
rgs) DatabaseError: ORA-00904: "HEADERS1"."ID": invalid identifier On 26 фев, 21:22, Thadeus Burgess wrote: > please print the output of > > db(db.headers.id == db.alarms.header)._select(db.header.name, > db.alarms.komment, limitby=(0,5)) > > -Thadeus > &g

[web2py] Limitby not working with Oracle with joins

2010-02-26 Thread SergeyPo
Limitby clause still is not working with Oracle backend when used in queries that have any kind of join, left or inner. db.define_table('headers', SQLField('name', 'string') ) db.define_table('alarms', SQLField('header', db.headers), SQLField('komment', 'string') ) data = db(db.heade

[web2py] CAS

2010-02-09 Thread SergeyPo
I am evaluating web2py CAS appliance for the following application: central authentication and moneykeeping for many auctions. CAS should not only validate users for many auction sites but also store user's payments, balance, respond to requests (soap/rpc) on balance available, blocking amounts etc

[web2py:36849] Re: web2py on windows mobile?

2009-12-08 Thread SergeyPo
Sorry guys I pressed 'Report as spam' unintentionally! Please restore if possible. On Dec 8, 9:28 pm, mdipierro wrote: > I think the problem is that it is running from the python.exe folder > and not the web2py folder therefore it is not finding the libraries. > As a test. try edit web2py.py and

[web2py:36848] Re: Cron and Windows service

2009-12-08 Thread SergeyPo
; > still work? > > > > > > ~Brian > > > > > > On Dec 4, 9:52 am, mdipierro wrote: > > > > > > > There is a logical problem. the web server andcronare two processes > > > > > > and therefore they should be threated as two different ser

[web2py:36667] Re: Cron and Windows service

2009-12-06 Thread SergeyPo
For those who is interested, I downloaded curl for windows, wrote bat file 'curl.exe http://.../appname/controllername/actioname' and put it into windows scheduler. Web2py Cron service would be much more elegant. On Dec 4, 11:52 pm, SergeyPo wrote: > What is the best way to run co

[web2py:36537] Re: Cron and Windows service

2009-12-04 Thread SergeyPo
27;d rather do the cleanup before adding cron to win > service. > > Massimo > > On Dec 4, 4:32 am, SergeyPo wrote: > > > > > Hello, > > > I am having problem with cron. My crontable: > > > */5   *   *   *   *  root *default/getcaptypes > > > C

[web2py:36496] Cron and Windows service

2009-12-04 Thread SergeyPo
Hello, I am having problem with cron. My crontable: */5 * * * * root *default/getcaptypes Controller method 'default/getcaptypes' works fine when you call it directly. It works fine when called by cron when web2py is running as console. But it is not working when I start web2py as windo

[web2py:36330] Re: Ver 1.72.3 error in DAL? - MySQL table creation

2009-12-01 Thread SergeyPo
Dec 1, 2:08 pm, SergeyPo wrote: > > > > > Works under SQLite, but under MySQL table creation script generates > > the following sql: 'VARCHAR(16),\n\tcms_url VARCHAR(255),\n\tagency > > VARCHAR(32),\n\tuser VARCHAR(32),\n\tpas' - notice \n\t ! > > &

[web2py:36292] Ver 1.72.3 error in DAL? - MySQL table creation

2009-12-01 Thread SergeyPo
Works under SQLite, but under MySQL table creation script generates the following sql: 'VARCHAR(16),\n\tcms_url VARCHAR(255),\n\tagency VARCHAR(32),\n\tuser VARCHAR(32),\n\tpas' - notice \n\t ! Error traceback Traceback (most recent call last): File "C:\web2py\gluon\restricted.py", line 184,

[web2py:35168] ORA-01795: maximum number of expressions in a list is 1000

2009-11-12 Thread SergeyPo
Here is a possibility to make DAL a bit more transparent for those who use Oracle: when we use statements like: db(db.tablename.fieldname.belongs(the_list)).update(x=y) Oracle (unlike its open-source counterparts) fires an error coded ORA-01795 if length of 'the_list' exceeds 1000. There is no w

[web2py:33395] Re: Creating A Button in Web2Py

2009-10-22 Thread SergeyPo
May I share a helper function borrowed from RoR, that renders a button which is inline by default (meaning you can put it anywhere on web page just like a link, no line feed will happen) but you can set any style. Put it somewhere to models directory. Call it from your template code as e.g. {{=BUT

[web2py:33394] Re: Sessions lost when several servers running on diff ports

2009-10-22 Thread SergeyPo
Yes I was running two different applications, and that's what wondered me - why different apps (actually two different python web2py processes) affected each other. I still prefer to keep things simple and avoid various configuration files but do you agree, this is completely normal approach if I

[web2py:33183] Re: Sessions lost when several servers running on diff ports

2009-10-19 Thread SergeyPo
like this example... > > I think this could have to take into consideration. ¿or not? > > > Alex F > > > El 19/10/2009 16:32, Wes James escribió: > > > > On Mon, Oct 19, 2009 at 8:26 AM, SergeyPo  wrote: > > > >> Run two different web2py applications

[web2py:33135] Sessions lost when several servers running on diff ports

2009-10-19 Thread SergeyPo
Run two different web2py applications on same machine using two different ports (127.0.0.1:8000 and 127.0.0.1:8002). Open two browser windows for two apps (two tabs in Safari). Log in 1st application admin in 1st window. Log in 2nd app admin in 2nd window. Try to do smth in 1st window - it will as

[web2py:32733] Re: Oracle problem

2009-10-12 Thread SergeyPo
Without this clause the query does not work at all. In shown case it works in mysql and sqlite. On Oct 12, 6:11 pm, mdipierro wrote: > I think there is something wrong with the query: > > groupby=db.carts.ALL > > is not allowed. > > Massimo > > On Oct 12, 8:45 am, Ser

[web2py:32726] Re: Oracle problem

2009-10-12 Thread SergeyPo
Forgot to write that the code works in mysql and sqlite. On Oct 12, 5:45 pm, SergeyPo wrote: > The following statement gives strange error with Oracle. This has > something to do with oracle_fix in gluon/sql.py > > many_to_many = (db.c_h.cart_id==db.carts.id) > db(db.car

[web2py:32722] Oracle problem

2009-10-12 Thread SergeyPo
The following statement gives strange error with Oracle. This has something to do with oracle_fix in gluon/sql.py many_to_many = (db.c_h.cart_id==db.carts.id) db(db.carts.id>0).select(db.carts.ALL, db.c_h.cart_id.count(), left=db.c_h.on(many_to_many),

[web2py:29669] Re: Comma creates an invalid request?

2009-08-30 Thread SergeyPo
Yes, in my application comma creates "invalid request' error too. I had to write a special javascript routine to ensure that there is no commas in requests (they are produced by flot library when you drag an area in the chart). I recommend to use /geocoder/index/london/ontario and retrieve values

[web2py:29374] Re: Storing SQLFORM in a session error

2009-08-26 Thread SergeyPo
Session can store only basic Python data types like strings, integers, floats. It can not store custom class data (SQLFORM). You can serialize SQL FORM object with pickle and store a resulting string in the session, and then use pickle.loads(string) do deserialize the object. No sure it is more ec

[web2py:26109] Re: DAL remote control

2009-07-10 Thread SergeyPo
I understand that Rb does something like I am doing: uses web2py with SQLite for standalone mode; without a server. At least this feature initially convinced me to try web2py. This make a very appealing proposition: use simple, easy to use tools (python + html) to develop a cross-platform applicat

[web2py:26033] Re: Minus in URI

2009-07-09 Thread SergeyPo
Works, Thanks, Fixed. On Jul 9, 5:40 pm, mdipierro wrote: > OK. possibly fixed. Uploading to trunk. Give it a try in a couple of > minutes. > > On Jul 9, 3:24 am, SergeyPo wrote: > > > > > If I put old (v 1.75) regex there (line 75), version 1.65.1 stops > &

[web2py:26026] Re: Minus in URI

2009-07-09 Thread SergeyPo
/bazaar.launchpad.net/%7Emdipierro/web2py/devel/revision/917#gl...> > > > On Thu, Jul 9, 2009 at 1:40 AM, SergeyPo wrote: > > >> In version 1.57 this worked: 127.0.0.1:8000/appname/controllername/ > >> function/1/-1/10/-10<http://127.0.0.1:8000/appname/contro

[web2py:26021] Minus in URI

2009-07-08 Thread SergeyPo
In version 1.57 this worked: 127.0.0.1:8000/appname/controllername/ function/1/-1/10/-10 (notice negative numbers in arguments) In version 1.65 this causes 'Invalid Request' error. This makes my app incompatible. Please help me where to look to patch. --~--~-~--~~~---~

[web2py:25968] Re: Web2py vs the world

2009-07-08 Thread SergeyPo
lar could be implemented in the new DAL without slowing down > anything. Actually I expect the new DAL to be faster because there are > no table lookups. > > Massmo > > On Jul 8, 11:09 am, SergeyPo wrote: > > > > > Please don't! DAL is minimalist now but tha

[web2py:25956] Re: Web2py vs the world

2009-07-08 Thread SergeyPo
Please don't! DAL is minimalist now but that's what positively differs web2py from others. In return it works fast (I'd say 10x faster than RoR) and takes no time to learn. On Jul 8, 6:35 pm, mdipierro wrote: > I think this is gone off topic. The issue is whether it should be > possible for a t

[web2py:25938] Re: Web2py vs the world

2009-07-07 Thread SergeyPo
, 10:27 am, SergeyPo wrote: > I gave bad example with User.is_logged  but obviously having center > place where to put model logic is good thing. In web2py I write > functions (not methods in OOP sense) into db.py to get reusable code > that has to be called from various controllers. In Ro

[web2py:25935] Re: Web2py vs the world

2009-07-07 Thread SergeyPo
have an ORM and we have a DAL. In > > practice this is syntactical difference more than a functional one. > > They say > > >  record.is_logged() > > > we say > > >  is_logged(record) > > > The rails syntax can easily be implemented on top of web2p

[web2py:25930] Re: Web2py vs the world

2009-07-07 Thread SergeyPo
ey say > >   record.is_logged() > > we say > >   is_logged(record) > > The rails syntax can easily be implemented on top of web2py and I do > not completely exclude it will be supported in the new DAL (without > going to a full ORM). > > Massimo > >

[web2py:25927] Re: Web2py vs the world

2009-07-07 Thread SergeyPo
I like web2py and prefer it over RoR but two things I am missing: 1. migrations (RoR migrations are really more powerful, you write the script that not only changes database scheme but also can update data, you have full control etc.) 2. models (web2py model layer is purely database layer which yo

[web2py:25856] Static files listing in appadmin

2009-07-07 Thread SergeyPo
I place several large js libraries into 'static' directory, also my application generates MANY graphical files into this dir. Is it possible to display only "standard" directories in static? Otherwise loading app admin page takes too much time/memory as it loads thusands of file names that are sto

[web2py:23658] Re: how to get main web2py directory?

2009-06-09 Thread SergeyPo
not convinced. why should it find applications and not find its > own path? > anyway, where do you think it should go? > > massimo > > On Jun 9, 1:04 am, SergeyPo wrote: > > > > > There are problems with these in Windows when web2py is run as > > service. They sh

[web2py:23647] Re: how to get main web2py directory?

2009-06-08 Thread SergeyPo
There are problems with these in Windows when web2py is run as service. They show path to python. After many trials I came to this ugly solution: import applications.advantage.modules.pathfinder as pathfinder PATH_TO_ME = os.path.dirname( os.path.realpath( pathfinder.__file__ )) Here 'pathfinder

[web2py:23122] Re: distinct with a field name

2009-06-02 Thread SergeyPo
;I am feeling lucky' approach that works without much overhead: an_Amoxycilin = db(db.drugs.name.like('Amoxycilin')).select(limitby= (0,1)) On Jun 2, 11:10 am, Horst Herb wrote: > On Tue, Jun 2, 2009 at 4:48 PM, SergeyPo wrote: > > > This works for sure in sqlite, m

[web2py:23115] Re: Question related to models

2009-06-02 Thread SergeyPo
This also looks like Ruby on Rails approach, however you can write your own classes in web2py, put them to models dir and use them as you have used to. E.g. you have an sql table 'users' in DAL, and you can write a class class Users: def findUser(login): u = db(db.users.login==login).s

[web2py:23096] Re: distinct with a field name

2009-06-01 Thread SergeyPo
This works for sure in sqlite, mysql and oracle: db().select(db.tablename.fieldname, distinct=True) and this is correct approach because I can not imagine biz logic when you want to select distinct values AND their ID's etc. fields. You normally use select distinct when you need a list of availa

[web2py:22797] Re: Possible bug with Oracle.

2009-05-27 Thread SergeyPo
My vote for it too, I've reported this problem before. Sergey On May 28, 8:13 am, Mariano Mara wrote: > G'night everyone. > > I'm defining a table like this: > > db.define_table("BillHourType", SQLField("hourtype", db.HourType), >                                 SQLField("billtype", db.Billable

[web2py:22682] Re: response.flush()

2009-05-26 Thread SergeyPo
There is an example of string streaming on the site, and I have implemented my streaming controller function using this example (yes, it involves diving into file interface but not too much): #class streams long CSV to file-like object #I pasted it here unchanged, so code may be excessive class C

[web2py:22012] Re: Feature Request: Pagination

2009-05-17 Thread SergeyPo
I am using a pagination of <<< 1 | 2 | 3 >>> style in mysql and Oracle. I agree that OFFSET slows down in MySQL after 20,000 records, that's why I suggest my clients to use Oracle after their database grows. If you are interested in my pager code I can post it here, although it might be written

[web2py:20798] Re: embedd results cerated with external packages

2009-04-29 Thread SergeyPo
Hi Timmie I m using matplotlib and instead of show() just use savefig ('filepath', dpi=dpi) I make filepath inside static dir, something like /static/myfiles/ tmp0123 This of course requires periodic cleaning by some cron script, e.g. delete all files older than 4 days. Or try to use python's tmp

[web2py:20602] Re: do you consult? do you have a company?

2009-04-26 Thread SergeyPo
Great! Thank you, Massimo. On Apr 27, 9:42 am, mdipierro wrote: > I added the link. > > On 27 Apr, 00:37, SergeyPo wrote: > > > My company Zarealye develops personal loans data mining application > > with web frontend, uses web2py.  Link to English web page >

[web2py:20600] Re: do you consult? do you have a company?

2009-04-26 Thread SergeyPo
My company Zarealye develops personal loans data mining application with web frontend, uses web2py. Link to English web page is http://zarealye.com/ca/Collect_Advantage/ And we have large CRM project with call centre intergration in our plans. On Apr 27, 8:44 am, mdipierro wrote: > If you work

[web2py:20064] Re: Unrecoverable error

2009-04-20 Thread SergeyPo
pr 16, 8:02 pm, mdipierro wrote: > Try 1.61.1 anyway Sqlite is buggy on Mac. I have had issue myself. I > suggest also try running from the binary distribution. > > On Apr 16, 10:20 am, SergeyPo wrote: > > > No,  am on 1.57 > > > On Apr 16, 5:04 pm, mdipierro wrote: &g

[web2py:20063] Re: Changing links on SQLTABLE

2009-04-20 Thread SergeyPo
= str(row.id) table.append(TR(''' add columns ''', _onclick="javascript:document.location = 'blah/blah' + current_id")) On Apr 20, 11:49 am, weheh wrote: > SergeyPo - Many thanks to you for your earlier post with which I am > already intimat

[web2py:20058] Re: Changing links on SQLTABLE

2009-04-19 Thread SergeyPo
It's my specialty in this forum to give link to a thread for SQLTABLE personalizing. SQLTTABLE looks like one of the biggest attractors of the whole web2py, so some effort for extra features and documentation is required. Lambda function example and another home-made method is described here: htt

[web2py:19887] Re: Unrecoverable error

2009-04-16 Thread SergeyPo
No, am on 1.57 On Apr 16, 5:04 pm, mdipierro wrote: > 1.61.1 ? > > On Apr 16, 5:39 am, SergeyPo wrote: > > > Greetings! > > > I am running web2py on Mac OS X, SQLite from source code (for > > development). > > Sporadically I get this error: > >

[web2py:19863] Unrecoverable error

2009-04-16 Thread SergeyPo
Greetings! I am running web2py on Mac OS X, SQLite from source code (for development). Sporadically I get this error: ERROR:root:Traceback (most recent call last): File "/Users/vasilina/Documents/_Development/ADVANTAGE/web2py copy/ gluon/main.py", line 316, in wsgibase File "/Users/vasilina/

[web2py:19587] Streaming: advice needed

2009-04-11 Thread SergeyPo
Hello group! I want to mimic the behavior of console application through web interface: I invoke a process in web2py controller function and try to pipe its stdout to user's browser (no keyboard input is needed). These are time-consuming processes that print out their progress with simple python

[web2py:19370] Oracle: long text inserting

2009-04-07 Thread SergeyPo
I hope my today's activity with Oracle testing helps to improve web2py! Model: db.define_table('settings', SQLField('created_at', 'datetime', default=datetime.datetime.now ()), SQLField('meta', 'text'), ) Controller action: outp = 'Long text longer than 4000 symbols' db.settings.insert

[web2py:19362] Oracle: date field type

2009-04-07 Thread SergeyPo
Oracle handles DATE type similarly to DATETIME so it outputs date with timestamp 00:00:00. If you print out SQLRow you will see that it contains datetime.datetime(2009, 4, 6, 0, 0) But for portablility it should be datetime.date(2009, 4, 6, 0, 0) I could not identify correct place to patch in gluo

[web2py:19361] Oracle: limitby

2009-04-07 Thread SergeyPo
If you try to limitby complex query in oracle you get an error (duplicate records). Gluon currently works well for queries like db().select(db.details.ca_date, orderby=~db.details.ca_date, limitby= (0,1)) but does not work for joint tables e.g.: db(db.headers.id==db.details.header) \ .se

[web2py:19360] Oracle: GROUP BY

2009-04-07 Thread SergeyPo
This code works in MySQL, SQLite: db(cond).select(db.carts.ALL, db.c_h.cart_id.count(), left=db.c_h.on(many_to_many), groupby=db.carts.id, orderby=carts_orderby,

[web2py:19242] Re: A couple of Oracle problems

2009-04-06 Thread SergeyPo
us bad symbols here. The only workaround I have found for now is manual removing the field from the table and running a 'migration'. This makes me suspect that '__tmp' part of name is bad... On 6 апр, 14:22, SergeyPo wrote: > One problem resolved: "ProgrammingErro

[web2py:19241] Re: A couple of Oracle problems

2009-04-06 Thread SergeyPo
One problem resolved: "ProgrammingError: LOB variable no longer valid after subsequent fetch " this error can be eliminated. In gluon/sql.py modify SQL_DIALECTS for oracle: make 'string': 'NVARCHAR2(%(length)s)', 'text': 'NCLOB', instead of 'string': 'VARCHAR2(%(length)s)', 'text': 'CLOB', Reaso

[web2py:18906] Re: A couple of Oracle problems

2009-03-31 Thread SergeyPo
gth=512)) gives ORA-00911 error (bad symbol!) sql log shows correct ALTER TABLE statements... Anything I am missing? On Mar 28, 1:37 pm, SergeyPo wrote: > Sorry I was typing by memory; there is no syntax error in real code, > database is created in reality. Only with those problems I described.

[web2py:18699] Re: A couple of Oracle problems

2009-03-28 Thread SergeyPo
> >   SQLFIELD('header_id', 'header') > > ) > > should be > > db.define_table('headers',...) > > db.define_table('details', >    SQLFIELD('header_id', db.header) >  ) > > On Mar 27, 1:10 am, SergeyPo wrote: >

[web2py:18665] Re: A couple of Oracle problems

2009-03-26 Thread SergeyPo
code (string, 'utf-8') and so on similar to your code in SQLTABLE truncate does not help - Oracle VARCHAR2(255) does not let my strings in. Thank you! Sergey On Mar 27, 8:29 am, mdipierro wrote: > Thank you. Will look into these asap. > > Massimo > > On Mar 26, 9:46 am, Se

[web2py:18645] A couple of Oracle problems

2009-03-26 Thread SergeyPo
Hi all, these probolems may be caused by unicode support by Oracle DB (or not - I don't know). The code works fine with MySQL and SQLite. 1. DAL migrations do not work if you change length of 'string' field. E.g. I have this: SQLField('komment', 'string', length=255) and I try to change it to SQ

[web2py:18509] Re: MVC question

2009-03-24 Thread SergeyPo
I like the ability to prepare forms inside controllers. This really makes difference from Rails, for e.g. And you get much cleaner View code. In controller you build your form and form processing code. In view you place your form inside HTML as single {{=form}} statement and glue javascript etc.

[web2py:18185] Re: Marketing suggestion

2009-03-17 Thread SergeyPo
Massimo, Regarding the killer app. I am finalizing the first version of financial risk management system for retail banking using your wonderful framework. I have not yet decided that I release it in open source (I defnitely have several clients willing to buy it so at least I should sell to them

[web2py:17991] How to download csv file?

2009-03-13 Thread SergeyPo
Hi all, can you recommend an elegant way to download CSV file from web2py? Using gluon code, I wrote a controller function that creates good CSV for me in cStringIO object, but my recordsets are large and I'd like to stream download file. I.e. approach when I write temp file and then download it

[web2py:17724] Re: HTP header P3P policy - how to?

2009-03-09 Thread SergeyPo
have at least a constructor and two methods (getSQL and getHTML). On Mar 9, 10:49 am, Fran wrote: > On Mar 9, 7:12 am, SergeyPo wrote: > > > session.something = Klaas() > > #this will be stored in session and in session file you will see > > correct pickle representation of

[web2py:17718] Re: Loving SQLTABLE but needing some help

2009-03-09 Thread SergeyPo
For second question see http://groups.google.com/group/web2py/browse_thread/thread/a0c789cccafe8014/f1f96197a13cfeb7?show_docid=f1f96197a13cfeb7 for an idea... On Mar 9, 7:54 am, weheh wrote: > I'm really loving SQLTABLE and how concisely one can display a DB and > sort columns. BUT ... > > 1) I

[web2py:17717] Re: HTP header P3P policy - how to?

2009-03-09 Thread SergeyPo
Problem solved: that was not ajax or web2py fault. Sessions are broken when you try to store any custom class (not only db-related class). Example: class Klaas: pass session.something = Klaas() #this will be stored in session and in session file you will see correct pickle representation of the

[web2py:17604] Re: HTP header P3P policy - how to?

2009-03-06 Thread SergeyPo
Thank you Massimo, however this did not help. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group,

[web2py:17592] HTP header P3P policy - how to?

2009-03-06 Thread SergeyPo
Sorry this is not spamming but I keep trying to fix problem with sessions and javascript. My site uses frames and this may lead to problems. For example the following link from 'left' frame works (opens something in right frame): _onclick="javascript:top.frames['right'].location.reload()" But th

[web2py:17587] Re: Sessions are destroyed by ajax calls?

2009-03-05 Thread SergeyPo
I found other posts here with same problem, all unanswered. Please reply do you have positive examples of jQuery sending cookies with ajax? I tried to pass session-id with hidden form field but get other strange error. Controller function (called by ajax): from gluon.storage import Storage def

[web2py:17537] Re: Sessions are destroyed by ajax calls?

2009-03-05 Thread SergeyPo
Safari and FireFox on Mac, Fox and IE on Windows, ajax sends only http-cookies, env cookies are empty This is the printout from BEAUTIFY(request) - however I don't know how to paste it retaining table structure: application : advantage args : body : ', mode 'w+b' at 0x65a4530> client : 127.0.0.

[web2py:17530] Re: Sessions are destroyed by ajax calls?

2009-03-05 Thread SergeyPo
A bit more details: this controller function is called by ajax: def add_filter(): #append new custom object to list in session.filter #Filter object contains only strings and dicts session.filter.append(Filter()) #update session.filter list with some computations, it works up

[web2py:17525] Sessions are destroyed by ajax calls?

2009-03-04 Thread SergeyPo
I have strange problem when trying to make ajax calls (all with jquery supplied with web2py). After an Ajax call previously created session becomes lost, and new empty session is created. I tried file storage and db sessions storage, it does not matter. After ajax call, any other call to the site

[web2py:17454] Re: SQLTABLE personalizing

2009-03-03 Thread SergeyPo
I see what happened: I was just using version 1.47 on my development machine, so did not see new possibilities in source code. And with all those T2, T3 discussions in mailing list, there was a misconception that widgets, representation and other cool stuff are provided by T2, T3. I do not need mo

[web2py:17427] Re: SQLTABLE personalizing

2009-03-03 Thread SergeyPo
Pity that I did not grasp it from docs and this mailing list... Do I need to import t2 or anything else to use it? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, s

[web2py:17409] SQLTABLE personalizing

2009-03-03 Thread SergeyPo
For those of us who loves using SQLTABLE but is missing some simple personalizing methods (more link columns, image instead of 'id' in links etc.) here is very basic function. It allows to update the whole column of a SQLTABLE object using regular expressions. I hope it helps someone who is as laz

[web2py:14856] RestrictedError

2009-01-11 Thread SergeyPo
Hi group! When I run py scripts within web2py context using -S -M -R flags, when I make mistake in model files I get always the same non-informative error: Traceback (most recent call last): File "web2py.py", line 5, in start() File "/Users/vasilina/Documents/Development/ADVANTAGE/web2p

[web2py:13863] Re: Split up db.py into separate files?

2008-12-19 Thread SergeyPo
I am sure you can do it all with Python but I think you should put your dictionaries into underscored files and construct databases in non-underscored. If I uderstood you correctly you want to store a lot of meta-data with your fields/tables definitions. Incidentally I did the same in order to 'D

[web2py:13856] Re: Split up db.py into separate files?

2008-12-19 Thread SergeyPo
Files in /models directory get loaded automatically so you can create as many files as you wish. I prefer this way: I name all my files with starting underscore, this ensures that the files are loaded before db.py In each 'underscored' file I create definitions for different tables or sets of tabl

[web2py:13851] Performance question

2008-12-18 Thread SergeyPo
In case when I need to run many updates to database in long cycle, what is preferred for speed - to have one db.commit() at the end or commit() after every db update? E.g. for i in range(10): db(db.details.id==i).update(**dict([(destination_field, i)])) db.commit() or for i in rang

[web2py:13781] Passing options to script

2008-12-17 Thread SergeyPo
Hi group! I run my own python scripts wihin web2py framework and importing web2py models by shell comand: python2.5 web2py.py -S appname -M -R myscript.py -d --DATE 2008-11-30 param1 param2 The above works. You see that I need to pass options to my script. When my options coincide with web2py's

[web2py:12697] Re: How to pass list of fields into db().select() ?

2008-11-30 Thread SergeyPo
erby=db.time_based.ca_date,*full_qualifiers) > > On Nov 30, 4:04 am, SergeyPo <[EMAIL PROTECTED]> wrote: > > > Hello! > > > This is probably Python question, but maybe you can help: > > I need to prepare the list of fields to be selected from DB > > programm

[web2py:12666] How to pass list of fields into db().select() ?

2008-11-30 Thread SergeyPo
Hello! This is probably Python question, but maybe you can help: I need to prepare the list of fields to be selected from DB programmatically: full_qualifiers = [] #list of SQLTABLE fields time_based_details = db().select(*full_qualifiers, _orderby=db.time_based.ca_date) But Python does not a

[web2py:12626] Search by date bug?

2008-11-29 Thread SergeyPo
Hi guys! My code: db(db.data_storage.ca_date==a_date).select(limitby=(limit, offset)) If I use a_date='2007-01-01' I get a result set (that I actually have in database) but if a_date='2007-1-1'or a_date='2007-01-1'or etc. - it can not find the records dated 1st January 2007. --~--~-

  1   2   >