Re: [web2py] Re: powertable problem

2011-02-04 Thread Johann Spies
On 4 February 2011 11:50, ceriox wrote: > another questions... > how can manage parameters in function call ? > > details={'detailscallback':URL('myfunction.load')} > ) > > i want to have my row id in myfunction You can specify the sql-query in myfunction. I have the foll

[web2py] Updating computed fields

2011-02-07 Thread Johann Spies
If I have a table and add a computed field - how do I update existing records? I am speaking of tables with many thousands of records. Regards Johann -- May grace and peace be yours in abundance through the full knowledge of God and of Jesus our Lord! His divine power has given us everything

Re: [web2py] Updating computed fields

2011-02-07 Thread Johann Spies
Thanks! Regards Johann -- May grace and peace be yours in abundance through the full knowledge of God and of Jesus our Lord! His divine power has given us everything we need for life and godliness through the full knowledge of the one who called us by his own glory and excellence.

[web2py] .represent not representing

2011-02-12 Thread Johann Spies
I get the following output : inwoner.idinwoner.vaninwoner.adres1Spies1 the following code: db.define_table('adres', Field('straat')) db.define_table('inwoner', Field('van'), Field('adres', db.adres, requires = IS_IN_DB(db

[web2py] jqgrid-problem

2011-02-15 Thread Johann Spies
On my develop computer it works as expected. On the production server the jqgrid's all show empty grids. It is not a case of the user not being logged in as was mentioned in another thread about jqgrid. Normally when I get this type of behaviour I test the rest of the function by using an SQLTABL

Re: [web2py] Re: error occurs when use executesql

2011-02-15 Thread Johann Spies
On 15 February 2011 08:49, hywang wrote: > Please help to run it :-) > > # File Name: default.py > > def index(): >db.define_table("pymysql",Field("content","text"),migrate=True) >content = """'http://img1.t.sinajs.cn/t3/style/css/common/ > layer.css'""" >#content = """this sentence i

Re: [web2py] Re: jqgrid-problem

2011-02-16 Thread Johann Spies
On 15 February 2011 16:35, Massimo Di Pierro wrote: > check with firebug. It is possible the ajax requests of jqgrid are > failing. This could be because on your deployment you are using > routes. > I am indeed using routes on the deployment server! Thanks. Do I need to adjust the routes then?

Re: [web2py] Re: tip of the day. The power of routes

2011-02-16 Thread Johann Spies
On 29 November 2010 01:03, Bruno Rocha wrote: > HI, I am trying to use autoroutes for the firsttime, what I want is my site > running in 127.0.0.1:8080/index instead of 127.0.0.1/app/default/index. > > I tried the autoroutes and routes.conf explained here but i did't figure > out how to make the

Re: [web2py] Re: jqgrid-problem

2011-02-16 Thread Johann Spies
On 16 February 2011 16:32, Massimo Di Pierro wrote: > Please check with firebug what the ajax call does and how it fails. > Without that information I cannot say. > > I am afraid I am a bit lost on this one. I have never programmed Ajax before and have no clue what Firebug is telling me or where

Re: [web2py] Re: tip of the day. The power of routes

2011-02-16 Thread Johann Spies
On 16 February 2011 17:35, Bruno Rocha wrote: > Thats my working solution > > http://snipt.net/rochacbruno/routespy/ > > http://snipt.net/rochacbruno/routesconf/ > > > Thanks. It is about the same as mine. I was just wondering whether my jqgrid-problem (another thread) on my production server wa

Re: [web2py] Re: new URL router use cases

2011-02-17 Thread Johann Spies
On 17 February 2011 08:02, Jonathan Lundell wrote: > On Feb 16, 2011, at 9:49 PM, cjrh wrote: > > > > On Feb 16, 11:38 pm, Jonathan Lundell wrote: > >> [I'm reposting this message from a while back, because the new release > 1.92.1 contains it for the first time. It describes some simple use cas

Re: [web2py] Re: new URL router use cases

2011-02-17 Thread Johann Spies
> No, this is a special case for favicon.ico and robots.txt > > By "root_static" (which I agree is a little confusing), we mean static > files like favicon.ico that are always accessed in the server root. This is > simply a list of those files (and the default list should normally be all > you need

Re: [web2py] Re: new URL router use cases

2011-02-22 Thread Johann Spies
On 17 February 2011 21:33, Jonathan Lundell wrote: > On Feb 17, 2011, at 10:37 AM, Johann Spies wrote: > > What are the actual URLs for the images in question? As they appear in > the page source at the browser, I mean. > > > > > > src="/kb/static/DSC_1403.png&

[web2py] Powertables: wrapping text

2011-02-25 Thread Johann Spies
How do I get powertables to show the full text of a field (wrapping if necessary) in a grid and not a truncated one? eg. "Methodological preparation fo..." on stead of "Methodological preparation for your PhD (covering basic concepts in social research and proposal development)" Regards Joha

Re: [web2py] Powertables: wrapping text

2011-02-28 Thread Johann Spies
On 25 February 2011 23:43, Bruno Rocha wrote: > table = plugins.powerTable > table.truncate = 255 # the number of chars to truncate > > > Thanks! Regards Johann -- May grace and peace be yours in abundance through the full knowledge of God and of Jesus our Lord! His divine power has given us

[web2py] Powertable 'id' -error

2011-02-28 Thread Johann Spies
My controller: def pwrtable(): powerTable.dtfeatures['sScrollY'] = '100%' powerTable.dtfeatures['sScrollX'] = '100%' powerTable.headers = 'fieldname:capitalize' powerTable.showkeycolumn = False powerTable.dtfeatures['bJQueryUI'] = request.vars.get('jqueryui',True) powerTab

Re: [web2py] static subdirectories

2011-03-02 Thread Johann Spies
Hallo Jonathan, On 2 March 2011 01:42, Jonathan Lundell wrote: > On Feb 17, 2011, at 10:37 AM, Johann Spies wrote: > > src="/kb/static/DSC_1403.png" (I moved the image from /kb/static/images to > /kb/static - now it works. > > I would still like to know how to get

Re: [web2py] static subdirectories

2011-03-02 Thread Johann Spies
On 3 March 2011 08:39, Jonathan Lundell wrote: > > The fix (until the next version, anyway) is to change calls like > URL('static/image', 'file') to URL('static', 'image/file'). The reason is > that 'static' is treated as the name of the controller directory, and > 'static/image' isn't recognized

[web2py] From .represent to csv: is this possible?

2011-03-04 Thread Johann Spies
I have a generic 'show_data' function in my controller using the .represent functions in the models to show linked fields correctly. The clients wants the same now in the csv-downloads from the same data shown by show_data. There are many tables involved - it might be more than 20 and I do not w

Re: [web2py] From .represent to csv: is this possible?

2011-03-04 Thread Johann Spies
Hallo Richard, Don't know if it will help : > > import csv > db.export_to_csv_file(open('/home/YOU/Bureau/export_csv_with_represent.csv', > 'w'), >represent=True, # this bring your representation into the CSV... >delimiter='|', >quotechar='"', >quoting=csv.QOUTE_NONNUMERIC) > > Tha

[web2py] NameError: global name 'db' is not defined

2011-03-07 Thread Johann Spies
I want to run a script in the commandline shell to insert records into the database, but have a problem handling the namespace. When I try to run it with the '%run' option or do a 'from

Re: [web2py] Re: NameError: global name 'db' is not defined

2011-03-07 Thread Johann Spies
On 8 March 2011 01:12, Massimo Di Pierro wrote: > > > python web2py.py -M -N -S kb -R script.py > > Thanks! Regards Johann -- May grace and peace be yours in abundance through the full knowledge of God and of Jesus our Lord! His divine power has given us everything we need for life and godli

[web2py] javascript/jquery advice

2011-03-10 Thread Johann Spies
I am starting to learn javascript and am thinking of using more jquery and jquery UI and ajax elements in my applications and would appreciate on how to approach it: 1. Starting with javascript tutorials (e.g. from developer.mozilla.org) and move on to jquery tutorials and later on to how web2py

[web2py] Adjusting the width of the textarea

2011-03-11 Thread Johann Spies
I want to change the width of certain input fields for the type 'text' in a form. I have tried this but it did not have any effect: textarea { width: 100px; } The defined width in base.css is 400px. So how do I do it

Re: [web2py] Adjusting the width of the textarea

2011-03-11 Thread Johann Spies
On 11 March 2011 15:32, Martín Mulone wrote: > Fijate que no tengas en layout.html esta linea o algo por el estilo alguna > vez la vi. > > > jQuery(document).ready(function(){jQuery('textarea').css('width','600px').css('height','400px')}); > > You are a star! Thanks. Now I also learning how to

Re: [web2py] Re: clean database

2011-03-31 Thread Johann Spies
On 29 March 2011 15:13, LightOfMooN wrote: > Yes, thanks, it's good. > > But first question stills opened: > Is there a way to pack just app code? (to *.w2p) > > I think if you use sqlite as database, it is included but when you use something like PostgreSQL or MySQL the data will not be part of

[web2py] .represent = ... in left join

2011-04-04 Thread Johann Spies
I want to get a proper representation of a field in the result of a left join but am struggling to do so. Here is a simplified version of the problem. db.define_table('courses', Field('week','integer', requires=IS_IN_SET([1,2]), widget = SQLFORM.widgets.r

Re: [web2py] .represent = ... in left join

2011-04-05 Thread Johann Spies
On 4 April 2011 16:11, Richard Vézina wrote: > Are course_week1 and course_week2 not null?? > > No. > If not you need ...requires=IS_NULL_OR(IS_IN_DB(your requires) and in > ...represent= you should use zero option (see book about that) or something > like that : > > db.t_registration_form.cour

Re: [web2py] .represent = ... in left join

2011-04-05 Thread Johann Spies
On 5 April 2011 09:16, Johann Spies wrote: > > Thanks! That solved the problem. I could not find something in the book > about a 'zero option' though. > > Now .represent works on the screen but not in the CSV-output. I have used: {{ import cStringIO

Re: [web2py] .represent = ... in left join

2011-04-06 Thread Johann Spies
On 5 April 2011 15:51, Richard Vézina wrote: > About zero option, search in page for zero : > http://www.web2py.com/book/default/chapter/07 > > There is some explanation > near IS_IN_SET... > > Thanks. I found it. Johann -- May grace and peace b

Re: [web2py] Set a flag instead of deleting records permanently

2011-04-06 Thread Johann Spies
Have a look at http://groups.google.com/group/web2py/browse_thread/thread/cdee8f96c654ead0?pli=1 which might be exactly what you want. Regards Johann -- May grace and peace be yours in abundance through the full knowledge of God and of Jesus our Lord! His divine power has given us everything we

[web2py] crud.create and SQLFORM: different behaviour

2011-04-08 Thread Johann Spies
I have two controllers using the same table. One for the logged in user to register for a course and the other for the administrator to register a user for a course overriding the 'writable=False in the model: The model has: db.define_table('t_registration_form', Field('f_attendee', db.a

Re: [web2py] Re: crud.create and SQLFORM: different behaviour

2011-04-08 Thread Johann Spies
On 8 April 2011 12:56, DenesL wrote: > > What do you have in the form.accepts?. Nothing. I have tried: if form.accepts(request .vars, session ): session

Re: [web2py] extra text in forms

2011-04-11 Thread Johann Spies
On 10 April 2011 23:42, niknok wrote: > This might sound too basic, but I couldn't find out how to display extra > text in across the width of the whole form table. > > Right now, I do it this way (which only displays in the input column) but I > wonder what's the web2py way? > > form=SQLFORM.fa

Re: [web2py] Re: Reutilizing/Extending web2py admin panel

2011-04-13 Thread Johann Spies
On 14 April 2011 00:15, Massimo Di Pierro wrote: > I am sorry I still do not understand which part of admin would be > useful at the app level. > One example of something useful would be the appadmin interface. Regards Johann -- May grace and peace be yours in abundance through the full knowl

[web2py] Implementing id = uuid.uuid4() on an existing database

2011-04-14 Thread Johann Spies
I want to syncrhonize a database to another computer using the method indicated in the book ( http://web2py.com/book/default/chapter/06?search=sync#CSV-and-Remote-Database-Synchronization). Unfortunately the database was not designed from the beginning to use uuid. Is it possible to modify the exis

[web2py] NameError: name 'uuid' is not defined

2011-04-14 Thread Johann Spies
Why do I get this error? The code causing this error: from uuid import uuid4 signature = db.Table(db, 'signature', Field('uuid', length=64, default=uuid.uuid4(), notnull=True, writable=False, unique=True), Field('created_on', '

[web2py] Re: NameError: name 'uuid' is not defined

2011-04-14 Thread Johann Spies
Apologies for a stupid question. On 14 April 2011 10:53, Johann Spies wrote: > Why do I get this error? The code causing this error: > > from uuid import uuid4 > > Should have been import uuid Regards Johann -- May grace and peace be yours in abundance through the full knowl

[web2py] db.xx[0] = dict( a = 'b') against db.xx.insert(a = 'b')

2011-04-14 Thread Johann Spies
I want to insert a dictionary into a table and work the resulting id. The following illustrates my problem: db.define_table('xx', Field('a'), Field('b')) x = {} x['a'] = 'abcd' x['b'] = 'dbcs' db.xx[0] = x # Success but how do I get the id? This should be equivalent to db.x

Re: [web2py] Re: db.xx[0] = dict( a = 'b') against db.xx.insert(a = 'b')

2011-04-14 Thread Johann Spies
On 14 April 2011 15:52, Anthony wrote: > Try recnr = db.xx.insert(**x) > > The **x will expand your dictionary into a set of keyword arguments. > > Thanks Anthony. Regards Johann -- May grace and peace be yours in abundance through the full knowledge of God and of Jesus our Lord! His divine p

Re: [web2py] Re: Implementing id = uuid.uuid4() on an existing database

2011-04-14 Thread Johann Spies
On 14 April 2011 18:26, howesc wrote: > Johann, > > the steps as i see it: > - add new uuid field for your new primary key, don't drop old one yet > - fill in the uuid field > - add a new foreign key field that will store UUID > - use the old foreign key to lookup the uuid of the reference >

[web2py] IntegrityError: duplicate key value violates unique constraint "x_uuid_key"

2011-04-15 Thread Johann Spies
Please help me to understand how to use uuid. db.define_table('x', Field('uuid', length=64, default=uuid.uuid4(), notnull=True, writable=False, unique=True, ondelete='CASCADE'), Field('a'), Field('b')) In [4]: db.x[0] = dict(

Re: [web2py] Re: IntegrityError: duplicate key value violates unique constraint "x_uuid_key"

2011-04-16 Thread Johann Spies
On 15 April 2011 15:18, Massimo Di Pierro wrote: > You are passing a uuid, not a uuid function therefore it is always the > same value: > > try replace > > default=uuid.uuid4() > > with > > default=uuid.uuid4 > or > default=lambda:uuid.uuid4() > or > default=lambda:str(uuid.uuid4()) > > they shoul

Re: [web2py] Unable to create DAL connection to PostgreSQL on WebFaction

2011-04-16 Thread Johann Spies
On 16 April 2011 21:15, Dave wrote: > I am building my website using web2py on WebFaction. I have a > PostgreSQL database on WebFaction called dlawrence_test1. > > When I attempt to create a connection to that database using the > web2py shell as described in the manual, the command executes with

[web2py] Passing data to jquery

2011-04-20 Thread Johann Spies
I am fairly new to javascript programming. Using the following function I can draw a graph in javascript as long as the type is some numeric type: jQuery(document).ready(function() { $.jqplot.config.enablePlugins = true; // on the page before plot creation. line1={{=data}} $.jqplot('wys', [li

Re: [web2py] Re: Passing data to jquery

2011-04-20 Thread Johann Spies
On 20 April 2011 11:22, Arun K.Rajeevan wrote: > can't you just send integer data from server instead of strings? > ie., do type conversion at server side. > > by the way, parseInt(''1979') will return 1979 in Javascript. > So you may like to write a custom function to do the conversion at client

Re: [web2py] export results from plugin_jqgrid

2011-04-28 Thread Johann Spies
Hallo Neveen, On 26 April 2011 17:48, Neveen Adel wrote: > Hello, > > Is there a way to export the data resulting in plugin_jqgrid? What I normally do is: In my controller: def list_data(): data=plugin_wiki.widget('jqgrid', table='joernaal', col_width=130, width= 1000) if request.e

[web2py] Autocomplete widget on same table

2011-05-09 Thread Johann Spies
I get a "KeyError: 'doccenter' " when I add an autocomplete widget in the following situation: db.define_table('doccenter', Field('doc_nr', type='string', length=50, requires=IS_NOT_IN_DB(db, 'doccenter.doc_nr'), widget =SQLFORM.widgets.autocomplete(

Re: [web2py] strange problem connecting to the database - help!

2011-05-09 Thread Johann Spies
> please help!! any suggestion will be very appreciated! > > Have you checked whether the Postgresql-server accepts your connections? Test it with psql with the same database, user and password you have used in Web2py. Regards Johann -- May grace and peace be yours in abundance through the ful

Re: [web2py] Can't migrate on Postgres

2011-05-10 Thread Johann Spies
On 10 May 2011 05:04, pbreit wrote: > I can't seem to get any of my model changes to migrate to Postgres. I've > tried various combinations of turning migrate and fake_migrate on and off. > Deleting and re-adding Fields(). I'm not sure what else to try or where to > look. I still have no idea wha

Re: [web2py] Re: Autocomplete widget on same table

2011-05-10 Thread Johann Spies
Thanks. That helps. Regards Johann -- May grace and peace be yours in abundance through the full knowledge of God and of Jesus our Lord! His divine power has given us everything we need for life and godliness through the full knowledge of the one who called us by his own glory and excellence.

Re: [web2py] Re: Autocomplete widget on same table

2011-05-11 Thread Johann Spies
On 9 May 2011 15:16, Massimo Di Pierro wrote: > The widget take as argument the table itself which is not yet defined. > you have to do it in two steps: > > db.define_table('doccenter', Field('doc_nr', type='string', > length=50, > requires=IS_NOT_IN_DB(db, 'doccenter.doc_nr'

[web2py] autocomplete widget a disaster on Internet Explorer

2011-05-13 Thread Johann Spies
This came to my attention when one of my users complained about an entry form using the autocomplete widget frustrates her. When i checked I saw the following when using Internet Eplorer: As soon as the autocomplete widget shows up on the screen you cannot type any longer in the field and when yo

Re: [web2py] Re: autocomplete widget a disaster on Internet Explorer

2011-05-13 Thread Johann Spies
On 13 May 2011 15:19, Massimo Di Pierro wrote: > Is this a particular IE version? Do you know if it works with 7 and 8? > I have no easy way of testing it. > have you upgraded the jquery version? > > I don't know which version the user was using but I have tested it on IE8 and it behaved similarl

Re: [web2py] Re: autocomplete widget a disaster on Internet Explorer

2011-05-19 Thread Johann Spies
I have tested autocomplete now on IE9 and the same problem persists although the positioning of the suggestions is more like that in the other browsers. Regards Johann -- May grace and peace be yours in abundance through the full knowledge of God and of Jesus our Lord! His divine power has give

[web2py] Strange autocomplete behaviour

2011-05-24 Thread Johann Spies
Truncated model: db.define_table('akb_doccenter', Field('doc_nr', type='string', length=50, requires=IS_NOT_IN_DB(db, 'doccenter.doc_nr')), Field('location')) db.akb_doccenter.doc_nr.widget =SQLFORM.widgets.autocomplete( request, db.akb_do

[web2py] Re: Strange autocomplete behaviour (Solved)

2011-05-24 Thread Johann Spies
On 24 May 2011 11:54, Johann Spies wrote: > Truncated model: > > db.define_table('akb_doccenter', > Field('doc_nr', type='string', length=50, > requires=IS_NOT_IN_DB(db, 'doccenter.doc_nr')),

[web2py] Memory problems on Webfaction after upgrade of Web2py

2011-05-25 Thread Johann Spies
After upgrading web2py on Webfaction I am experiencing memory problems at least once a week. I have upgraded the memory configuration form 80Mb to 160Mb in January this year and never had this problem until I upgraded to the present version of Web2py (Version 1.95.1). I have disabled cron after th

Re: [web2py] Memory problems on Webfaction after upgrade of Web2py

2011-05-25 Thread Johann Spies
On 25 May 2011 09:46, Bruno Rocha wrote: > This might be a problem with sessions list being loaded in to memory. By > default web2py Cron calls a method which cleans unused sessions. > > But, the best way to track it is trying enabling Cron again. > > I will try. The reason why I disabled cron w

[web2py] HINT: Use DROP ... CASCADE to drop the dependent objects too.

2011-05-27 Thread Johann Spies
How do I do that using DAL? Using db.executesql() does not update web2py//dabases/ Regards Johann -- May grace and peace be yours in abundance through the full knowledge of God and of Jesus our Lord! His divine power has given us everything we need for life and godliness through the full know

Re: [web2py] Re: HINT: Use DROP ... CASCADE to drop the dependent objects too.

2011-05-27 Thread Johann Spies
On 27 May 2011 14:25, Massimo Di Pierro wrote: > Are you doing this from a shell or script? You neeb db.commit() In the shell. Yes I know that, but when I have dropped a table in this way still have to delete the related file in /databases before web2py will create it again. Regards Johann

Re: [web2py] Postgresql database schema

2011-05-30 Thread Johann Spies
On 30 May 2011 12:14, Massimiliano wrote: > Existing tables are divided on different database schemas (not only > public). > > Now I want to rewrite a single application that use existing tables on > schema "xyz". > > Does web2py support that? > > I could not get DAL to work with that(different

Re: [web2py] Re: autocomplete widget a disaster on Internet Explorer

2011-06-13 Thread Johann Spies
I still have not find a solution to the problem of the autocomplete widget not working as it should on Internet Explorer. The following code can illustrate my problem db.define_table("toets", Field("veld1")) db.toets.veld1.widget = SQLFORM.widgets.autocomplete(

Re: [web2py] Re: Discussion: Thoughts about including jQuery UI in core web2py?

2011-06-14 Thread Johann Spies
On 13 June 2011 14:38, Marin Pranjic wrote: > I think that template app should be minimal. > > > On Mon, Jun 13, 2011 at 2:33 PM, Martín Mulone wrote: > >> I prefer the way to select the application you want to install, only >> welcome in main web2py and the others over a repository. >> >> New: Y

Re: [web2py] Re: autocomplete widget a disaster on Internet Explorer

2011-06-14 Thread Johann Spies
On 14 June 2011 03:27, Anthony wrote: > > First, by default, apparently IE caches Ajax responses. That means if you > add a new item and then do a subsequent entry in the same browser session, > the new item will not appear in the autocomplete list because the list is > cached the first time it i

Re: [web2py] record representation using a non-id column?

2011-07-20 Thread Johann Spies
On 9 July 2011 03:47, niknok wrote: > ** > I have another unique column in my table that I would like to use as index > for record representation. How do I tell web2py to use another index? > > Ttrying to use like: > db.mytable.thisfield.represent = lambda id: db.other(myidx).thatfield > I

Re: [web2py] record representation using a non-id column?

2011-07-20 Thread Johann Spies
On 20 July 2011 14:09, Johann Spies wrote: > > I use this: > > > db.define_table('akb_doccenter_location', > > Field('location')) > > Apologies, I did not complete the message before sending: the model includes a Field(uuid), obviou

[web2py] Deleting uploaded files

2011-07-26 Thread Johann Spies
I have the following model: db.define_table("files", Field("title", "string"), Field("description", "text"), Field("file","upload", autodelete = True), # something to be uploaded signature) db.files.id.represent = \

[web2py] def data()

2011-07-26 Thread Johann Spies
I have read something about security related modifications in recent Web2Py versions which caused the previous code using the data() controller to fail with 404 NOT FOUND. I have als seen the comment in the new Welcome-app telling us: " but URLs bust be signed, i.e. linked with A('table',

Re: [web2py] How to one2many ?

2011-07-27 Thread Johann Spies
On 27 July 2011 13:07, François Le Gal wrote: > That's the code i try : > > db_system = SQLDB("sqlite://db_system.db") > > db_system.define_table("fields",Field("name")) > > db_system.define_table("objects",Field("name"),Field("fields",db_system.fields)) > > Try another name for 'fields' and see

Re: [web2py] Ubuntu pip install web2py in virtualenv

2011-07-27 Thread Johann Spies
On 27 July 2011 14:08, flebber wrote: > I installed web2py into a virtualenv in my ubuntu install. When > reading the book it states to start web2py with "python web2py.py -S > welcome" however I don't appear to have web2py in my directory. > Are you referring to web2py or web2py.py in that dire

[web2py] Powergrid documentation?

2011-08-01 Thread Johann Spies
I am trying out PowerGrid. As I could not find good documentation that explains how to use it, I was following the examples to try and figure out how to use it. So far I had no success at all after a little bit more than 2 hours of trying. It will help users like me with very little ajax/javasc

Re: [web2py] JqGrid module

2011-08-04 Thread Johann Spies
On 30 July 2011 20:34, Jim Karsten wrote: > Ray Luo and I are developing a web2py jqgrid module that allows you to > insert a jqgrid into a page with only a few lines of code. > ... > > > # In > controller > > > JqGrid = local_import('jqgrid', app='jqgrid', > reload=True).JqGrid > JqGrid.initial

[web2py] HTTP Error 502 Bad Gateway and Static-only option on Webfaction

2011-08-05 Thread Johann Spies
Some users complains about 'HTTP Error 502 Bad Gateway' on a Web2py site on webfaction. When I enquired about that support@webfaction mentioned that it is related to my website and referred me to http://docs.webfaction.com/software/static.html#serving-static-media for a possible solution. Now I h

Re: [web2py] Re: ANN: ide2py: editor, shell and debugger for web2py (experimental)

2011-08-12 Thread Johann Spies
I followed your installation guide have a problem (on OS X): $ python main.py Traceback (most recent call last): File "main.py", line 777, in app = MainApp(redirect=False) File "/usr/local/lib/wxPython-unicode-2.8.12.1/lib/python2.6/site-packages/wx-2.8-mac-unicode/wx/_core.py", line 7981

Re: [web2py] Re: ANN: ide2py: editor, shell and debugger for web2py (experimental)

2011-08-12 Thread Johann Spies
On Debian Linux I get: % python main.py Traceback (most recent call last): File "main.py", line 777, in app = MainApp(redirect=False) File "/usr/lib/python2.6/dist-packages/wx-2.8-gtk2-unicode/wx/_core.py", line 7978, in __init__ self._BootstrapApp() File "/usr/lib/python2.6/dist-packages/wx-2.8

[web2py] jqgrid-module import problem

2011-08-17 Thread Johann Spies
Strange: I have the app working on my laptop. After packing it using the admin interface and installing it on the server I get this error on the server: ImportError: No module named jqgrid.modules.jqgrid The line in the controller which is referred to: JqGrid = local_import('jqgrid', app='jqgri

Re: [web2py] jqgrid-module import problem

2011-08-17 Thread Johann Spies
On 17 August 2011 12:55, Bruno Rocha wrote: > try changing this: > > JqGrid = local_import('jqgrid', app='jqgrid', reload=True).JqGrid > > > to this: > > > from jqgrid import JqGrid > > Thanks. That solved the problem but not the mystery (because my lack of understanding). When is it better to

Re: [web2py] jqgrid-module import problem

2011-08-17 Thread Johann Spies
On 17 August 2011 13:28, Bruno Rocha wrote: > No more need to use lical_import it is deprecated. Newest web2py has a > custom importer which works much better. > Thanks Johann -- May grace and peace be yours in abundance through the full knowledge of God and of Jesus our Lord! His divine po

[web2py] uuid - Postgresql-type

2011-08-23 Thread Johann Spies
At the moment a uuid-field in a Web2py-models generates a definition like this in a Postgresql table: uuid character varying(64) NOT NULL Postgresql has got a UUID-type. Is there a way that DAL can be adapted to utilise that in stead? Regards Johann -- May grace and peace be yours in abunda

[web2py] request.vars, request.args, next (redirecting)

2011-08-23 Thread Johann Spies
The following scenario illustrated to me that I do not understand enough of what web2py is doing in the background. I want a crud.read form and a link to edit the same form (see the two functions below). At first I wanted to use the link like this: link = A('Edit', _href=URL(c='default', f='edit

Re: [web2py] Re: request.vars, request.args, next (redirecting)

2011-08-23 Thread Johann Spies
On 23 August 2011 15:31, Massimo Di Pierro wrote: > I thnk in some places you use request.vars.id and in other places you > use request.args(0) and that is the confusion. Try this: > > Thanks. Regards Johann -- May grace and peace be yours in abundance through the full knowledge of God and of J

[web2py] Memory problems on Webfaction

2011-08-23 Thread Johann Spies
I experience memory usage problems on Webfaction from time to time. Even after doubling the initial configuration from 80Mb to 160Mb I get messages like intermittently this from Webfaction: Your total allowed memory is 160MB and your current memory usage is 223MB. ... zenex - 3MB - 14 days, 22:1

Re: [web2py] Re: Memory problems on Webfaction

2011-08-23 Thread Johann Spies
On 23 August 2011 21:36, Gour-Gadadhara Dasa wrote > On Tue, 23 Aug 2011 21:21:50 +0200 > Johann Spies > wrote: > > > I experience memory usage problems on Webfaction from time to time. > > Even after doubling the initial configuration from 80Mb to 160Mb I > > ge

Re: [web2py] Re: uuid - Postgresql-type

2011-08-24 Thread Johann Spies
On 24 August 2011 02:59, pbreit wrote: > That would probably require a new DAL field type which I'm guessing would > require some consideration. What advantages are you looking for? As I understand it the present field is a 64-character field. A native uuid-field would take up 128 bits. On la

Re: [web2py] Re: table, grid, smartgrid, getting better

2011-08-24 Thread Johann Spies
With this code: tabel = SQLFORM.grid(db.akb_articles) or tabel = SQLFORM.smartgrid(db.akb_articles) I get the same result except that the reference to line 1631 in sqlhtml.py is not there when I use .grid: Traceback (most recent call last): File "/home/js/web2py/gluon/restricted.py", line 194,

Re: [web2py] Re: Memory problems on Webfaction

2011-08-24 Thread Johann Spies
On 24 August 2011 11:51, robsan wrote: > Check out this thread > https://groups.google.com/group/web2py/browse_thread/thread/24b6d1b3a51eebb6 > > I followed Vasile's indications and it's working great! > > Thanks robsan. Did it make a significant difference to the memory consumption on Webfaction

Re: [web2py] Re: table, grid, smartgrid, getting better

2011-08-24 Thread Johann Spies
> > TypeError: () takes exactly 1 argument (2 given) > > It seems this is only when I use certain models. With some other it works nicely. Further experimentation showed that if I removed *format = lambda r: r.nameor T("Unknown") * as well as a *.represent*-line using lambda to show a link it wor

Re: [web2py] Re: Memory problems on Webfaction

2011-08-24 Thread Johann Spies
On 24 August 2011 13:27, Vasile Ermicioi wrote: > glad to see that I was helpful > my personal experience with webfaction is a great one, thanks to nginx, > uwsgi and of course web2py :) > > now uwsgi has a http protocol, and nginx installation is not needed anymore > > I will post later what and

Re: [web2py] Re: table, grid, smartgrid, getting better

2011-08-24 Thread Johann Spies
On 24 August 2011 13:47, Massimo Di Pierro wrote: > Feature! > > it used to be that represent = lambda value:... > but then we moved on to represent = lambda value, row:... > > previous code has been made backward compatible (will accept both) but > new code (grid and smartgrid) will expect the ne

Re: [web2py] Re: table, grid, smartgrid, getting better

2011-08-24 Thread Johann Spies
> TypeError: () takes exactly 1 argument (2 given) > > > I still get this error with the following model (all 'represent' lines commented out): db.define_table('akb_articles', Field('title'), Field('primaryauthor'), Field('authors', 'text'),

[web2py] How to use SQLFORM.grid

2011-08-24 Thread Johann Spies
The following is not working. What is the syntax suppose to be? def journal_grid(): query = db.akb_journal.publisher == db.akb_publisher.uuid fields = [db.akb_journal.title,db.akb_journal.standard_name, db.akb_journal.issn, db.akb_journal.abbrev_iso, db.akb_pub

[web2py] New 'represent' syntax

2011-08-25 Thread Johann Spies
Please help me to understand how to use the new syntax. How do I have to change the following code to work? def rp(author): an = db(db.akb_reprint.uuid==author).select(db.akb_reprint.rp_author) if len(an): a_name = an.first()['rp_author'] else: a_name = 'No rp_author

Re: [web2py] Re: How to use SQLFORM.grid

2011-08-25 Thread Johann Spies
On 24 August 2011 18:33, Massimo Di Pierro wrote: > I think you want: > > def journal_grid(): >query = db.akb_journal.publisher == db.akb_publisher.uuid >fields = [db.akb_journal.title,db.akb_journal.standard_name, > db.akb_journal.issn, db.akb_journal.abbrev_iso, >

Re: [web2py] Re: New 'represent' syntax

2011-08-26 Thread Johann Spies
Thanks. It will be very helpful if somebody can update these lines in the book because it still not clear to me how to use the new syntax in each of these instances. I still do not know how 'record' is defined here. db.mytable.name.represent = lambda name: name.capitalize() db.mytable.other_id

Re: [web2py] Re: New 'represent' syntax

2011-08-26 Thread Johann Spies
Hallo Martín, Thanks for your reply. Unfortunately the problem persists: I have in Massimo's demo code for the SQLFORM.smartgrid/grid: def index(): db.define_table('person',Field('name'),format='%(name)s') db.define_table('dog',Field('name'),Field('owner',db.person),format='%(name)s')

[web2py] Using SQLFORM.grid with large datasets

2013-04-17 Thread Johann Spies
By large datasets I mean a database of which one of the tables contain more than 42 million records. Using SQLFORM.grid on such a dataset is very slow because the process wants to count the total number of records. I am using Postgresql. I can get an estimated size of the table by replacing coun

Re: [web2py] display logo pic in header top

2013-04-18 Thread Johann Spies
I have the following in models/0.py: settings.title =CENTER(IMG(_src=URL('static','images/us_crest_comb.png'), _style="height:120px; width:auto;", _alt=T('US-Crest-logo'))) and in menu.py: response.title = settings.title Read the file views/layo

Re: [web2py] display logo pic in header top

2013-04-18 Thread Johann Spies
Apologies, I misread your mail. Niphlod's answer is the correct one for your purposes. On 18 April 2013 11:11, Johann Spies wrote: > I have the following in models/0.py: > > settings.title =CENTER(IMG(_src=URL('static','images/us_crest_comb.png'), >

Re: [web2py] Re: Using SQLFORM.grid with large datasets

2013-04-18 Thread Johann Spies
Thanks. I will test your suggestions. I am currently working with Postgresql 9.1 and it takes nearly 5 minutes to count a table > 42 000 000 records. It will if we can have the option in the grid to not do a count of the result as it is part of the problem in my case. If for instance the query

<    4   5   6   7   8   9   10   11   12   >