Re: [web2py] Re: generated multilevel menu

2010-05-17 Thread Julius Minka
Thanks,
it works. I placed it into models directory. Is that right?
Julius

V Pondelok, 26. apríl 2010 o 17:05 -0700, mdipierro napísal(a):
> Something like
> 
> def build_menu()::
> root=0 # assumes the root has parent_id=0
> keys={root:UL()}
> items=db(db.category.id>0).select(orderby=db.category.parent_id|
> db.category.name)
> for item in items:
>  keys[item.id]=ul=UL()
>  keys[item.parent_id].append(LI(A(item.name,_href='#'),ul)
> return keys[root]
> 
> {{=build_menu()}}
> 
> On Apr 26, 12:31 pm, Julius Minka  wrote:
> > I have to implement following 4-level menu in my view:
> >
> > 
> > Level1a
> > Level1b
> > Level1c*
> >   
> >   Level2a*
> > 
> >   Level3a*
> >   
> >   Level4a
> >   Level4b
> >   Level4c
> > 
> >   
> >   Level3b
> >   Level3c
> >   Level3d
> > 
> >
> >Level2b
> >Level2c
> >Level2d
> > 
> > 
> > 
> >
> > This menu should be dynamically generated from DB
> > Respective table looks as follows:
> >
> > db.define_table('category',
> >   Field('name', 'string', length=40, required=True, notnull=False,
> > unique=True),
> >   Field('parent_id', 'reference category', length=5, required=False,
> > notnull=False))
> > db.category.parent_id.requires=IS_NULL_OR(IS_IN_DB(db,'category.id','
> > %(name)s'))
> >
> > Menu items on the first level have no parents, all items on next levels
> > define one. I can change the table if required.
> >
> > Can somebody suggest a good approach for doing this?
> >
> > Thanks,
> > Julius
> >
> > --
> > Subscription settings:http://groups.google.com/group/web2py/subscribe?hl=en




[web2py] shared hosting again

2010-05-25 Thread Julius Minka
I tried to make it work on local hosting based on this (before I already
failed with some other guides):
http://www.web2pyslices.com/main/slices/take_slice/68
Earlier I verified, I can run simple python script, I got result to the
browser.

Now I prepared environment as you cam see here:
---
 ../local/bin/python -v
# installing zipimport hook
import zipimport # builtin
# installed zipimport hook
# /hosting/example.com/web2py/../local/lib/python2.5/site.pyc
matches /hosting/example.com/web2py/../local/lib/python2.5/site.py
import site # precompiled
from /hosting/example.com/web2py/../local/lib/python2.5/site.pyc
# /hosting/example.com/web2py/../local/lib/python2.5/os.pyc
matches /hosting/example.com/web2py/../local/lib/python2.5/os.py
import os # precompiled
from /hosting/example.com/web2py/../local/lib/python2.5/os.pyc
import errno # builtin
import posix # builtin
# /hosting/example.com/web2py/../local/lib/python2.5/posixpath.pyc
matches /hosting/example.com/web2py/../local/lib/python2.5/posixpath.py
import posixpath # precompiled
from /hosting/example.com/web2py/../local/lib/python2.5/posixpath.pyc
# /hosting/example.com/web2py/../local/lib/python2.5/stat.pyc
matches /hosting/example.com/web2py/../local/lib/python2.5/stat.py
import stat # precompiled
from /hosting/example.com/web2py/../local/lib/python2.5/stat.pyc
# /hosting/example.com/web2py/../local/lib/python2.5/UserDict.pyc
matches /hosting/example.com/web2py/../local/lib/python2.5/UserDict.py
import UserDict # precompiled
from /hosting/example.com/web2py/../local/lib/python2.5/UserDict.pyc
# /hosting/example.com/web2py/../local/lib/python2.5/copy_reg.pyc
matches /hosting/example.com/web2py/../local/lib/python2.5/copy_reg.py
import copy_reg # precompiled
from /hosting/example.com/web2py/../local/lib/python2.5/copy_reg.pyc
# /hosting/example.com/web2py/../local/lib/python2.5/types.pyc
matches /hosting/example.com/web2py/../local/lib/python2.5/types.py
import types # precompiled
from /hosting/example.com/web2py/../local/lib/python2.5/types.pyc
import _types # builtin
# zipimport: found 78 names
in 
/hosting/example.com/local/lib/python2.5/site-packages/setuptools-0.6c11-py2.5.egg
# zipimport: found 37 names
in 
/hosting/example.com/local/lib/python2.5/site-packages/MySQL_python-1.2.3c1-py2.5-linux-i686.egg
# zipimport: found 48 names
in 
/hosting/example.com/local/lib/python2.5/site-packages/flup-1.0.3.dev_20100221-py2.5.egg
# zipimport: found 11 names
in 
/hosting/example.com/local/lib/python2.5/site-packages/hashlib-20081119-py2.5-linux-i686.egg
# zipimport: found 7 names
in /hosting/example.com/local/lib/python2.5/site-packages/uuid-1.30-py2.5.egg
# /usr/lib/python2.5/warnings.pyc matches /usr/lib/python2.5/warnings.py
import warnings # precompiled from /usr/lib/python2.5/warnings.pyc
# /usr/lib/python2.5/linecache.pyc
matches /usr/lib/python2.5/linecache.py
import linecache # precompiled from /usr/lib/python2.5/linecache.pyc
import encodings #
directory /hosting/example.com/local/lib/python2.5/encodings
# /hosting/example.com/local/lib/python2.5/encodings/__init__.pyc
matches /hosting/example.com/local/lib/python2.5/encodings/__init__.py
import encodings # precompiled
from /hosting/example.com/local/lib/python2.5/encodings/__init__.pyc
# /hosting/example.com/local/lib/python2.5/codecs.pyc
matches /hosting/example.com/local/lib/python2.5/codecs.py
import codecs # precompiled
from /hosting/example.com/local/lib/python2.5/codecs.pyc
import _codecs # builtin
# /hosting/example.com/local/lib/python2.5/encodings/aliases.pyc
matches /hosting/example.com/local/lib/python2.5/encodings/aliases.py
import encodings.aliases # precompiled
from /hosting/example.com/local/lib/python2.5/encodings/aliases.pyc
# /hosting/example.com/local/lib/python2.5/encodings/latin_1.pyc
matches /hosting/example.com/local/lib/python2.5/encodings/latin_1.py
import encodings.latin_1 # precompiled
from /hosting/example.com/local/lib/python2.5/encodings/latin_1.pyc
Python 2.5.2 (r252:60911, Mar  1 2008, 13:52:45) 
[GCC 4.2.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
dlopen("/hosting/example.com/local/lib/python2.5/lib-dynload/readline.so", 2);
import readline # dynamically loaded
from /hosting/example.com/local/lib/python2.5/lib-dynload/readline.so
---

web2py is on the server in /web2py directory

when running ./web2py.py
---
web2py Enterprise Web Framework
Created by Massimo Di Pierro, Copyright 2007-2010
Version 1.78.3 (2010-05-17 21:59:39)
Database drivers available: 
Starting hardcron...
WARNING:root:GUI not available because Tk library is not installed
choose a password:
please visit:
http://127.0.0.1:8000
use "kill -SIGTERM 31467" to shutdown the web2py server
---
No database drivers available. Why? MySQL_python has been installed.

When running ./web2py.fcgi 
> ---
> WSGIServer: missing FastCGI param REQUEST_METHOD required by WSGI!
> WSGIServer: missing FastCGI param SERVER_NAME required b

[web2py] postgresql connection problem

2010-05-26 Thread Julius Minka
This is virtual server with centos 5.5 in internet.
I have successfully instaled web2py with Apache and mod_wsgi based
mainly on instructions from 
http://web2py.com/AlterEgo/default/show/239 and 
http://web2py.com/AlterEgo/default/show/240

Probably last step is missing.
I am getting this error when accessing site from internet:
RuntimeError: Failure to connect to DB. Tried 5 times

when I start it from command line, it shows support for PostgreSQL:
python2.6 web2py/web2py.py -i xx.xx.xx.xx -p  -a password

web2py Enterprise Web Framework
Created by Massimo Di Pierro, Copyright 2007-2010
Version 1.78.3 (2010-05-17 21:59:39)
Database drivers available: PostgreSQL
Starting hardcron...
WARNING:root:GUI not available because Tk library is not installed
please visit:
http://..


I can verify access from command line:
psql -U w2p -d w2p -h 127.0.0.1 -p 5432
Password for user w2p: 
Welcome to psql 8.1.21, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
   \h for help with SQL commands
   \? for help with psql commands
   \g or terminate with semicolon to execute query
   \q to quit

w2p=# \q

It works.


In ... web2py/applications/welcome/models/db.py
db = DAL('postgres://w2p:passw...@127.0.0.1:5432/w2p')

What could be the problem? I have no further idea how to verify the
reason for failure of connection.

Julius




Re: [web2py] postgresql connection problem

2010-05-27 Thread Julius Minka
I did that as first thing. No luck.
I changed it to IP as I it works from command line.

Julius

V Streda, 26. máj 2010 o 19:41 -0500, Thadeus Burgess napísal(a):
> Try
> 
> postgres://w2p:passw...@localhost:5432/w2p
> 
> --
> Thadeus
> 
> 
> 
> 
> 
> On Wed, May 26, 2010 at 5:17 PM, Julius Minka  wrote:
> > This is virtual server with centos 5.5 in internet.
> > I have successfully instaled web2py with Apache and mod_wsgi based
> > mainly on instructions from
> > http://web2py.com/AlterEgo/default/show/239 and
> > http://web2py.com/AlterEgo/default/show/240
> >
> > Probably last step is missing.
> > I am getting this error when accessing site from internet:
> > RuntimeError: Failure to connect to DB. Tried 5 times
> >
> > when I start it from command line, it shows support for PostgreSQL:
> > python2.6 web2py/web2py.py -i xx.xx.xx.xx -p  -a password
> >
> > web2py Enterprise Web Framework
> > Created by Massimo Di Pierro, Copyright 2007-2010
> > Version 1.78.3 (2010-05-17 21:59:39)
> > Database drivers available: PostgreSQL
> > Starting hardcron...
> > WARNING:root:GUI not available because Tk library is not installed
> > please visit:
> >http://..
> >
> >
> > I can verify access from command line:
> > psql -U w2p -d w2p -h 127.0.0.1 -p 5432
> > Password for user w2p:
> > Welcome to psql 8.1.21, the PostgreSQL interactive terminal.
> >
> > Type:  \copyright for distribution terms
> >   \h for help with SQL commands
> >   \? for help with psql commands
> >   \g or terminate with semicolon to execute query
> >   \q to quit
> >
> > w2p=# \q
> >
> > It works.
> >
> >
> > In ... web2py/applications/welcome/models/db.py
> > db = DAL('postgres://w2p:passw...@127.0.0.1:5432/w2p')
> >
> > What could be the problem? I have no further idea how to verify the
> > reason for failure of connection.
> >
> > Julius
> >
> >
> >




Re: [web2py] postgresql connection problem - SOLVED

2010-05-27 Thread Julius Minka
I found the reason by removing exception catching when connecting to
Postgres in gluon/sql.py.
It told me that this line
self._execute("SET standard_conforming_strings=on;")
is a problem.
I commented it out and everything is fine until now.
Can this removal have a side effect?
Julius


V Štvrtok, 27. máj 2010 o 10:41 +0200, Julius Minka napísal(a):
> I did that as first thing. No luck.
> I changed it to IP as I it works from command line.
> 
> Julius
> 
> V Streda, 26. máj 2010 o 19:41 -0500, Thadeus Burgess napísal(a):
> > Try
> > 
> > postgres://w2p:passw...@localhost:5432/w2p
> > 
> > --
> > Thadeus
> > 
> > 
> > 
> > 
> > 
> > On Wed, May 26, 2010 at 5:17 PM, Julius Minka  wrote:
> > > This is virtual server with centos 5.5 in internet.
> > > I have successfully instaled web2py with Apache and mod_wsgi based
> > > mainly on instructions from
> > > http://web2py.com/AlterEgo/default/show/239 and
> > > http://web2py.com/AlterEgo/default/show/240
> > >
> > > Probably last step is missing.
> > > I am getting this error when accessing site from internet:
> > > RuntimeError: Failure to connect to DB. Tried 5 times
> > >
> > > when I start it from command line, it shows support for PostgreSQL:
> > > python2.6 web2py/web2py.py -i xx.xx.xx.xx -p  -a password
> > >
> > > web2py Enterprise Web Framework
> > > Created by Massimo Di Pierro, Copyright 2007-2010
> > > Version 1.78.3 (2010-05-17 21:59:39)
> > > Database drivers available: PostgreSQL
> > > Starting hardcron...
> > > WARNING:root:GUI not available because Tk library is not installed
> > > please visit:
> > >http://..
> > >
> > >
> > > I can verify access from command line:
> > > psql -U w2p -d w2p -h 127.0.0.1 -p 5432
> > > Password for user w2p:
> > > Welcome to psql 8.1.21, the PostgreSQL interactive terminal.
> > >
> > > Type:  \copyright for distribution terms
> > >   \h for help with SQL commands
> > >   \? for help with psql commands
> > >   \g or terminate with semicolon to execute query
> > >   \q to quit
> > >
> > > w2p=# \q
> > >
> > > It works.
> > >
> > >
> > > In ... web2py/applications/welcome/models/db.py
> > > db = DAL('postgres://w2p:passw...@127.0.0.1:5432/w2p')
> > >
> > > What could be the problem? I have no further idea how to verify the
> > > reason for failure of connection.
> > >
> > > Julius
> > >
> > >
> > >
> 
> 




Re: [web2py] postgresql connection problem -

2010-05-27 Thread Julius Minka
I was too fast.
It works when accessed on port.

It doesn't when accessed through mod_wsgi:

File "gluon/sql.py", line 3835, in DAL
migrate=migrate, fake_migrate=fake_migrate)
  File "gluon/sql.py", line 959, in __init__
self._pool_connection(lambda : psycopg2.connect(msg))
  File "gluon/sql.py", line 830, in _pool_connection
self._connection = f()
  File "gluon/sql.py", line 959, in 
self._pool_connection(lambda : psycopg2.connect(msg))
NameError: global name 'psycopg2' is not defined

how are both environments different?
Julius




V Štvrtok, 27. máj 2010 o 12:20 +0200, Julius Minka napísal(a):
> I found the reason by removing exception catching when connecting to
> Postgres in gluon/sql.py.
> It told me that this line
>   self._execute("SET standard_conforming_strings=on;")
> is a problem.
> I commented it out and everything is fine until now.
> Can this removal have a side effect?
> Julius
> 
> 
> V Štvrtok, 27. máj 2010 o 10:41 +0200, Julius Minka napísal(a):
> > I did that as first thing. No luck.
> > I changed it to IP as I it works from command line.
> > 
> > Julius
> > 
> > V Streda, 26. máj 2010 o 19:41 -0500, Thadeus Burgess napísal(a):
> > > Try
> > > 
> > > postgres://w2p:passw...@localhost:5432/w2p
> > > 
> > > --
> > > Thadeus
> > > 
> > > 
> > > 
> > > 
> > > 
> > > On Wed, May 26, 2010 at 5:17 PM, Julius Minka  wrote:
> > > > This is virtual server with centos 5.5 in internet.
> > > > I have successfully instaled web2py with Apache and mod_wsgi based
> > > > mainly on instructions from
> > > > http://web2py.com/AlterEgo/default/show/239 and
> > > > http://web2py.com/AlterEgo/default/show/240
> > > >
> > > > Probably last step is missing.
> > > > I am getting this error when accessing site from internet:
> > > > RuntimeError: Failure to connect to DB. Tried 5 times
> > > >
> > > > when I start it from command line, it shows support for PostgreSQL:
> > > > python2.6 web2py/web2py.py -i xx.xx.xx.xx -p  -a password
> > > >
> > > > web2py Enterprise Web Framework
> > > > Created by Massimo Di Pierro, Copyright 2007-2010
> > > > Version 1.78.3 (2010-05-17 21:59:39)
> > > > Database drivers available: PostgreSQL
> > > > Starting hardcron...
> > > > WARNING:root:GUI not available because Tk library is not installed
> > > > please visit:
> > > >http://..
> > > >
> > > >
> > > > I can verify access from command line:
> > > > psql -U w2p -d w2p -h 127.0.0.1 -p 5432
> > > > Password for user w2p:
> > > > Welcome to psql 8.1.21, the PostgreSQL interactive terminal.
> > > >
> > > > Type:  \copyright for distribution terms
> > > >   \h for help with SQL commands
> > > >   \? for help with psql commands
> > > >   \g or terminate with semicolon to execute query
> > > >   \q to quit
> > > >
> > > > w2p=# \q
> > > >
> > > > It works.
> > > >
> > > >
> > > > In ... web2py/applications/welcome/models/db.py
> > > > db = DAL('postgres://w2p:passw...@127.0.0.1:5432/w2p')
> > > >
> > > > What could be the problem? I have no further idea how to verify the
> > > > reason for failure of connection.
> > > >
> > > > Julius
> > > >
> > > >
> > > >
> > 
> > 
> 
> 




Re: [web2py] postgresql connection problem -

2010-05-27 Thread Julius Minka
I found something in the archive.
This seems to be multiple python versions issue, but still do not have a
solution. Unfortunately, this server is preinstalled with python2.4 and
I am trying to use 2.6, which can't be probably found under mod_wsgi
Julius


V Štvrtok, 27. máj 2010 o 12:54 +0200, Julius Minka napísal(a):
> I was too fast.
> It works when accessed on port.
> 
> It doesn't when accessed through mod_wsgi:
> 
> File "gluon/sql.py", line 3835, in DAL
> migrate=migrate, fake_migrate=fake_migrate)
>   File "gluon/sql.py", line 959, in __init__
> self._pool_connection(lambda : psycopg2.connect(msg))
>   File "gluon/sql.py", line 830, in _pool_connection
> self._connection = f()
>   File "gluon/sql.py", line 959, in 
> self._pool_connection(lambda : psycopg2.connect(msg))
> NameError: global name 'psycopg2' is not defined
> 
> how are both environments different?
> Julius
> 
> 
> 
> 
> V Štvrtok, 27. máj 2010 o 12:20 +0200, Julius Minka napísal(a):
> > I found the reason by removing exception catching when connecting to
> > Postgres in gluon/sql.py.
> > It told me that this line
> > self._execute("SET standard_conforming_strings=on;")
> > is a problem.
> > I commented it out and everything is fine until now.
> > Can this removal have a side effect?
> > Julius
> > 
> > 
> > V Štvrtok, 27. máj 2010 o 10:41 +0200, Julius Minka napísal(a):
> > > I did that as first thing. No luck.
> > > I changed it to IP as I it works from command line.
> > > 
> > > Julius
> > > 
> > > V Streda, 26. máj 2010 o 19:41 -0500, Thadeus Burgess napísal(a):
> > > > Try
> > > > 
> > > > postgres://w2p:passw...@localhost:5432/w2p
> > > > 
> > > > --
> > > > Thadeus
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > On Wed, May 26, 2010 at 5:17 PM, Julius Minka  wrote:
> > > > > This is virtual server with centos 5.5 in internet.
> > > > > I have successfully instaled web2py with Apache and mod_wsgi based
> > > > > mainly on instructions from
> > > > > http://web2py.com/AlterEgo/default/show/239 and
> > > > > http://web2py.com/AlterEgo/default/show/240
> > > > >
> > > > > Probably last step is missing.
> > > > > I am getting this error when accessing site from internet:
> > > > > RuntimeError: Failure to connect to DB. Tried 5 times
> > > > >
> > > > > when I start it from command line, it shows support for PostgreSQL:
> > > > > python2.6 web2py/web2py.py -i xx.xx.xx.xx -p  -a password
> > > > >
> > > > > web2py Enterprise Web Framework
> > > > > Created by Massimo Di Pierro, Copyright 2007-2010
> > > > > Version 1.78.3 (2010-05-17 21:59:39)
> > > > > Database drivers available: PostgreSQL
> > > > > Starting hardcron...
> > > > > WARNING:root:GUI not available because Tk library is not installed
> > > > > please visit:
> > > > >http://..
> > > > >
> > > > >
> > > > > I can verify access from command line:
> > > > > psql -U w2p -d w2p -h 127.0.0.1 -p 5432
> > > > > Password for user w2p:
> > > > > Welcome to psql 8.1.21, the PostgreSQL interactive terminal.
> > > > >
> > > > > Type:  \copyright for distribution terms
> > > > >   \h for help with SQL commands
> > > > >   \? for help with psql commands
> > > > >   \g or terminate with semicolon to execute query
> > > > >   \q to quit
> > > > >
> > > > > w2p=# \q
> > > > >
> > > > > It works.
> > > > >
> > > > >
> > > > > In ... web2py/applications/welcome/models/db.py
> > > > > db = DAL('postgres://w2p:passw...@127.0.0.1:5432/w2p')
> > > > >
> > > > > What could be the problem? I have no further idea how to verify the
> > > > > reason for failure of connection.
> > > > >
> > > > > Julius
> > > > >
> > > > >
> > > > >
> > > 
> > > 
> > 
> > 
> 
> 




Re: [web2py] Re: form[0] insert

2010-06-08 Thread Julius Minka
Can this be used to modify a value of an element?
I remember I have tried in the past and I failed. The goal was to
display just first 10 characters of longer field in the WebGrid by
Mr.Freeze.

Julius

V Pondelok, 7. jún 2010 o 23:32 -0700, annet napísal(a):
> Massimo,
> 
> Indeed it was easier to use form.element(...), thanks for providing me
> with this solution.
> 
> 
> Annet.
> 
> On Jun 7, 8:13 pm, mdipierro  wrote:
> > form[0] #table
> > form[0][21] # 22nd row
> > form[0][21][1] #  second column of above row
> > form[0][21][1].insert(0,H4('Text'))
> >
> > but it should be easier to do
> >
> > form.element('input[name=xxx]').parent.insert(0,H4('Text'))
> >
> > where 'xxx' is the name of the field variable.
> >
> > On Jun 7, 4:24 am, annet  wrote:
> >
> > > I am using this:
> >
> > > form[0].insert(21,TR(H4('Text')))
> >
> > > to insert headers between rows. The header is being inserted in the
> > > first column of the form. I would like to insert an explanatory text
> > > into the second column of a particular row, is that possible using
> > > this syntax, if so, what is the correct syntax.
> >
> > > Kind regards,
> >
> > > Annet.




Re: [web2py] Re: form[0] insert

2010-06-08 Thread Julius Minka
The default Webgrid doesn't have a separate div for a field.
Is CSS identification only way to access/change the value?

I tried this, it doesn't work:

tmp=grid()[0][line][9+activity][0][0:10]  #this works
grid()[0][line][9+activity]['_value']=tmp  #this doesn't


V Utorok, 8. jún 2010 o 06:20 -0700, mdipierro napísal(a):
> yes
> 
> form.element('div#id.class')['_value']=45
> 
> On Jun 8, 7:46 am, Julius Minka  wrote:
> > Can this be used to modify a value of an element?
> > I remember I have tried in the past and I failed. The goal was to
> > display just first 10 characters of longer field in the WebGrid by
> > Mr.Freeze.
> >
> > Julius
> >
> > V Pondelok, 7. jún 2010 o 23:32 -0700, annet napísal(a):
> >
> > > Massimo,
> >
> > > Indeed it was easier to use form.element(...), thanks for providing me
> > > with this solution.
> >
> > > Annet.
> >
> > > On Jun 7, 8:13 pm, mdipierro  wrote:
> > > > form[0] #table
> > > > form[0][21] # 22nd row
> > > > form[0][21][1] #  second column of above row
> > > > form[0][21][1].insert(0,H4('Text'))
> >
> > > > but it should be easier to do
> >
> > > > form.element('input[name=xxx]').parent.insert(0,H4('Text'))
> >
> > > > where 'xxx' is the name of the field variable.
> >
> > > > On Jun 7, 4:24 am, annet  wrote:
> >
> > > > > I am using this:
> >
> > > > > form[0].insert(21,TR(H4('Text')))
> >
> > > > > to insert headers between rows. The header is being inserted in the
> > > > > first column of the form. I would like to insert an explanatory text
> > > > > into the second column of a particular row, is that possible using
> > > > > this syntax, if so, what is the correct syntax.
> >
> > > > > Kind regards,
> >
> > > > > Annet.




Re: [web2py] Re: form[0] insert

2010-06-08 Thread Julius Minka
Thanks for your response,
I know, but that changes it everythere, even if I display just one
record on the page (read of crud).
I need to shorten the value of the field only in the grid, so that the
grid is not too wide.

V Utorok, 8. jún 2010 o 08:28 -0700, mr.freeze napísal(a):
> WebGrid uses the represent function to display your field. You can do:
> db.table.field.represent = lambda v: v[:10] + '...'
> 
> On Jun 8, 10:11 am, Julius Minka  wrote:
> > The default Webgrid doesn't have a separate div for a field.
> > Is CSS identification only way to access/change the value?
> >
> > I tried this, it doesn't work:
> >
> > tmp=grid()[0][line][9+activity][0][0:10]  #this works
> > grid()[0][line][9+activity]['_value']=tmp  #this doesn't
> >
> > V Utorok, 8. jún 2010 o 06:20 -0700, mdipierro napísal(a):
> >
> > > yes
> >
> > > form.element('div#id.class')['_value']=45
> >
> > > On Jun 8, 7:46 am, Julius Minka  wrote:
> > > > Can this be used to modify a value of an element?
> > > > I remember I have tried in the past and I failed. The goal was to
> > > > display just first 10 characters of longer field in the WebGrid by
> > > > Mr.Freeze.
> >
> > > > Julius
> >
> > > > V Pondelok, 7. jún 2010 o 23:32 -0700, annet napísal(a):
> >
> > > > > Massimo,
> >
> > > > > Indeed it was easier to use form.element(...), thanks for providing me
> > > > > with this solution.
> >
> > > > > Annet.
> >
> > > > > On Jun 7, 8:13 pm, mdipierro  wrote:
> > > > > > form[0] #table
> > > > > > form[0][21] # 22nd row
> > > > > > form[0][21][1] #  second column of above row
> > > > > > form[0][21][1].insert(0,H4('Text'))
> >
> > > > > > but it should be easier to do
> >
> > > > > > form.element('input[name=xxx]').parent.insert(0,H4('Text'))
> >
> > > > > > where 'xxx' is the name of the field variable.
> >
> > > > > > On Jun 7, 4:24 am, annet  wrote:
> >
> > > > > > > I am using this:
> >
> > > > > > > form[0].insert(21,TR(H4('Text')))
> >
> > > > > > > to insert headers between rows. The header is being inserted in 
> > > > > > > the
> > > > > > > first column of the form. I would like to insert an explanatory 
> > > > > > > text
> > > > > > > into the second column of a particular row, is that possible using
> > > > > > > this syntax, if so, what is the correct syntax.
> >
> > > > > > > Kind regards,
> >
> > > > > > > Annet.




Re: [web2py] Re: form[0] insert

2010-06-08 Thread Julius Minka
Thank you very much.
First solution works for me.


V Utorok, 8. jún 2010 o 08:59 -0700, mr.freeze napísal(a):
> Just turn it off after you're done:
> 
> db.table.field.represent = lambda v: v[:10] + '...'
> grid = webgrid.WebGrid(...)
> output = grid()
> db.table.field.represent = None
> 
> Also you can do:
> def shorten_field(r,fieldtype, row):
> if fieldtype=='datarow':
> find your field and shorten it
> grid.row_created = shorten_field
> 
> 
> On Jun 8, 10:40 am, Julius Minka  wrote:
> > Thanks for your response,
> > I know, but that changes it everythere, even if I display just one
> > record on the page (read of crud).
> > I need to shorten the value of the field only in the grid, so that the
> > grid is not too wide.
> >
> > V Utorok, 8. jún 2010 o 08:28 -0700, mr.freeze napísal(a):
> >
> > > WebGrid uses the represent function to display your field. You can do:
> > > db.table.field.represent = lambda v: v[:10] + '...'
> >
> > > On Jun 8, 10:11 am, Julius Minka  wrote:
> > > > The default Webgrid doesn't have a separate div for a field.
> > > > Is CSS identification only way to access/change the value?
> >
> > > > I tried this, it doesn't work:
> >
> > > > tmp=grid()[0][line][9+activity][0][0:10]  #this works
> > > > grid()[0][line][9+activity]['_value']=tmp  #this doesn't
> >
> > > > V Utorok, 8. jún 2010 o 06:20 -0700, mdipierro napísal(a):
> >
> > > > > yes
> >
> > > > > form.element('div#id.class')['_value']=45
> >
> > > > > On Jun 8, 7:46 am, Julius Minka  wrote:
> > > > > > Can this be used to modify a value of an element?
> > > > > > I remember I have tried in the past and I failed. The goal was to
> > > > > > display just first 10 characters of longer field in the WebGrid by
> > > > > > Mr.Freeze.
> >
> > > > > > Julius
> >
> > > > > > V Pondelok, 7. jún 2010 o 23:32 -0700, annet napísal(a):
> >
> > > > > > > Massimo,
> >
> > > > > > > Indeed it was easier to use form.element(...), thanks for 
> > > > > > > providing me
> > > > > > > with this solution.
> >
> > > > > > > Annet.
> >
> > > > > > > On Jun 7, 8:13 pm, mdipierro  wrote:
> > > > > > > > form[0] #table
> > > > > > > > form[0][21] # 22nd row
> > > > > > > > form[0][21][1] #  second column of above row
> > > > > > > > form[0][21][1].insert(0,H4('Text'))
> >
> > > > > > > > but it should be easier to do
> >
> > > > > > > > form.element('input[name=xxx]').parent.insert(0,H4('Text'))
> >
> > > > > > > > where 'xxx' is the name of the field variable.
> >
> > > > > > > > On Jun 7, 4:24 am, annet  wrote:
> >
> > > > > > > > > I am using this:
> >
> > > > > > > > > form[0].insert(21,TR(H4('Text')))
> >
> > > > > > > > > to insert headers between rows. The header is being inserted 
> > > > > > > > > in the
> > > > > > > > > first column of the form. I would like to insert an 
> > > > > > > > > explanatory text
> > > > > > > > > into the second column of a particular row, is that possible 
> > > > > > > > > using
> > > > > > > > > this syntax, if so, what is the correct syntax.
> >
> > > > > > > > > Kind regards,
> >
> > > > > > > > > Annet.




Re: [web2py] Re: my app instead of welcome app???

2010-06-16 Thread Julius Minka
V Utorok, 15. jún 2010 o 15:51 -0700, Yarko Tymciurak napísal(a):
> I think the simpler solution (simpler than routes.py) is - when
> deploying, link your app to applicaitons/init --- it is simple, it
> will behave as you want, and the only "operating system" that I can
> think of that doesn't have directory level symbolic links is
> (possibly)   Windows. 

It exists in Windows and it is called junction.
Julius



[web2py] form in layout.html?

2010-06-18 Thread Julius Minka
I need a contact form (name, address,...) on every page of a web site.
Thinking about putting the form into layout.html and use some Ajax to
send entered values to be processed by a controller. I would like to
avoid page reload on form submission.

I found 2 possible solutions in the archive:
1.
http://groups.google.com/group/web2py/browse_thread/thread/f162f35e4a84ee48/11524d762a9b1356
Is this incomplete? How process function is called?

2.
http://groups.google.com/group/web2py/browse_thread/thread/82fad17e26e1739a/c6a9cfd878653969
I ran application mentioned in the thread. This is probably close, but
complicated.

What is good and simple approach to this issue? I do not have much
experience with Ajax.

Thanks
Julius




Re: [web2py] Re: form in layout.html?

2010-06-19 Thread Julius Minka
Thank You,

that is really simple.

Julius

V Sobota, 19. jún 2010 o 00:41 -0700, mdipierro napísal(a):
> Just do
> 
> def contact():
>  form=SQLFORM.factory()
>  if form.accepts()
>  return form # not dict(form=form)
> 
> and in layout.html
> 
> {{=LOAD('default','contact')}}
> 
> 
> 
> 
> On Jun 18, 11:26 am, Julius Minka  wrote:
> > I need a contact form (name, address,...) on every page of a web site.
> > Thinking about putting the form into layout.html and use some Ajax to
> > send entered values to be processed by a controller. I would like to
> > avoid page reload on form submission.
> >
> > I found 2 possible solutions in the archive:
> > 1.http://groups.google.com/group/web2py/browse_thread/thread/f162f35e4a...
> > Is this incomplete? How process function is called?
> >
> > 2.http://groups.google.com/group/web2py/browse_thread/thread/82fad17e26...
> > I ran application mentioned in the thread. This is probably close, but
> > complicated.
> >
> > What is good and simple approach to this issue? I do not have much
> > experience with Ajax.
> >
> > Thanks
> > Julius




Re: [web2py] Re: Little little Document Management System with flatbed scanners

2010-06-19 Thread Julius Minka
I just saw screenshots and will test application later.
For OCR, these links could be useful:
http://www.cuneiform.ru/eng/index.html
http://code.google.com/p/ocropus/
http://www.webupd8.org/2010/02/how-to-extract-all-text-from-pdfs.html



V Sobota, 19. jún 2010 o 01:58 -0700, szimszon napísal(a):
> It would be great to have OCR integrated in it :) I would like it but
> I didn't have time to search for a good and free OCR...
> 
> On jún. 19, 04:33, rochacbruno  wrote:
> > I  worked extensively with the library pytesser, and one of my
> > projects is an ECM system with OCR, I'm still working on the lower
> > level porting  tesseract lib for Mac and Linux, and creating the API.
> > this first implementation is a commercial project for one of my
> > clients, but the intention is to result in a FOSS system for scanning
> > and indexing docs via OCR, fully web based on web2py
> >
> > Let's share the ideas, maybe create something great, together
> >
> > {{ }}'s
> >
> > On 18 jun, 12:14, mdipierro  wrote:
> >
> > > Can you post a screenshot? Do you use a version control and hosting,
> > > like google code?
> >
> > > On Jun 18, 8:26 am, szimszon  wrote:
> >
> > > > Developed with web2py.
> >
> > > > Document Management System LOL :) for home use with sane compatible
> > > > flatbed scanners...
> >
> > > > There is no hierarchie among files just tags.
> >
> > > > The application make use of crud.archive.
> >
> > > > There is no document checkout or checkin.
> >
> > > > There is only basic right management (just login and the user_1 can
> > > > add and delete users).
> >
> > > > There is now only little set of scanner parameters to be set from a
> > > > fixed set of values :(
> >
> > > > It is basically written based on the needs of mine.
> >
> > > > The document scanned with scanimage converted to jpeg (Image modul) or
> > > > the jpeg's to pdf (convert program) if multiple pages are scanned.
> >
> > > > Need to edit db.py
> >
> > > > db = DAL('...')
> >
> > > > If you install the app. you need after register and login click to
> > > > "Check rights". It makes a dms group with access to database tables.
> > > > The users have to be a member of dms group to use the app. user_1
> > > > to...
> >
> > > > Than click the "Config" to specify scanimage and convert program's
> > > > path.
> >
> > > > Happy document management!
> >
> > > > Download source 
> > > > code:https://trac.oregpreshaz.eu/linux/raw-attachment/wiki/DKR/web2py.dms
> >
> >




Re: [web2py] Re: form in layout.html?

2010-06-19 Thread Julius Minka
def form():
form=SQLFORM.factory(
   Field('name', requires=IS_NOT_EMPTY()))
if form.accepts(request.vars, session):
response.flash = 'form accepted'
else:
response.flash = 'form has errors'
return form

Flash is not displayed in this place, elsewhere is working. Why? 
Or, how let user know about the result of form submission?


V Sobota, 19. jún 2010 o 00:41 -0700, mdipierro napísal(a):
> Just do
> 
> def contact():
>  form=SQLFORM.factory()
>  if form.accepts()
>  return form # not dict(form=form)
> 
> and in layout.html
> 
> {{=LOAD('default','contact')}}
> 
> 
> 
> 
> On Jun 18, 11:26 am, Julius Minka  wrote:
> > I need a contact form (name, address,...) on every page of a web site.
> > Thinking about putting the form into layout.html and use some Ajax to
> > send entered values to be processed by a controller. I would like to
> > avoid page reload on form submission.
> >
> > I found 2 possible solutions in the archive:
> > 1.http://groups.google.com/group/web2py/browse_thread/thread/f162f35e4a...
> > Is this incomplete? How process function is called?
> >
> > 2.http://groups.google.com/group/web2py/browse_thread/thread/82fad17e26...
> > I ran application mentioned in the thread. This is probably close, but
> > complicated.
> >
> > What is good and simple approach to this issue? I do not have much
> > experience with Ajax.
> >
> > Thanks
> > Julius




[web2py] OWASP Top Ten

2010-06-23 Thread Julius Minka
There is a new version here:
http://www.owasp.org/index.php/Category:OWASP_Top_Ten_Project

I wonder if it doesn't need to be reflected in the current version of
the Book or in web2py itself.
Julius



[web2py] customize form in template

2010-07-09 Thread Julius Minka
I am loading the form in the template this way:
{{=LOAD('default','form')}}

Can I somewhow customize it this way?
{{=form.custom.begin}}
Image name: {{=form.custom.widget.name}}
Click here to upload: {{=form.custom.submit}}
{{=form.custom.end}}

What I actually need is to place labels above fields.

Julius




[web2py] Re: [web2py:37631] Re: How to limit get_twits function?

2010-07-09 Thread Julius Minka
Was anybody able to resolve this issue?
Julius

V Pondelok, 21. december 2009 o 20:35 -0300, Tito Garrido napísal(a):
> Looks like it just returns 1 result for:
> http://search.twitter.com/search.atom?q=from%3Aweb2py
> 
> strange... but thanks for your answers!
> 
> On Mon, Dec 21, 2009 at 12:33 AM, mr.freeze 
> wrote:
> You should be able to search by user with from%3Auser (url
> encoded
> 'from:user') :
> http://search.twitter.com/search.json?q=from%
> 3Auser&page=1&rpp=10
> 
> On Dec 20, 8:03 pm, Tito Garrido 
> wrote:
> > I've found this link too but it doesn't work :-/
> >
> >
> >
> 
> > On Sun, Dec 20, 2009 at 5:45 PM, mdipierro
>  wrote:
> > > based on this it is rpp=10
> >
> > >http://apiwiki.twitter.com/Twitter-Search-API-Method%
> 3A-search
> >
> > > On Dec 20, 2:28 pm, Tito Garrido 
> wrote:
> > > > def get_twits():
> > > >   user='web2py'
> > > >   import gluon.tools
> > > >   import gluon.contrib.simplejson as sj
> 
> > > >   page = gluon.tools.fetch('http://twitter.com/%
> s?format=json'%user)
> >
> > > >   tweets=XML(sj.loads(page)['#timeline'])
> > > >   return dict(tweets=tweets)
> >
> > > > I'm wondering how can we limit this query for last 10
> tweets...
> >
> > > > Anybody has a clue?
> >
> > > > Thanks!
> >
> > > > --
> >
> > > > Linux User #387870
> > > > .
> > > >  _/_õ|__|
> > > > ..º[ .-.___.-._| . . . .
> > > > .__( o)__( o).:___
> >
> > > --
> >
> > > You received this message because you are subscribed to
> the Google Groups
> > > "web2py-users" group.
> > > To post to this group, send email to
> web...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> 
> > > web2py+unsubscr...@googlegroups.com 2bunsubscr...@googlegroups.com>
> 
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/web2py?hl=en.
> >
> > --
> >
> > Linux User #387870
> > .
> >  _/_õ|__|
> > ..º[ .-.___.-._| . . . .
> > .__( o)__( o).:___
> 
> --
> 
> You received this message because you are subscribed to the
> Google Groups "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to web2py
> +unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/web2py?hl=en.
> 
> 
> 
> 
> 
> 
> -- 
> 
> Linux User #387870
> .
>  _/_õ|__|
> ..º[ .-.___.-._| . . . .
> .__( o)__( o).:___
> 
> 
> --
> 
> You received this message because you are subscribed to the Google
> Groups "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to web2py
> +unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/web2py?hl=en.




Re: [web2py] Re: customize form in template

2010-07-12 Thread Julius Minka
Thanks, it was enough in this case.

V Piatok, 9. júl 2010 o 05:47 -0700, mdipierro napísal(a):
> if you just need to place labels above fields you can just do
> 
> SQLFORM(...formstyle='table2cols')
> 
> On 9 Lug, 06:25, Julius Minka  wrote:
> > I am loading the form in the template this way:
> > {{=LOAD('default','form')}}
> >
> > Can I somewhow customize it this way?
> > {{=form.custom.begin}}
> > Image name: {{=form.custom.widget.name}}
> > Click here to upload: {{=form.custom.submit}}
> > {{=form.custom.end}}
> >
> > What I actually need is to place labels above fields.
> >
> > Julius




[web2py] non empty fields in Crud Read

2010-07-26 Thread Julius Minka
Is it possible to display just lines with non-empty values in Crud Read
or readonly SQLFORM?
If not, should I do it through custom form?
Julius



[web2py] LOAD and redirect

2010-08-05 Thread Julius Minka
Having something like this 

{{=LOAD('controller','action.load',vars={},args=[],ajax=True)}}

in the layout.html
and something like this 

form=SQLFORM.factory(
   Field(...),
   Field(...),
   Field(...),
   formstyle='table2cols',submit_button='Vyhľadať')
if form.accepts(request.vars, session):
  redirect(URL(r=request,
f='2action',vars={'typ':typ}))


in action controlller.

It almost works, but instead of redirection to '2action', it displays
2action page in the space where previously the form was. URL is not
changed.

Is this expected behaviour?
How to correctly do real redirection to 2action page?

Julius



Re: [web2py] Re: LOAD and redirect

2010-08-07 Thread Julius Minka
Massimo,

I am not able to make it work.

Firstly, just little note, my original 
url=URL(r=request, f='nehnutelnosti',vars={'typ':request.vars.typ,
'okres':request.vars.okres, 'druh':request.vars.druh})

can not be used because it returns
/app/default/nehnutelnosti.load?okres=1&typ=1&druh=2

so it probably rightly doesn't redirect to the new page.

Secondly, I tried for testing purposes to construct url 'by hand', both
versions:
1. 
http://127.0.0.1:/app/default/nehnutelnosti?okres=1&typ=1&druh=2

2.
/app/default/nehnutelnosti?okres=1&typ=1&druh=2

Form disappears, but that is all what happens after submit.


Form looks following in the page source:
<!--
web2py_component("/real/default/form.load","c712094659208")
//-->loading...


What else could be the problem with redirection?
Julius



V Štvrtok, 5. august 2010 o 15:23 -0700, mdipierro napísal(a):
> This is the intended behavior.
> for now you can do
> instead of
> 
>redirect(url)
> 
> use
> 
>raise HTTP(303,**{'web2py-component-
> command':'document.location="%s"'%url})
> 
> 
> On Aug 5, 1:17 pm, Julius Minka  wrote:
> > Having something like this
> >
> > {{=LOAD('controller','action.load',vars={},args=[],ajax=True)}}
> >
> > in the layout.html
> > and something like this
> >
> > form=SQLFORM.factory(
> >Field(...),
> >Field(...),
> >Field(...),
> >formstyle='table2cols',submit_button='Vyhľadať')
> > if form.accepts(request.vars, session):
> >   redirect(URL(r=request,
> > f='2action',vars={'typ':typ}))
> >
> > in action controlller.
> >
> > It almost works, but instead of redirection to '2action', it displays
> > 2action page in the space where previously the form was. URL is not
> > changed.
> >
> > Is this expected behaviour?
> > How to correctly do real redirection to 2action page?
> >
> > Julius




Re: [web2py] Re: LOAD and redirect

2010-08-07 Thread Julius Minka
V Sobota, 7. august 2010 o 10:20 -0700, mdipierro napísal(a):
> Is your problem the presence of the .load?
> 
No, that is not the main problem.

> > url=URL(r=request, f='nehnutelnosti',vars={'typ':request.vars.typ, 
> > 'okres':request.vars.okres, 'druh':request.vars.druh})
> > can not be used because it returns
> > /app/default/nehnutelnosti.load?okres=1&typ=1&druh=2
> 
> if you you can specify URL(,extension='html')

url=URL(r=request, f='nehnutelnosti', vars={'typ':request.vars.typ,
'okres':request.vars.okres, 'druh':request.vars.druh},extension='html')

not change, result is still
/app/default/nehnutelnosti.load?okres=1&typ=1&druh=2


MAIN problem is the redirect doesn't work:
if form.accepts(request.vars, session):
url="/"+request.application
+"/default/nehnutelnosti.html?okres="+request.vars.okres
+"&typ="+request.vars.typ+"&druh="+request.vars.druh
raise HTTP(303,**{'web2py-component-command':'document.location="%s"'%
url})

Julius



> 
> 
> On Aug 7, 12:13 pm, Julius Minka  wrote:
> > Massimo,
> >
> > I am not able to make it work.
> >
> > Firstly, just little note, my original
> > url=URL(r=request, f='nehnutelnosti',vars={'typ':request.vars.typ,
> > 'okres':request.vars.okres, 'druh':request.vars.druh})
> >
> > can not be used because it returns
> > /app/default/nehnutelnosti.load?okres=1&typ=1&druh=2
> >
> > so it probably rightly doesn't redirect to the new page.
> >
> > Secondly, I tried for testing purposes to construct url 'by hand', both
> > versions:
> > 1.http://127.0.0.1:/app/default/nehnutelnosti?okres=1&typ=1&druh=2
> >
> > 2.
> > /app/default/nehnutelnosti?okres=1&typ=1&druh=2
> >
> > Form disappears, but that is all what happens after submit.
> >
> > Form looks following in the page source:
> > <!--
> > web2py_component("/real/default/form.load","c712094659208")
> > //-->loading...
> >
> > What else could be the problem with redirection?
> > Julius
> >
> > V Štvrtok, 5. august 2010 o 15:23 -0700, mdipierro napísal(a):
> >
> > > This is the intended behavior.
> > > for now you can do
> > > instead of
> >
> > >redirect(url)
> >
> > > use
> >
> > >raise HTTP(303,**{'web2py-component-
> > > command':'document.location="%s"'%url})
> >
> > > On Aug 5, 1:17 pm, Julius Minka  wrote:
> > > > Having something like this
> >
> > > > {{=LOAD('controller','action.load',vars={},args=[],ajax=True)}}
> >
> > > > in the layout.html
> > > > and something like this
> >
> > > > form=SQLFORM.factory(
> > > >Field(...),
> > > >Field(...),
> > > >Field(...),
> > > >formstyle='table2cols',submit_button='Vyhľadať')
> > > > if form.accepts(request.vars, session):
> > > >   redirect(URL(r=request,
> > > > f='2action',vars={'typ':typ}))
> >
> > > > in action controlller.
> >
> > > > It almost works, but instead of redirection to '2action', it displays
> > > > 2action page in the space where previously the form was. URL is not
> > > > changed.
> >
> > > > Is this expected behaviour?
> > > > How to correctly do real redirection to 2action page?
> >
> > > > Julius




Re: [web2py] Re: LOAD and redirect

2010-08-09 Thread Julius Minka
Yes, now I see. It is browser issue.
I am on Ubuntu Linux 10.04. 

It works on Firefox, Chromium, Konqueror.
it doesn't on Opera 10.60 and Epiphany, Midori (both are based on WebKit
rendering engine)

Hope this helps.
Julius

V Sobota, 7. august 2010 o 16:29 -0700, mdipierro napísal(a):
> I am using trunk version
> Version 1.82.1 (2010-08-04 18:57:33)
> and the code you sent me works perfectly.
> 
> Either I do not understand the problem or this is a browser issue.
> What os and browser do you use?
> 
> Massimo
> 
> On Aug 7, 2:16 pm, Julius Minka  wrote:
> > No, redirection doesn't work for me.
> > Last released version I used before was Version 1.82.1 (2010-08-05
> > 01:00:12)
> >
> > I got current trunk this way:
> > hg clonehttps://web2py.googlecode.com/hg/web2py078a
> > requesting all changes
> > adding changesets
> > adding manifests
> > adding file changes
> > added 764 changesets with 2180 changes to 733 files
> > updating to branch default
> > 588 files updated, 0 files merged, 0 files removed, 0 files unresolved
> >
> > It identifies itself as Version 1.82.1 (2010-08-04 18:57:33).
> > Attached you can find the application as I typed it from your email.
> >
> > Julius
> >
> > V Sobota, 7. august 2010 o 10:58 -0700, mdipierro napísal(a):
> >
> > > There is a problem with URL. Please check trunk and see if it solves
> > > the problem for you:
> >
> > > This works for me
> >
> > > def index():
> > >  return dict()
> >
> > > def test1():
> > >  form=SQLFORM.factory(Field('name'))
> > >  if form.accepts(request.vars,session):
> > >   url = URL('test2',extension='html')
> > >   response.headers['web2py-component-
> > > command']='document.location="%s"' % url
> > >   raise HTTP(303,**response.headers)
> > >   redirect(URL('test2'))
> > >  return dict(form=form)
> >
> > > def test2():
> > >  return dict(h=H1('hello world'))
> >
> > > with default/index.html
> >
> > > {{extend 'layout.html'}}
> > > This is a test
> > > {{=LOAD('default','test1.load',ajax=True)}}
> >
> >
> >
> >  web2py.app.test.w2p
> > 100KViewDownload




Re: [web2py] Re: LOAD and redirect

2010-08-09 Thread Julius Minka
I am not able to fix this, but I am willing to test it again if needed.
Julius

V Pondelok, 9. august 2010 o 01:28 -0700, mdipierro napísal(a):
> If you ding out what the problem is perhaps we can improve the code
> and make it more cross-browser compatible.
> 
> On Aug 9, 3:27 am, Julius Minka  wrote:
> > Yes, now I see. It is browser issue.
> > I am on Ubuntu Linux 10.04.
> >
> > It works on Firefox, Chromium, Konqueror.
> > it doesn't on Opera 10.60 and Epiphany, Midori (both are based on WebKit
> > rendering engine)
> >
> > Hope this helps.
> > Julius
> >
> > V Sobota, 7. august 2010 o 16:29 -0700, mdipierro napísal(a):
> >
> > > I am using trunk version
> > > Version 1.82.1 (2010-08-04 18:57:33)
> > > and the code you sent me works perfectly.
> >
> > > Either I do not understand the problem or this is a browser issue.
> > > What os and browser do you use?
> >
> > > Massimo
> >
> > > On Aug 7, 2:16 pm, Julius Minka  wrote:
> > > > No, redirection doesn't work for me.
> > > > Last released version I used before was Version 1.82.1 (2010-08-05
> > > > 01:00:12)
> >
> > > > I got current trunk this way:
> > > > hg clonehttps://web2py.googlecode.com/hg/web2py078a
> > > > requesting all changes
> > > > adding changesets
> > > > adding manifests
> > > > adding file changes
> > > > added 764 changesets with 2180 changes to 733 files
> > > > updating to branch default
> > > > 588 files updated, 0 files merged, 0 files removed, 0 files unresolved
> >
> > > > It identifies itself as Version 1.82.1 (2010-08-04 18:57:33).
> > > > Attached you can find the application as I typed it from your email.
> >
> > > > Julius
> >
> > > > V Sobota, 7. august 2010 o 10:58 -0700, mdipierro napísal(a):
> >
> > > > > There is a problem with URL. Please check trunk and see if it solves
> > > > > the problem for you:
> >
> > > > > This works for me
> >
> > > > > def index():
> > > > >  return dict()
> >
> > > > > def test1():
> > > > >  form=SQLFORM.factory(Field('name'))
> > > > >  if form.accepts(request.vars,session):
> > > > >   url = URL('test2',extension='html')
> > > > >   response.headers['web2py-component-
> > > > > command']='document.location="%s"' % url
> > > > >   raise HTTP(303,**response.headers)
> > > > >   redirect(URL('test2'))
> > > > >  return dict(form=form)
> >
> > > > > def test2():
> > > > >  return dict(h=H1('hello world'))
> >
> > > > > with default/index.html
> >
> > > > > {{extend 'layout.html'}}
> > > > > This is a test
> > > > > {{=LOAD('default','test1.load',ajax=True)}}
> >
> > > >  web2py.app.test.w2p
> > > > 100KViewDownload




Re: [web2py] Re: LOAD and redirect

2010-08-09 Thread Julius Minka
I didn't get any JS error.

Details:
Epiphany has Webinspector which allowed me to run JS with debugging
enabled. It didn't throw any error while doing that.

Opera has its Dragonfly which does similar things. Neither it reported
any error.


Just to note:
Opera behaves differently from Epiphany. In Epiphany, the form
disappears after submission, in Opera nothing happens, screen remains as
it was in beginning.

Julius



V Pondelok, 9. august 2010 o 02:23 -0700, mdipierro napísal(a):
> Does any of the browsers with problem have a debug feature that allow
> you to see if there is JS error?
> 
> On Aug 9, 3:48 am, Julius Minka  wrote:
> > I am not able to fix this, but I am willing to test it again if needed.
> > Julius
> >
> > V Pondelok, 9. august 2010 o 01:28 -0700, mdipierro napísal(a):
> >
> > > If you ding out what the problem is perhaps we can improve the code
> > > and make it more cross-browser compatible.
> >
> > > On Aug 9, 3:27 am, Julius Minka  wrote:
> > > > Yes, now I see. It is browser issue.
> > > > I am on Ubuntu Linux 10.04.
> >
> > > > It works on Firefox, Chromium, Konqueror.
> > > > it doesn't on Opera 10.60 and Epiphany, Midori (both are based on WebKit
> > > > rendering engine)
> >
> > > > Hope this helps.
> > > > Julius
> >
> > > > V Sobota, 7. august 2010 o 16:29 -0700, mdipierro napísal(a):
> >
> > > > > I am using trunk version
> > > > > Version 1.82.1 (2010-08-04 18:57:33)
> > > > > and the code you sent me works perfectly.
> >
> > > > > Either I do not understand the problem or this is a browser issue.
> > > > > What os and browser do you use?
> >
> > > > > Massimo
> >
> > > > > On Aug 7, 2:16 pm, Julius Minka  wrote:
> > > > > > No, redirection doesn't work for me.
> > > > > > Last released version I used before was Version 1.82.1 (2010-08-05
> > > > > > 01:00:12)
> >
> > > > > > I got current trunk this way:
> > > > > > hg clonehttps://web2py.googlecode.com/hg/web2py078a
> > > > > > requesting all changes
> > > > > > adding changesets
> > > > > > adding manifests
> > > > > > adding file changes
> > > > > > added 764 changesets with 2180 changes to 733 files
> > > > > > updating to branch default
> > > > > > 588 files updated, 0 files merged, 0 files removed, 0 files 
> > > > > > unresolved
> >
> > > > > > It identifies itself as Version 1.82.1 (2010-08-04 18:57:33).
> > > > > > Attached you can find the application as I typed it from your email.
> >
> > > > > > Julius
> >
> > > > > > V Sobota, 7. august 2010 o 10:58 -0700, mdipierro napísal(a):
> >
> > > > > > > There is a problem with URL. Please check trunk and see if it 
> > > > > > > solves
> > > > > > > the problem for you:
> >
> > > > > > > This works for me
> >
> > > > > > > def index():
> > > > > > >  return dict()
> >
> > > > > > > def test1():
> > > > > > >  form=SQLFORM.factory(Field('name'))
> > > > > > >  if form.accepts(request.vars,session):
> > > > > > >   url = URL('test2',extension='html')
> > > > > > >   response.headers['web2py-component-
> > > > > > > command']='document.location="%s"' % url
> > > > > > >   raise HTTP(303,**response.headers)
> > > > > > >   redirect(URL('test2'))
> > > > > > >  return dict(form=form)
> >
> > > > > > > def test2():
> > > > > > >  return dict(h=H1('hello world'))
> >
> > > > > > > with default/index.html
> >
> > > > > > > {{extend 'layout.html'}}
> > > > > > > This is a test
> > > > > > > {{=LOAD('default','test1.load',ajax=True)}}
> >
> > > > > >  web2py.app.test.w2p
> > > > > > 100KViewDownload




Re: [web2py] New server

2010-08-09 Thread Julius Minka
V Pondelok, 9. august 2010 o 05:05 -0700, Kenneth napísal(a):
> Hello,
> 
> I´m in the process of starting a newer server for my web2py
> applications and would like to hear your comments about what to use.
> 
> Anything about hardware that I should remeber?
> 
> As linux version I´m planing on using CentOS 5.5 as we use it on all
> our servers.

Unless you know CentOS and Apache and WSGI very well, you will possibly
save much time by choosing Debian or Ubuntu and using Massimo's script
to configure everything needed.

> Webserver: Apache and database MySQL.
> The server will not be runing anything other than web2py
> applications.
> 
> Which python should I use? CentOS comes with 2.4 and I´m using 2.5 on
> my old server?
Most important is to use the same python for Apache/mod_wsgi and
web2py. 

> 
> Should I use CGI, FastCGI, WSGI, mod_wsgi, mod_python, or?
I believe mod_wsgi is preferred way. Surely not CGI for so many users.

> 
> The main application for the moment will have 900 registred users,
> with maybe 100 user using it at the same time.
> 
> 
> Kenneth
Julius



Re: [web2py] Re: LOAD and redirect

2010-08-10 Thread Julius Minka
Massimo,

I got a message from a friend telling me the form isn't displayed in IE8
at all. 
It is from my application available at http://93.184.68.161:/real

If you would like to see the response from the search you need to choose
Predaj
Prievidza
2-izbovy byt


Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; 
Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; 
Media Center PC 6.0; MS-RTC LM 8; .NET4.0C; .NET4.0E)
Timestamp: Tue, 10 Aug 2010 07:05:34 UTC

Message: Invalid argument.
Line: 116
Char: 165
Code: 0
URI: http://93.184.68.161:/real/static/jquery.js

Did you see the form working in an IE? Which version?
Julius




V Pondelok, 9. august 2010 o 13:20 +0200, Julius Minka napísal(a):
> I didn't get any JS error.
> 
> Details:
> Epiphany has Webinspector which allowed me to run JS with debugging
> enabled. It didn't throw any error while doing that.
> 
> Opera has its Dragonfly which does similar things. Neither it reported
> any error.
> 
> 
> Just to note:
> Opera behaves differently from Epiphany. In Epiphany, the form
> disappears after submission, in Opera nothing happens, screen remains as
> it was in beginning.
> 
> Julius
> 
> 
> 
> V Pondelok, 9. august 2010 o 02:23 -0700, mdipierro napísal(a):
> > Does any of the browsers with problem have a debug feature that allow
> > you to see if there is JS error?
> > 
> > On Aug 9, 3:48 am, Julius Minka  wrote:
> > > I am not able to fix this, but I am willing to test it again if needed.
> > > Julius
> > >
> > > V Pondelok, 9. august 2010 o 01:28 -0700, mdipierro napísal(a):
> > >
> > > > If you ding out what the problem is perhaps we can improve the code
> > > > and make it more cross-browser compatible.
> > >
> > > > On Aug 9, 3:27 am, Julius Minka  wrote:
> > > > > Yes, now I see. It is browser issue.
> > > > > I am on Ubuntu Linux 10.04.
> > >
> > > > > It works on Firefox, Chromium, Konqueror.
> > > > > it doesn't on Opera 10.60 and Epiphany, Midori (both are based on 
> > > > > WebKit
> > > > > rendering engine)
> > >
> > > > > Hope this helps.
> > > > > Julius
> > >
> > > > > V Sobota, 7. august 2010 o 16:29 -0700, mdipierro napísal(a):
> > >
> > > > > > I am using trunk version
> > > > > > Version 1.82.1 (2010-08-04 18:57:33)
> > > > > > and the code you sent me works perfectly.
> > >
> > > > > > Either I do not understand the problem or this is a browser issue.
> > > > > > What os and browser do you use?
> > >
> > > > > > Massimo
> > >
> > > > > > On Aug 7, 2:16 pm, Julius Minka  wrote:
> > > > > > > No, redirection doesn't work for me.
> > > > > > > Last released version I used before was Version 1.82.1 (2010-08-05
> > > > > > > 01:00:12)
> > >
> > > > > > > I got current trunk this way:
> > > > > > > hg clonehttps://web2py.googlecode.com/hg/web2py078a
> > > > > > > requesting all changes
> > > > > > > adding changesets
> > > > > > > adding manifests
> > > > > > > adding file changes
> > > > > > > added 764 changesets with 2180 changes to 733 files
> > > > > > > updating to branch default
> > > > > > > 588 files updated, 0 files merged, 0 files removed, 0 files 
> > > > > > > unresolved
> > >
> > > > > > > It identifies itself as Version 1.82.1 (2010-08-04 18:57:33).
> > > > > > > Attached you can find the application as I typed it from your 
> > > > > > > email.
> > >
> > > > > > > Julius
> > >
> > > > > > > V Sobota, 7. august 2010 o 10:58 -0700, mdipierro napísal(a):
> > >
> > > > > > > > There is a problem with URL. Please check trunk and see if it 
> > > > > > > > solves
> > > > > > > > the problem for you:
> > >
> > > > > > > > This works for me
> > >
> > > > > > > > def index():
> > > > > > > >  return dict()
> > >
> > > > > > > > def test1():
> > > > > > > >  form=SQLFORM.factory(Field('name'))
> > > > > > > >  if form.accepts(request.vars,session):
> > > > > > > >   url = URL('test2',extension='html')
> > > > > > > >   response.headers['web2py-component-
> > > > > > > > command']='document.location="%s"' % url
> > > > > > > >   raise HTTP(303,**response.headers)
> > > > > > > >   redirect(URL('test2'))
> > > > > > > >  return dict(form=form)
> > >
> > > > > > > > def test2():
> > > > > > > >  return dict(h=H1('hello world'))
> > >
> > > > > > > > with default/index.html
> > >
> > > > > > > > {{extend 'layout.html'}}
> > > > > > > > This is a test
> > > > > > > > {{=LOAD('default','test1.load',ajax=True)}}
> > >
> > > > > > >  web2py.app.test.w2p
> > > > > > > 100KViewDownload
> 
> 




Re: [web2py] Re: New server

2010-08-10 Thread Julius Minka
V Pondelok, 9. august 2010 o 15:05 -0700, mdipierro napísal(a):
> This worked for me:
> 
> http://code.google.com/p/web2py/source/browse/scripts/setup-web2py-fedora.sh
> 

I believe it was not clean install and all dependencies were met before
running this script. Or?

Julius




> On Aug 9, 3:06 pm, Kenneth Lundström 
> wrote:
> >   I have a clean install of CentOS 5.5, so I´ll try to write down every
> > step of installing web2oy and make a slice of it.
> >
> > Kenneth
> >
> > > That might be why I had so much difficulty with CentOS.
> >
> > > --
> > > Thadeus
> >
> > > On Mon, Aug 9, 2010 at 12:14 PM, mdipierro  
> > > wrote:
> > >> no
> >
> > >> On Aug 9, 11:45 am, Thadeus Burgess  wrote:
> > >>> Does it have Plesk or a similar control panel installed?
> >
> > >>> --
> > >>> Thadeus
> >
> > >>> On Mon, Aug 9, 2010 at 10:46 AM, mdipierro  
> > >>> wrote:
> >  I have a machine with configuration (somebody set it up for me and it
> >  seesm to work).
> >  On Aug 9, 10:00 am, Thadeus Burgess  wrote:
> > > I guess the key is, no CentOS with apache/mod_wsgi. Can't comment on
> > > other webservers since I never tried them with CentOS... just Apache.
> > > --
> > > Thadeus
> > > On Mon, Aug 9, 2010 at 9:49 AM, Vasile Ermicioi  
> > > wrote:
> > >> I use CentOS + python2.7 + web2py + gevent.pywsgi
> > >> works great, I could help with installation if you need




Re: [web2py] Re: LOAD and redirect

2010-08-10 Thread Julius Minka
Form not displaying in IE was caused by other Jquery stuff on the page.
Sorry for bothering you.
However, redirection doesn't work in IE6.
Julius


V Utorok, 10. august 2010 o 10:07 +0200, Julius Minka napísal(a):
> Massimo,
> 
> I got a message from a friend telling me the form isn't displayed in IE8
> at all. 
> It is from my application available at http://93.184.68.161:/real
> 
> If you would like to see the response from the search you need to choose
> Predaj
> Prievidza
> 2-izbovy byt
> 
> 
> Webpage error details
> 
> User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; 
> Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 
> 3.0.30729; Media Center PC 6.0; MS-RTC LM 8; .NET4.0C; .NET4.0E)
> Timestamp: Tue, 10 Aug 2010 07:05:34 UTC
> 
> Message: Invalid argument.
> Line: 116
> Char: 165
> Code: 0
> URI: http://93.184.68.161:/real/static/jquery.js
> 
> Did you see the form working in an IE? Which version?
> Julius
> 
> 
> 
> 
> V Pondelok, 9. august 2010 o 13:20 +0200, Julius Minka napísal(a):
> > I didn't get any JS error.
> > 
> > Details:
> > Epiphany has Webinspector which allowed me to run JS with debugging
> > enabled. It didn't throw any error while doing that.
> > 
> > Opera has its Dragonfly which does similar things. Neither it reported
> > any error.
> > 
> > 
> > Just to note:
> > Opera behaves differently from Epiphany. In Epiphany, the form
> > disappears after submission, in Opera nothing happens, screen remains as
> > it was in beginning.
> > 
> > Julius
> > 
> > 
> > 
> > V Pondelok, 9. august 2010 o 02:23 -0700, mdipierro napísal(a):
> > > Does any of the browsers with problem have a debug feature that allow
> > > you to see if there is JS error?
> > > 
> > > On Aug 9, 3:48 am, Julius Minka  wrote:
> > > > I am not able to fix this, but I am willing to test it again if needed.
> > > > Julius
> > > >
> > > > V Pondelok, 9. august 2010 o 01:28 -0700, mdipierro napísal(a):
> > > >
> > > > > If you ding out what the problem is perhaps we can improve the code
> > > > > and make it more cross-browser compatible.
> > > >
> > > > > On Aug 9, 3:27 am, Julius Minka  wrote:
> > > > > > Yes, now I see. It is browser issue.
> > > > > > I am on Ubuntu Linux 10.04.
> > > >
> > > > > > It works on Firefox, Chromium, Konqueror.
> > > > > > it doesn't on Opera 10.60 and Epiphany, Midori (both are based on 
> > > > > > WebKit
> > > > > > rendering engine)
> > > >
> > > > > > Hope this helps.
> > > > > > Julius
> > > >
> > > > > > V Sobota, 7. august 2010 o 16:29 -0700, mdipierro napísal(a):
> > > >
> > > > > > > I am using trunk version
> > > > > > > Version 1.82.1 (2010-08-04 18:57:33)
> > > > > > > and the code you sent me works perfectly.
> > > >
> > > > > > > Either I do not understand the problem or this is a browser issue.
> > > > > > > What os and browser do you use?
> > > >
> > > > > > > Massimo
> > > >
> > > > > > > On Aug 7, 2:16 pm, Julius Minka  wrote:
> > > > > > > > No, redirection doesn't work for me.
> > > > > > > > Last released version I used before was Version 1.82.1 
> > > > > > > > (2010-08-05
> > > > > > > > 01:00:12)
> > > >
> > > > > > > > I got current trunk this way:
> > > > > > > > hg clonehttps://web2py.googlecode.com/hg/web2py078a
> > > > > > > > requesting all changes
> > > > > > > > adding changesets
> > > > > > > > adding manifests
> > > > > > > > adding file changes
> > > > > > > > added 764 changesets with 2180 changes to 733 files
> > > > > > > > updating to branch default
> > > > > > > > 588 files updated, 0 files merged, 0 files removed, 0 files 
> > > > > > > > unresolved
> > > >
> > > > > > > > It identifies itself as Version 1.82.1 (2010-08-04 18:57:33).
> > > > > > > > Attached you can find the application as I typed it from your 
> &g

[web2py] generated multilevel menu

2010-04-26 Thread Julius Minka
I have to implement following 4-level menu in my view:


Level1a
Level1b
Level1c*
   
  Level2a*
 
  Level3a*

  Level4a 
  Level4b 
  Level4c
 
   
  Level3b 
  Level3c 
  Level3d 
 

   Level2b 
   Level2c 
   Level2d 
 



This menu should be dynamically generated from DB
Respective table looks as follows:

db.define_table('category', 
  Field('name', 'string', length=40, required=True, notnull=False,
unique=True),
  Field('parent_id', 'reference category', length=5, required=False,
notnull=False))
db.category.parent_id.requires=IS_NULL_OR(IS_IN_DB(db,'category.id','
%(name)s'))

Menu items on the first level have no parents, all items on next levels
define one. I can change the table if required.

Can somebody suggest a good approach for doing this?

Thanks,
Julius




-- 
Subscription settings: http://groups.google.com/group/web2py/subscribe?hl=en


[web2py] Slovak translation: sk-sk.py

2010-08-24 Thread Julius Minka

# coding: utf8
{
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" je voliteľný výraz ako "field1=\'newvalue\'". Nemôžete upravovať alebo zmazať výsledky JOINu',
'%Y-%m-%d': '%d.%m.%Y',
'%Y-%m-%d %H:%M:%S': '%d.%m.%Y %H:%M:%S',
'%s rows deleted': '%s zmazaných záznamov',
'%s rows updated': '%s upravených záznamov',
'Available databases and tables': 'Dostupné databázy a tabuľky',
'Cannot be empty': 'Nemôže byť prázdne',
'Check to delete': 'Označiť na zmazanie',
'Controller': 'Controller',
'Copyright': 'Copyright',
'Current request': 'Aktuálna požiadavka',
'Current response': 'Aktuálna odpoveď',
'Current session': 'Aktuálne sedenie',
'DB Model': 'DB Model',
'Database': 'Databáza',
'Delete:': 'Zmazať:',
'Description': 'Popis',
'Edit': 'Upraviť',
'Edit Profile': 'Upraviť profil',
'Edit current record': 'Upraviť aktuálny záznam',
'First name': 'Krstné meno',
'Group ID': 'ID skupiny',
'Hello World': 'Ahoj svet',
'Import/Export': 'Import/Export',
'Index': 'Index',
'Internal State': 'Vnútorný stav',
'Invalid email': 'Neplatný email',
'Invalid Query': 'Neplatná otázka',
'Invalid password': 'Nesprávne heslo',
'Last name': 'Priezvisko',
'Layout': 'Layout',
'Logged in': 'Prihlásený',
'Logged out': 'Odhlásený',
'Lost Password': 'Stratené heslo?',
'Menu Model': 'Menu Model',
'Name': 'Meno',
'New Record': 'Nový záznam',
'New password': 'Nové heslo',
'No databases in this application': 'V tejto aplikácii nie sú databázy',
'Old password': 'Staré heslo',
'Origin': 'Pôvod',
'Password': 'Heslo',
'Powered by': 'Powered by',
'Query:': 'Otázka:',
'Record ID': 'ID záznamu',
'Register': 'Zaregistrovať sa',
'Registration key': 'Registračný kľúč',
'Remember me (for 30 days)': 'Zapamätaj si ma (na 30 dní)',
'Reset Password key': 'Nastaviť registračný kľúč',
'Role': 'Rola',
'Rows in table': 'riadkov v tabuľke',
'Rows selected': 'označených riadkov',
'Submit': 'Odoslať',
'Stylesheet': 'Stylesheet',
'Sure you want to delete this object?': 'Ste si istí, že chcete zmazať tento objekt?',
'Table name': 'Názov tabuľky',
'The "query" is a condition like "db.table1.field1==\'value\'". Something like "db.table1.field1==db.table2.field2" results in a SQL JOIN.': '"query" je podmienka ako "db.table1.field1==\'value\'". Niečo ako "db.table1.field1==db.table2.field2" má za výsledok SQL JOIN.',
'The output of the file is a dictionary that was rendered by the view': 'Výstup zo súboru je slovník, ktorý bol zobrazený vo view',
'This is a copy of the scaffolding application': 'Toto je kópia skeletu aplikácie',
'Timestamp': 'Časová pečiatka',
'Update:': 'Upraviť:',
'Use (...)&(...) for AND, (...)|(...) for OR, and ~(...)  for NOT to build more complex queries.': 'Použite (...)&(...) pre AND, (...)|(...) pre OR a ~(...) pre NOT na poskladanie komplexnejších otázok.',
'User %(id)s Logged-in': 'Používateľ %(id)s prihlásený',
'User %(id)s Logged-out': 'Používateľ %(id)s odhlásený',
'User %(id)s Password changed': 'Používateľ %(id)s zmenil heslo',
'User %(id)s Profile updated': 'Používateľ %(id)s upravil profil',
'User %(id)s Registered': 'Používateľ %(id)s sa zaregistroval',
'User ID': 'ID používateľa',
'Verify Password': 'Zopakujte heslo',
'View': 'Zobraziť',
'Welcome to web2py': 'Vitajte vo web2py',
'Which called the function': 'Ktorý zavolal funkciu',
'You are successfully running web2py': 'Úspešne ste spustili web2py',
'You can modify this application and adapt it to your needs': 'Môžete upraviť túto aplikáciu a prispôsobiť ju svojim potrebám',
'You visited the url': 'Navštívili ste URL',
'appadmin is disabled because insecure channel': 'appadmin je zakázaný bez zabezpečeného spojenia',
'cache': 'cache',
'click here for online examples': 'pre online príklady kliknite sem',
'click here for the administrative interface': 'pre administrátorské rozhranie kliknite sem',
'customize me!': 'prispôsob ma!',
'data uploaded': 'údaje naplnené',
'database': 'databáza',
'database %s select': 'databáza %s výber',
'db': 'db',
'design': 'návrh',
'documentation': 'dokumentácia',
'done!': 'hotovo!',
'export as csv file': 'exportovať do csv súboru',
'insert new': 'vložiť nový záznam ',
'insert new %s': 'vložiť nový  záznam %s',
'invalid request': 'Neplatná požiadavka',
'located in the file': 'nachádzajúci sa v súbore ',
'login': 'prihlásiť',
'logout': 'odhlásiť',
'lost password?': 'stratené heslo?',
'new record inserted': 'nový záznam bol vložený',
'next 100 rows': 'ďalších 100 riadkov',
'or import from csv file': 'alebo naimportovať z csv súboru',
'password': 'heslo',
'previous 100 rows': 'predchádzajúcich 100 riadkov',
'record': 'záznam',
'record does not exist': 'záznam neexistuje',
'record id': 'id záznamu',
'register': 'registrovať',
'selected': 'označených',
'state': 'stav',
'table': 'tabuľka',
'unable to parse csv file': 'nedá sa načítať csv súbor',
}


[web2py] horizontal_radios and multiple td

2010-09-18 Thread Julius Minka
def horizontal_radios(f,v):
table = SQLFORM.widgets.radio.widget(f,v)
rows=table.elements('tr')
table.components = []
table.append([row.elements('td') for row in rows])
return table

def form():
form=SQLFORM.factory(
   Field('clientagent', requires=IS_IN_SET(['client', 'agent']),
default='client', widget=horizontal_radios,label='Client/Agent'),
...

... Client/Agent: 
client
agent<
/td>...


 and  seems to be too many there. Does it come from
the function above or web2py itself? How to correct this?

Julius




Re: [web2py] Re: horizontal_radios and multiple td

2010-09-18 Thread Julius Minka
Could you please be more specific? I am sorry to say I don' understand
your response.
Julius

V Sobota, 18. september 2010 o 07:34 -0700, mdipierro napísal(a):
> yes, the third columns is form Field(...comment='')
> 
> On Sep 18, 5:47 am, Julius Minka  wrote:
> > def horizontal_radios(f,v):
> > table = SQLFORM.widgets.radio.widget(f,v)
> > rows=table.elements('tr')
> > table.components = []
> > table.append([row.elements('td') for row in rows])
> > return table
> >
> > def form():
> > form=SQLFORM.factory(
> >Field('clientagent', requires=IS_IN_SET(['client', 'agent']),
> > default='client', widget=horizontal_radios,label='Client/Agent'),
> > ...
> >
> > ...  > class="w2p_fl"> > id="no_table_clientagent__label">Client/Agent:  > class="w2p_fc"> > id="no_table_clientagent__row2"> > class="string" id="no_table_clientagent" name="clientagent">
> >  > value="client" />client
> > agent<
> > /td>...
> >
> >  and  seems to be too many there. Does it come from
> > the function above or web2py itself? How to correct this?
> >
> > Julius




[web2py] failed import of a module

2010-09-18 Thread Julius Minka
Trying to deploy web2py app in the Virtual Server with Debian installed
using
http://bazaar.launchpad.net/~mdipierro/web2py/devel/download/head:/setupweb2pyubuntu.sh-20091113071543-nuyvk7g9cfu086wk-1/setup-web2py-ubuntu.sh

results in this error:

Error traceback
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
Traceback (most recent call last):
  File "gluon/restricted.py", line 186, in restricted
exec ccode in environment
  File "/home/www-data/web2py/applications/real/models/db.py", line 140, in 

webgrid = local_import('webgrid')
  File "gluon/compileapp.py", line 243, in 
local_import_aux(name,reload,app)
  File "gluon/compileapp.py", line 174, in local_import_aux
module = __import__(name)
ImportError: No module named applications.real.modules.webgrid
Error snapshot
Detailed traceback description
  * Exception: (No module named
applications.real.modules.webgrid)
  * Python 2.5.2: /usr/bin/python
  * 

the webgrid.py is available in the modules directory 
Why the import has failed?
Julius



Re: [web2py] Re: failed import of a module

2010-09-18 Thread Julius Minka
It works locally, the error occurs only on the server.

V Sobota, 18. september 2010 o 14:46 -0700, mdipierro napísal(a):
> I do not know but ...
> Not all modules can go in the modules folder. Some of them exepect to
> be in sys.path
> 
> On Sep 18, 3:18 pm, Julius Minka  wrote:
> > Trying to deploy web2py app in the Virtual Server with Debian installed
> > usinghttp://bazaar.launchpad.net/~mdipierro/web2py/devel/download/head:/se...
> >
> > results in this error:
> >
> > Error traceback
> > 1.
> > 2.
> > 3.
> > 4.
> > 5.
> > 6.
> > 7.
> > 8.
> > 9.
> > 10.
> > 11.
> > Traceback (most recent call last):
> >   File "gluon/restricted.py", line 186, in restricted
> > exec ccode in environment
> >   File "/home/www-data/web2py/applications/real/models/db.py", line 140, in 
> > 
> > webgrid = local_import('webgrid')
> >   File "gluon/compileapp.py", line 243, in 
> > local_import_aux(name,reload,app)
> >   File "gluon/compileapp.py", line 174, in local_import_aux
> > module = __import__(name)
> > ImportError: No module named applications.real.modules.webgrid
> > Error snapshot
> > Detailed traceback description
> >   * Exception: (No module named
> > applications.real.modules.webgrid)
> >   * Python 2.5.2: /usr/bin/python
> >   *
> >
> > the webgrid.py is available in the modules directory
> > Why the import has failed?
> > Julius




Re: [web2py] Re: failed import of a module

2010-09-19 Thread Julius Minka
yes, it is.

V Nedeľa, 19. september 2010 o 00:57 +0200, Michele Comitini napísal(a):
> is there  a __init__.py in modules?
> 
> 2010/9/19 Jonathan Lundell :
> > On Sep 18, 2010, at 2:46 PM, mdipierro wrote:
> >>
> >> Not all modules can go in the modules folder. Some of them exepect to
> >> be in sys.path
> >
> > There's a variety of sys.path editing in web2py, but I think it's not 
> > entirely consistent.




Re: [web2py] Re: failed import of a module - SOLVED

2010-09-22 Thread Julius Minka
After I ran it once without Apache, it now works with Apache too.
Any possible reason for that?

Julius

V Sobota, 18. september 2010 o 23:55 +0200, Julius Minka napísal(a):
> It works locally, the error occurs only on the server.
> 
> V Sobota, 18. september 2010 o 14:46 -0700, mdipierro napísal(a):
> > I do not know but ...
> > Not all modules can go in the modules folder. Some of them exepect to
> > be in sys.path
> > 
> > On Sep 18, 3:18 pm, Julius Minka  wrote:
> > > Trying to deploy web2py app in the Virtual Server with Debian installed
> > > usinghttp://bazaar.launchpad.net/~mdipierro/web2py/devel/download/head:/se...
> > >
> > > results in this error:
> > >
> > > Error traceback
> > > 1.
> > > 2.
> > > 3.
> > > 4.
> > > 5.
> > > 6.
> > > 7.
> > > 8.
> > > 9.
> > > 10.
> > > 11.
> > > Traceback (most recent call last):
> > >   File "gluon/restricted.py", line 186, in restricted
> > > exec ccode in environment
> > >   File "/home/www-data/web2py/applications/real/models/db.py", line 140, 
> > > in 
> > > webgrid = local_import('webgrid')
> > >   File "gluon/compileapp.py", line 243, in 
> > > local_import_aux(name,reload,app)
> > >   File "gluon/compileapp.py", line 174, in local_import_aux
> > > module = __import__(name)
> > > ImportError: No module named applications.real.modules.webgrid
> > > Error snapshot
> > > Detailed traceback description
> > >   * Exception: (No module named
> > > applications.real.modules.webgrid)
> > >   * Python 2.5.2: /usr/bin/python
> > >   *
> > >
> > > the webgrid.py is available in the modules directory
> > > Why the import has failed?
> > > Julius
> 




[web2py] pyforum security and future

2010-10-12 Thread Julius Minka
There is security issue reported here:
http://secunia.com/advisories/37764

Is any fix available?
Are there any plans to further develop pyforum?
I am asking because I am considering pyforum as a base for bigger
communication app.

Julius




Re: [web2py] Re: pyforum security and future

2010-10-13 Thread Julius Minka
thank you both for clarification
julius

V Streda, 13. október 2010 o 11:48 -0700, mdipierro napísal(a):
> I have seen previous "security reports" from them about PyForum. Those
> that I have checked were bogus.
> 
> Massimo
> 
> On Oct 13, 11:55 am, Julio Schwarzbeck  wrote:
> > Hi this is Julio, pyforum author.  I just wanted to clarify a few
> > things here.
> >
> > On Dec 9, 2009, I was contacted by this
> > "Nam Nguyen" from bluemoon.com.vn (Viet Nam) domain.
> >
> > This gentleman stated that he had "discovered" several XSS
> > vulnerabilities in pyforum, and in orderto "disclose" them to me, I
> > had to enter in some kind of agreement with him (read: pay him money)
> > my "punishment" for not complying with this would result in spreading
> > this information around (I guess his "security firm" does not carry
> > enough weight so he needed to go to the usual channels, secunia being
> > one of them.
> >
> > After more than a year he has failed to provide even one simple proof
> > of concept so I can potentially fix.
> >
> > All of this leads me to believe that such vulnerability indeed does
> > not exist and that these individual's intentions were no other than
> > trying to dishonestly obtain monetary gains.
> >
> > pyforum is open source software and its source code is available for
> > anyone to view.
> >
> > Hope this clarifies the issue, Cheers,
> >
> > Julio F Schwarzbeck.
> >
> > On Oct 12, 9:12 am, Julius Minka  wrote:
> >
> > > There is security issue reported here:http://secunia.com/advisories/37764
> >
> > > Is any fix available?
> > > Are there any plans to further develop pyforum?
> > > I am asking because I am considering pyforum as a base for bigger
> > > communication app.
> >
> >




[web2py:26132] javascript function call from controller

2009-07-10 Thread Julius Minka

Hi all,

I have a javascript function in html file which is usually called from 
onclick event in the same file. It works fine.
However I would like to call this javascript function from a controller.

More precise description:
after clicking an element in the page, the flow goes to controller. 
There I decide which dialog to display (I have it working to this 
point), but it is defined again in html file as jquery dialog opening 
with .dialog("open");

How to do it?
Julius

--~--~-~--~~~---~--~~
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, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:26141] Re: javascript function call from controller

2009-07-10 Thread Julius Minka

JohnMc,

decision is made based on data in db related to current screen.

Julius


JohnMc  wrote / napísal(a):
> Julius,
> 
> Unless you are performing a server side lookup why not decide the
> dialog to present using a clientside if or switch in javascript?
> 
> On Jul 10, 8:56 am, Julius Minka  wrote:
>> Hi all,
>>
>> I have a javascript function in html file which is usually called from
>> onclick event in the same file. It works fine.
>> However I would like to call this javascript function from a controller.
>>
>> More precise description:
>> after clicking an element in the page, the flow goes to controller.
>> There I decide which dialog to display (I have it working to this
>> point), but it is defined again in html file as jquery dialog opening
>> with .dialog("open");
>>
>> How to do it?
>> Julius
> > 


--~--~-~--~~~---~--~~
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, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:26157] Re: javascript function call from controller

2009-07-10 Thread Julius Minka

Massimo,
I can see following:

1. in Jquery documentation:
html(val)
Set the html contents of every matched element. This property is not 
available on XML documents (although it will work for XHTML documents).

2. in current svn trunk in web2py_ajax.html something like this:
function ajax(u,s,t) {
   var query="";
   for(i=0; i0) query=query+"&";
 
query=query+encodeURIComponent(s[i])+"="+encodeURIComponent(document.getElementById(s[i]).value);
   }
   jQuery.ajax({type: "POST", url: u, data: query, success: 
function(msg) { if(t==':eval') eval(msg); else 
document.getElementById(t).innerHTML=msg; } });
}

BUT:
I still do not understand, how it should help me to call javascript 
function from controller.
Can you please explain it more?
Julius

mdipierro  wrote / napísal(a):
> With the latest trunk you can do
> 
> 
> click me
> 
> 
> def callback():
>  value=request.vars.value
>  return "jQuery('#target').html(%s)" % repr(str(value))
> 
> when you click the button it sends the value of value to the callback
> function. The function returns a jQuery string and the clients runs
> it. The trick here is ajax(...,':eval') which is defined by web2py.
> 
> On Jul 10, 8:56 am, Julius Minka  wrote:
>> Hi all,
>>
>> I have a javascript function in html file which is usually called from
>> onclick event in the same file. It works fine.
>> However I would like to call this javascript function from a controller.
>>
>> More precise description:
>> after clicking an element in the page, the flow goes to controller.
>> There I decide which dialog to display (I have it working to this
>> point), but it is defined again in html file as jquery dialog opening
>> with .dialog("open");
>>


--~--~-~--~~~---~--~~
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, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:13001] itemize formatting

2008-12-06 Thread Julius Minka

How can I format itemize output to a table (regular structure of
columns)? I am showing more columns on the line.
Something similar to default view for records...
Thanks
Julius


--~--~-~--~~~---~--~~
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, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:13007] Re: itemize formatting

2008-12-06 Thread Julius Minka

yes, I know.
I do it this way:

db.puppy.represent=lambda row: \
P(A(row.name,_href=t2.action('display_puppy',[row.id])),SPAN(row.age))

The only trouble is, that it is not formattted like a table:
dog1
doggie2

I need
dog 1
doggiw  2

Julius


On So, 2008-12-06 at 05:35 -0800, billf wrote:
> are you using t2?  The t2 manual describes doing this by
> 
> db.mytable.represent=lambda row: '%s %s' % (row.myfield,row.id)
> 
> which I have used and it works fine.
> 
> On Dec 6, 10:08 am, Julius Minka <[EMAIL PROTECTED]> wrote:
> > How can I format itemize output to a table (regular structure of
> > columns)? I am showing more columns on the line.
> > Something similar to default view for records...
> > Thanks
> > Julius
> > 


--~--~-~--~~~---~--~~
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, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:13020] Re: itemize formatting

2008-12-06 Thread Julius Minka

Thanks, this is the solution I need,
except
the two CSS lines are not applied to those elements of row. 

I added 
SPAN .col1 {width: 200px}
SPAN .col2 {width: 200px}

to the end of static/styles.css
What's wrong?
Julius


On So, 2008-12-06 at 07:33 -0800, mdipierro wrote:
> You cannot format it like a table but you can
> 
> represent=lambda r: DIV(SPAN(r.field1,_class="col1"),SPAN
> (r.field2,_class="col2"))
> 
> and in css
> 
> SPAN .col1 {width: 200px}
> SPAN .col1 {width: 200px}
> 
> Massimo
> 
> 
> On Dec 6, 8:26 am, billf <[EMAIL PROTECTED]> wrote:
> > If you look at the default represent() in t2.py you can see how to do
> > whatever you want.  Maybe the default is what you want(?)
> >
> > On Dec 6, 2:09 pm, Julius Minka <[EMAIL PROTECTED]> wrote:
> >
> > > yes, I know.
> > > I do it this way:
> >
> > > db.puppy.represent=lambda row: \
> > > P(A(row.name,_href=t2.action('display_puppy',[row.id])),SPAN(row.age))
> >
> > > The only trouble is, that it is not formattted like a table:
> > > dog1
> > > doggie2
> >
> > > I need
> > > dog 1
> > > doggiw  2
> >
> > > Julius
> >
> > > On So, 2008-12-06 at 05:35 -0800, billf wrote:
> >
> > > > are you using t2?  The t2 manual describes doing this by
> >
> > > > db.mytable.represent=lambda row: '%s %s' % (row.myfield,row.id)
> >
> > > > which I have used and it works fine.
> >
> > > > On Dec 6, 10:08 am, Julius Minka <[EMAIL PROTECTED]> wrote:
> > > > > How can I format itemize output to a table (regular structure of
> > > > > columns)? I am showing more columns on the line.
> > > > > Something similar to default view for records...
> > > > > Thanks
> > > > > Julius
> > 


--~--~-~--~~~---~--~~
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, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:13028] Re: itemize formatting

2008-12-06 Thread Julius Minka

thanks for advice, I corrected it down to

SPAN.col1 { width: 200px; background-color: #aaa; }

Background color is applied, but width is not.
I can't see why. Any hint?

Julius


On So, 2008-12-06 at 12:58 -0600, Yarko Tymciurak wrote:
> look for typos;   look at output  with firebug / firefox to try to
> find hints.
> 
> On Sat, Dec 6, 2008 at 10:27 AM, Julius Minka <[EMAIL PROTECTED]> wrote:
> 
> Thanks, this is the solution I need,
> except
> the two CSS lines are not applied to those elements of row.
> 
> I added
> SPAN .col1 {width: 200px}
> SPAN .col2 {width: 200px}
> 
> to the end of static/styles.css
> What's wrong?
> Julius
> 
> 
> 
> On So, 2008-12-06 at 07:33 -0800, mdipierro wrote:
> > You cannot format it like a table but you can
> >
> > represent=lambda r: DIV(SPAN(r.field1,_class="col1"),SPAN
> > (r.field2,_class="col2"))
> >
> > and in css
> >
> > SPAN .col1 {width: 200px}
> > SPAN .col1 {width: 200px}
> >
> > Massimo
> >
> >
> > On Dec 6, 8:26 am, billf <[EMAIL PROTECTED]>
> wrote:
> > > If you look at the default represent() in t2.py you can
> see how to do
> > > whatever you want.  Maybe the default is what you want(?)
> > >
> > > On Dec 6, 2:09 pm, Julius Minka <[EMAIL PROTECTED]> wrote:
> > >
> > > > yes, I know.
> > > > I do it this way:
> > >
> > > > db.puppy.represent=lambda row: \
> > > >
> P(A(row.name,_href=t2.action('display_puppy',[row.id])),SPAN(row.age))
> > >
> > > > The only trouble is, that it is not formattted like a
> table:
> > > > dog1
> > > > doggie2
> > >
> > > > I need
> > > > dog 1
> > > > doggiw  2
> > >
>     > > > Julius
> > >
> > > > On So, 2008-12-06 at 05:35 -0800, billf wrote:
> > >
> > > > > are you using t2?  The t2 manual describes doing this
> by
> > >
> > > > > db.mytable.represent=lambda row: '%s %s' %
> (row.myfield,row.id)
> > >
> > > > > which I have used and it works fine.
> > >
> > > > > On Dec 6, 10:08 am, Julius Minka <[EMAIL PROTECTED]>
> wrote:
> > > > > > How can I format itemize output to a table (regular
> structure of
> > > > > > columns)? I am showing more columns on the line.
> > > > > > Something similar to default view for records...
> > > > > > Thanks
> > > > > > Julius
> > >
> 
> 
> 
> 
> 
> 
> > 


--~--~-~--~~~---~--~~
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, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:13035] Re: itemize formatting

2008-12-06 Thread Julius Minka

You are right, but DIV makes new line. That is not what I want. I need
all values of a record to stay on the same line.

Width property could be theoretically placed on TD, but as you can see

12345gfhhjj

both values (12345 and gfhhjj) are in one cell, so I am stuck again.

Julius


On So, 2008-12-06 at 13:24 -0700, Wes James wrote:
> probably because span does not have a width.
> 
> http://www.w3schools.com/TAGS/tag_span.asp
> 
> you need to use an element that uses width like div
> 
> try this:
> 
> 
> 
> 
> test
> 
> 
> 
> 
> line 1
> line 1
> 
> line 1
> line 1
> 
> 
> 
> 
> -wj
> 
> On Sat, Dec 6, 2008 at 12:47 PM, Julius Minka <[EMAIL PROTECTED]> wrote:
> >
> > thanks for advice, I corrected it down to
> >
> > SPAN.col1 { width: 200px; background-color: #aaa; }
> >
> > Background color is applied, but width is not.
> > I can't see why. Any hint?
> >
> > Julius
> >
> >
> > On So, 2008-12-06 at 12:58 -0600, Yarko Tymciurak wrote:
> >> look for typos;   look at output  with firebug / firefox to try to
> >> find hints.
> >>
> >> On Sat, Dec 6, 2008 at 10:27 AM, Julius Minka <[EMAIL PROTECTED]> wrote:
> >>
> >> Thanks, this is the solution I need,
> >> except
> >> the two CSS lines are not applied to those elements of row.
> >>
> >> I added
> >> SPAN .col1 {width: 200px}
> >> SPAN .col2 {width: 200px}
> >>
> >> to the end of static/styles.css
> >> What's wrong?
> >> Julius
> >>
> >>
> >>
> >> On So, 2008-12-06 at 07:33 -0800, mdipierro wrote:
> >> > You cannot format it like a table but you can
> >> >
> >> > represent=lambda r: DIV(SPAN(r.field1,_class="col1"),SPAN
> >> > (r.field2,_class="col2"))
> >> >
> >> > and in css
> >> >
> >> > SPAN .col1 {width: 200px}
> >> > SPAN .col1 {width: 200px}
> >> >
> >> > Massimo
> >> >
> >> >
> >> > On Dec 6, 8:26 am, billf <[EMAIL PROTECTED]>
> >> wrote:
> >> > > If you look at the default represent() in t2.py you can
> >> see how to do
> >> > > whatever you want.  Maybe the default is what you want(?)
> >> > >
> >> > > On Dec 6, 2:09 pm, Julius Minka <[EMAIL PROTECTED]> wrote:
> >> > >
> >> > > > yes, I know.
> >> > > > I do it this way:
> >> > >
> >> > > > db.puppy.represent=lambda row: \
> >> > > >
> >> 
> >> P(A(row.name,_href=t2.action('display_puppy',[row.id])),SPAN(row.age))
> >> > >
> >> > > > The only trouble is, that it is not formattted like a
> >> table:
> >> > > > dog1
> >> > > > doggie2
> >> > >
> >> > > > I need
> >> > > > dog 1
> >> > > > doggiw  2
> >> > >
> >> > > > Julius
> >> > >
> >> > > > On So, 2008-12-06 at 05:35 -0800, billf wrote:
> >> > >
> >> > > > > are you using t2?  The t2 manual describes doing this
> >> by
> >> > >
> >> > > > > db.mytable.represent=lambda row: '%s %s' %
> >> (row.myfield,row.id)
> >> > >
> >> > > > > which I have used and it works fine.
> >> > >
> >> > > > > On Dec 6, 10:08 am, Julius Minka <[EMAIL PROTECTED]>
> >> wrote:
> >> > > > > > How can I format itemize output to a table (regular
> >> structure of
> >> > > > > > columns)? I am showing more columns on the line.
> >> > > > > > Something similar to default view for records...
> >> > > > > > Thanks
> >> > > > > > Julius
> >> > >
> >>
> >>
> >>
> >>
> >>
> >>
> >> >
> >
> >
> > >
> >
> 
> > 


--~--~-~--~~~---~--~~
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, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:13037] Re: itemize formatting

2008-12-06 Thread Julius Minka

I would like to do that, but the code below is generated by t2's
itemize...

On So, 2008-12-06 at 13:55 -0700, Wes James wrote:
> put each col in its own td
> 
> On Sat, Dec 6, 2008 at 1:51 PM, Julius Minka <[EMAIL PROTECTED]> wrote:
> >
> > You are right, but DIV makes new line. That is not what I want. I need
> > all values of a record to stay on the same line.
> >
> > Width property could be theoretically placed on TD, but as you can see
> >
> >  > class="col1">12345 > class="col2">gfhhjj
> >
> > both values (12345 and gfhhjj) are in one cell, so I am stuck again.
> >
> > Julius
> >
> >
> > On So, 2008-12-06 at 13:24 -0700, Wes James wrote:
> >> probably because span does not have a width.
> >>
> >> http://www.w3schools.com/TAGS/tag_span.asp
> >>
> >> you need to use an element that uses width like div
> >>
> >> try this:
> >>
> >> 
> >> 
> >> 
> >> test
> >> 
> >> 
> >>
> >> 
> >> line 
> >> 1
> >> line 1
> >> 
> >> line 1
> >> line 1
> >>
> >> 
> >> 
> >>
> >> -wj
> >>
> >> On Sat, Dec 6, 2008 at 12:47 PM, Julius Minka <[EMAIL PROTECTED]> wrote:
> >> >
> >> > thanks for advice, I corrected it down to
> >> >
> >> > SPAN.col1 { width: 200px; background-color: #aaa; }
> >> >
> >> > Background color is applied, but width is not.
> >> > I can't see why. Any hint?
> >> >
> >> > Julius
> >> >
> >> >
> >> > On So, 2008-12-06 at 12:58 -0600, Yarko Tymciurak wrote:
> >> >> look for typos;   look at output  with firebug / firefox to try to
> >> >> find hints.
> >> >>
> >> >> On Sat, Dec 6, 2008 at 10:27 AM, Julius Minka <[EMAIL PROTECTED]> wrote:
> >> >>
> >> >> Thanks, this is the solution I need,
> >> >> except
> >> >> the two CSS lines are not applied to those elements of row.
> >> >>
> >> >> I added
> >> >> SPAN .col1 {width: 200px}
> >> >> SPAN .col2 {width: 200px}
> >> >>
> >> >> to the end of static/styles.css
> >> >> What's wrong?
> >> >> Julius
> >> >>
> >> >>
> >> >>
> >> >> On So, 2008-12-06 at 07:33 -0800, mdipierro wrote:
> >> >> > You cannot format it like a table but you can
> >> >> >
> >> >> > represent=lambda r: DIV(SPAN(r.field1,_class="col1"),SPAN
> >> >> > (r.field2,_class="col2"))
> >> >> >
> >> >> > and in css
> >> >> >
> >> >> > SPAN .col1 {width: 200px}
> >> >> > SPAN .col1 {width: 200px}
> >> >> >
> >> >> > Massimo
> >> >> >
> >> >> >
> >> >> > On Dec 6, 8:26 am, billf <[EMAIL PROTECTED]>
> >> >> wrote:
> >> >> > > If you look at the default represent() in t2.py you can
> >> >> see how to do
> >> >> > > whatever you want.  Maybe the default is what you want(?)
> >> >> > >
> >> >> > > On Dec 6, 2:09 pm, Julius Minka <[EMAIL PROTECTED]> wrote:
> >> >> > >
> >> >> > > > yes, I know.
> >> >> > > > I do it this way:
> >> >> > >
> >> >> > > > db.puppy.represent=lambda row: \
> >> >> > > >
> >> >> 
> >> >> P(A(row.name,_href=t2.action('display_puppy',[row.id])),SPAN(row.age))
> >> >> > >
> >> >> > > > The only trouble is, that it is not formattted like a
> >> >> table:
> >> >> > > > dog1
> >> >> > > > doggie2
> >> >> > >
> >> >> > > > I need
> >> >> > > > dog 1
> >> >> > > > doggiw  2
> >> >> > >
> >> >> > > > Julius
> >> >> > >
> >> >> > > > On So, 2008-12-06 at 05:35 -0800, billf wrote:
> >> >> > >
> >> >> > > > > are you using t2?  The t2 manual describes doing this
> >> >> by
> >> >> > >
> >> >> > > > > db.mytable.represent=lambda row: '%s %s' %
> >> >> (row.myfield,row.id)
> >> >> > >
> >> >> > > > > which I have used and it works fine.
> >> >> > >
> >> >> > > > > On Dec 6, 10:08 am, Julius Minka <[EMAIL PROTECTED]>
> >> >> wrote:
> >> >> > > > > > How can I format itemize output to a table (regular
> >> >> structure of
> >> >> > > > > > columns)? I am showing more columns on the line.
> >> >> > > > > > Something similar to default view for records...
> >> >> > > > > > Thanks
> >> >> > > > > > Julius
> 
> > 


--~--~-~--~~~---~--~~
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, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:13053] Re: itemize formatting

2008-12-06 Thread Julius Minka

So is this completely wrong direction in how to get a simple paginated
grid with a clickable lines (or one cell in a line to redirect to
display single record)?

On So, 2008-12-06 at 14:28 -0800, DenesL wrote:
> Inline elements like SPAN can't have a width, only block elements can.
> > 


--~--~-~--~~~---~--~~
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, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:13054] Re: itemize formatting

2008-12-06 Thread Julius Minka

Seems to be close to solution.

This works:
db.ware.represent=lambda r: [TD(r[name],_class="col1",_width="80px") for
name in db.ware.fields]

It is able to make the grid.


Now I need to combine it with my former version:

db.ware.represent=lambda row:
DIV( SPAN(A(row.artnr,_href=t2.action('display_ware',[row.id])),_class="col1"), 
SPAN(row.name,_class="col2"))

I have no clue how to do it to get both functionalities.
Any idea?
Julius

On So, 2008-12-06 at 23:37 +0100, Julius Minka wrote:
> So is this completely wrong direction in how to get a simple paginated
> grid with a clickable lines (or one cell in a line to redirect to
> display single record)?
> 
> On So, 2008-12-06 at 14:28 -0800, DenesL wrote:
> > Inline elements like SPAN can't have a width, only block elements can.
> > > 
> 
> 
> > 


--~--~-~--~~~---~--~~
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, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:13057] Re: itemize formatting

2008-12-06 Thread Julius Minka

essentialy solved:

db.ware.represent=lambda row:
DIV( 
SPAN(TD(A(row.artnr,_href=t2.action('display_ware',[row.id]))),_class="col1",_width="80px"),
 SPAN(TD(row.name),_class="col1",_width="80px"))

it needs only some more cosmetic work
thanks everybody for help.
julius


On So, 2008-12-06 at 23:40 +0100, Julius Minka wrote:
> Seems to be close to solution.
> 
> This works:
> db.ware.represent=lambda r: [TD(r[name],_class="col1",_width="80px") for
> name in db.ware.fields]
> 
> It is able to make the grid.
> 
> 
> Now I need to combine it with my former version:
> 
> db.ware.represent=lambda row:
> DIV( 
> SPAN(A(row.artnr,_href=t2.action('display_ware',[row.id])),_class="col1"), 
> SPAN(row.name,_class="col2"))
> 
> I have no clue how to do it to get both functionalities.
> Any idea?
> Julius
> 
> On So, 2008-12-06 at 23:37 +0100, Julius Minka wrote:
> > So is this completely wrong direction in how to get a simple paginated
> > grid with a clickable lines (or one cell in a line to redirect to
> > display single record)?
> > 
> > On So, 2008-12-06 at 14:28 -0800, DenesL wrote:
> > > Inline elements like SPAN can't have a width, only block elements can.
> > > > 
> > 
> > 
> > > 
> 
> 
> > 


--~--~-~--~~~---~--~~
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, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:13639] Re: on languages

2008-12-16 Thread Julius Minka

+1 fr.py

On Ut, 2008-12-16 at 00:11 -0800, mdipierro wrote:
> let's say you default to "en" and a visitor only accepts-language "fr-
> fr". You do not have "fr-fr.py" but you do have "fr.py". Should web2py
> use it or respond in english as it does now?
> 
> Massimo
> > 


--~--~-~--~~~---~--~~
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, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:14660] Re: Support for workflow?

2009-01-07 Thread Julius Minka

here, in my bookmarks, you can find some inspiration (design&code):
http://delicious.com/jumi/workflow


On Ut, 2009-01-06 at 22:43 -0800, Fran wrote:
> On Jan 7, 3:04 am, mdipierro  wrote:
> > If you could come up with a reasonable list of specs and references I
> > can try add that to T3.
> 
> Maybe pre-empting next Monday's discussion, but I'd prefer to see the
> basic support lower down the stack if that were possible.
> T3 would then include applet(s) which used this technology
> 
> F
> > 


--~--~-~--~~~---~--~~
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, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:14683] access to id in t2 view

2009-01-07 Thread Julius Minka

using T2 

http://127.0.0.1:8000/f7/default/display_ware/3

in controller:
def display_ware():
ware=t2.display(db.ware)
return dict(ware=ware)

in HTML:
{{extend 'layout.html'}}

Tovar
{{=ware}}


{{=A(' Modify',_href=URL(r=request,f='modify_ware/%s'%request.args))}}


How can I make the link to modify displayed ware? - How can I get that
id value? 
That closest thing I got is request.args, but it is ['3'], I need just
3.
I tried db.ware.id and ware.id without success.

Julius



--~--~-~--~~~---~--~~
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, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:14685] Re: access to id in t2 view

2009-01-07 Thread Julius Minka

that was it, thanks for fast answer

On St, 2009-01-07 at 08:34 -0800, mdipierro wrote:
> It is already parsed for you by t2 and stored in t2.id=int(request.args
> [-1])
> 
> {{=A(' Modify',_href=URL(r=request,f='modify_ware/%s'%t2.id))}}
> 
> 
> Massimo
> 
> On Jan 7, 10:29 am, Julius Minka  wrote:
> > using T2
> >
> > http://127.0.0.1:8000/f7/default/display_ware/3
> >
> > in controller:
> > def display_ware():
> > ware=t2.display(db.ware)
> > return dict(ware=ware)
> >
> > in HTML:
> > {{extend 'layout.html'}}
> > 
> > Tovar
> > {{=ware}}
> > 
> > 
> > {{=A(' Modify',_href=URL(r=request,f='modify_ware/%s'%request.args))}}
> > 
> >
> > How can I make the link to modify displayed ware? - How can I get that
> > id value?
> > That closest thing I got is request.args, but it is ['3'], I need just
> > 3.
> > I tried db.ware.id and ware.id without success.
> >
> > Julius
> > 


--~--~-~--~~~---~--~~
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, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:14693] default application page

2009-01-07 Thread Julius Minka

I have got following in controllers/default.py:

response.menu=[
['Tovar',False,t2.action('browse')],
['Odberatelia',False,t2.action('temp')]]

def index():
   return dict()

when I go to http://127.0.0.1:8000/my_app/
it displays page   views/default/index.html
and in this page, it inserts "default/" at the beginning of menu item
links: http://127.0.0.1:8000/my_app/default/browse 

I understand that web2py maps the path from controller to path in the
view.


My application otherwise works fine with following paths:
http://127.0.0.1:8000/my_app/browse
http://127.0.0.1:8000/my_app/modify/1
http://127.0.0.1:8000/my_app/create
...

It seems all other application I can see (admin,examples,puppy,cookbook)
work with "default".

How to make application default page to be without that "default" in the
path? I tried to use html redirect but it began to cycle.

Thanks.
Julius


--~--~-~--~~~---~--~~
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, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:14816] Re: default application page

2009-01-10 Thread Julius Minka

I solved it this way:

response.menu=[
['Faktúry',False,t2.action('../invoices/browse')],
['Tovar',False,t2.action('../ware/browse')],
['Dodávatelia',False,t2.action('../supplier/browse')],
['Odberatelia',False,t2.action('../customer/browse')]]

By using complete paths for menus I avoided prepending "default" to
links.
Application default page doesn't show "default" in the address bar and
by clicking the menu I take control and keep it out of "default" branch


On St, 2009-01-07 at 18:54 -0800, mdipierro wrote:
> You need to use routes_in and routes_out there are examples in
> routes.examples.py
> 
> On Jan 7, 2:54 pm, Julius Minka  wrote:
> > I have got following in controllers/default.py:
> >
> > response.menu=[
> > ['Tovar',False,t2.action('browse')],
> > ['Odberatelia',False,t2.action('temp')]]
> >
> > def index():
> >return dict()
> >
> > when I go tohttp://127.0.0.1:8000/my_app/
> > it displays page   views/default/index.html
> > and in this page, it inserts "default/" at the beginning of menu item
> > links:http://127.0.0.1:8000/my_app/default/browse
> >
> > I understand that web2py maps the path from controller to path in the
> > view.
> >
> > My application otherwise works fine with following 
> > paths:http://127.0.0.1:8000/my_app/browsehttp://127.0.0.1:8000/my_app/modify/1http://127.0.0.1:8000/my_app/create
> > ...
> >
> > It seems all other application I can see (admin,examples,puppy,cookbook)
> > work with "default".
> >
> > How to make application default page to be without that "default" in the
> > path? I tried to use html redirect but it began to cycle.
> >
> > Thanks.
> > Julius
> > 


--~--~-~--~~~---~--~~
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, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:14817] validation related to different table

2009-01-10 Thread Julius Minka

db.define_table('invoice_item',
SQLField('invoice_nr',required=True),
SQLField('ware',db.ware,required=True),
SQLField('discount','double',required=True),
SQLField('count','double',required=True))
db.invoice_item.ware.requires=IS_IN_DB(db,'ware.id','%(artnr)s%(size)s')

How to validate "count" field to be less or equal than db.ware.count in
corresponding record of table db.ware based on choice made by
invoice_item.ware?
To tell it simply, in human words: how to not sell more items than I
currently have?

I saw some validation examples in archives using IS_EXPR or custom
validators, but in those all relationships between fields stayed inside
the same table.

Julius



--~--~-~--~~~---~--~~
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, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:14830] represent and referenced table

2009-01-10 Thread Julius Minka

db.invoice.represent=lambda row: DIV(
SPAN(TD(A(row.invoice_nr,_href=t2.action('display',[row.id]))),_class="col1",_width="80px"),
 
SPAN(TD(row.date.strftime("%d.%m.%Y")),_class="col1",_width="80px"),
SPAN(TD(row.customer_id),_class="col1",_width="80px"))

on last line I would like to display not the id, but the referenced
"customer.name"

I couldn't find it in the archive.
julius


--~--~-~--~~~---~--~~
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, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:14831] t2.display showid?

2009-01-10 Thread Julius Minka

How to disable showing id? It doesn't seem to work the way it worked
with SQLFORM.
Julius


--~--~-~--~~~---~--~~
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, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:14840] Re: t2.display showid?

2009-01-10 Thread Julius Minka

Thanks, I did that already, but I wanted to simplify things.
Julius

On So, 2009-01-10 at 10:21 -0700, Wes James wrote:
> In db.py put something like this:
> 
> db.database.displays=['field3','field4']
> 
> -wj
> 
> On Sat, Jan 10, 2009 at 9:30 AM, Julius Minka  wrote:
> >
> > How to disable showing id? It doesn't seem to work the way it worked
> > with SQLFORM.
> > Julius
> >
> 
> > 


--~--~-~--~~~---~--~~
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, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:14847] Re: represent and referenced table

2009-01-10 Thread Julius Minka

thank you, it works great

On So, 2009-01-10 at 08:54 -0800, mdipierro wrote:
> replace :
> 
>row.customer_id
> with:
> 
>db(db.customer.id==row.customer_id).select()[0].name
> 
> On Jan 10, 10:23 am, Julius Minka  wrote:
> > db.invoice.represent=lambda row: DIV(
> > SPAN(TD(A(row.invoice_nr,_href=t2.action('display',[row.id]))),_class="col1",_width="80px"),
> > SPAN(TD(row.date.strftime("%d.%m.%Y")),_class="col1",_width="80px"),
> > SPAN(TD(row.customer_id),_class="col1",_width="80px"))
> >
> > on last line I would like to display not the id, but the referenced
> > "customer.name"
> >
> > I couldn't find it in the archive.
> > julius
> > 


--~--~-~--~~~---~--~~
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, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:14848] Re: default application page

2009-01-10 Thread Julius Minka

Thanks, I will do it as you wrote.
julius

On So, 2009-01-10 at 07:11 -0800, mdipierro wrote:
> You should use
> 
> URL(r=request,c='invoices',f='browse')
> 
> instead of t2.action(...)
> 
> On Jan 10, 4:24 am, Julius Minka  wrote:
> > I solved it this way:
> >
> > response.menu=[
> > ['Faktúry',False,t2.action('../invoices/browse')],
> > ['Tovar',False,t2.action('../ware/browse')],
> > ['Dodávatelia',False,t2.action('../supplier/browse')],
> > ['Odberatelia',False,t2.action('../customer/browse')]]
> >
> > By using complete paths for menus I avoided prepending "default" to
> > links.
> > Application default page doesn't show "default" in the address bar and
> > by clicking the menu I take control and keep it out of "default" branch
> >
> > On St, 2009-01-07 at 18:54 -0800, mdipierro wrote:
> >
> > > You need to use routes_in and routes_out there are examples in
> > > routes.examples.py
> >
> > > On Jan 7, 2:54 pm, Julius Minka  wrote:
> > > > I have got following in controllers/default.py:
> >
> > > > response.menu=[
> > > > ['Tovar',False,t2.action('browse')],
> > > > ['Odberatelia',False,t2.action('temp')]]
> >
> > > > def index():
> > > >return dict()
> >
> > > > when I go tohttp://127.0.0.1:8000/my_app/
> > > > it displays page   views/default/index.html
> > > > and in this page, it inserts "default/" at the beginning of menu item
> > > > links:http://127.0.0.1:8000/my_app/default/browse
> >
> > > > I understand that web2py maps the path from controller to path in the
> > > > view.
> >
> > > > My application otherwise works fine with following 
> > > > paths:http://127.0.0.1:8000/my_app/browsehttp://127.0.0.1:8000/my_app/modif...
> > > > ...
> >
> > > > It seems all other application I can see (admin,examples,puppy,cookbook)
> > > > work with "default".
> >
> > > > How to make application default page to be without that "default" in the
> > > > path? I tried to use html redirect but it began to cycle.
> >
> > > > Thanks.
> > > > Julius
> > 


--~--~-~--~~~---~--~~
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, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:14849] Re: validation related to different table

2009-01-10 Thread Julius Minka

without understanding much about how it works I put following (trying to
correct what I believed to be typos) to my model:

class LESS_THAN:
def __init__(self,db,query,field,error_message='Na sklade nie je
požadované množstvo'):
  self.db,self.query,self.field=db,query,field
  self.error_message=error_message
def __call__(self,value):
  try:
   value=inv(value)
   records=self.db(self.query).select(limitby=(0,1))
   if value<0 or value>=records[0][self.field]: raise
   return (value,None)
  except:
   return (value,self.error_message)

db.invoice_item.count.requires=LESS_THAN(db,db.ware.id==request.vars.id,'count')

It raises error in every case. What could be the problem? I would be
very thankful if somebody could explain "try" section to me.

Julius


On So, 2009-01-10 at 07:17 -0800, mdipierro wrote:
> class LESS_THAN
> def __init__(self,db,query,field,error_message='...'):
>   self.db,self.query,self.field=db,query,field)
>   self.error_message=error_message
> def __call__(self,value):
>   try:
>value=inv(value)
>records=self.db(self.query).select(limitby=(0,1))
>if value<0 or value>=records[0][self.field]: raise
>return (value,None)
>   except:
>return (value,self.error_message)
> 
> db.invoice_item.count.requires=IS_IN_DB
> (db,db.ware.id==request.vars.id,'count')
> 
> On Jan 10, 5:28 am, Julius Minka  wrote:
> > db.define_table('invoice_item',
> > SQLField('invoice_nr',required=True),
> > SQLField('ware',db.ware,required=True),
> > SQLField('discount','double',required=True),
> > SQLField('count','double',required=True))
> > db.invoice_item.ware.requires=IS_IN_DB(db,'ware.id','%(artnr)s%(size)s')
> >
> > How to validate "count" field to be less or equal than db.ware.count in
> > corresponding record of table db.ware based on choice made by
> > invoice_item.ware?
> > To tell it simply, in human words: how to not sell more items than I
> > currently have?
> >
> > I saw some validation examples in archives using IS_EXPR or custom
> > validators, but in those all relationships between fields stayed inside
> > the same table.
> >
> > Julius
> > 


--~--~-~--~~~---~--~~
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, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:15256] network access to web2py

2009-01-22 Thread Julius Minka

The web2py running on Linux is accessible only from the same computer at
address 127.0.0.1. I mean, application pages themselves, not admin
interface.

ifconfig (shortened)
eth0  Link encap:Ethernet  HWaddr 00:1D:60:C9:C9:1D  
  inet addr:192.168.0.1  Bcast:192.168.0.255  Mask:255.255.255.0
loLink encap:Local Loopback  
  inet addr:127.0.0.1  Mask:255.0.0.0
nas0  Link encap:Ethernet  HWaddr 00:13:33:C1:97:A0  
  UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
ppp0  Link encap:Point-to-Point Protocol  
  inet addr:91.127.bbb.ccc  P-t-P:213.81.xxx.yyy

It is DSL-connected PC.
I run Plone on the same machine on different port. Plone is locally
accessible at all addresses: localhost, 192.168.0.1 and public address.
At the same time it is also accessible from internet at the public
address and from intranet at the private address.
In the firewall configuration, the entries for for Plone and web2py are
the same except the port number.

What could be the reason web2py is not accessible the same way Plone is?

Julius



--~--~-~--~~~---~--~~
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, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:15272] Re: SOLVED network access to web2py

2009-01-22 Thread Julius Minka

it needs  0.0.0.0 as ip address to listen at.
This can be accomplished when starting web2py with the parameter "-i
0.0.0.0"

thanks to all for hints
Julius

On Št, 2009-01-22 at 14:53 +0100, Julius Minka wrote:
> The web2py running on Linux is accessible only from the same computer at
> address 127.0.0.1. I mean, application pages themselves, not admin
> interface.
> 
> ifconfig (shortened)
> eth0  Link encap:Ethernet  HWaddr 00:1D:60:C9:C9:1D  
>   inet addr:192.168.0.1  Bcast:192.168.0.255  Mask:255.255.255.0
> loLink encap:Local Loopback  
>   inet addr:127.0.0.1  Mask:255.0.0.0
> nas0  Link encap:Ethernet  HWaddr 00:13:33:C1:97:A0  
>   UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
> ppp0  Link encap:Point-to-Point Protocol  
>   inet addr:91.127.bbb.ccc  P-t-P:213.81.xxx.yyy
> 
> It is DSL-connected PC.
> I run Plone on the same machine on different port. Plone is locally
> accessible at all addresses: localhost, 192.168.0.1 and public address.
> At the same time it is also accessible from internet at the public
> address and from intranet at the private address.
> In the firewall configuration, the entries for for Plone and web2py are
> the same except the port number.
> 
> What could be the reason web2py is not accessible the same way Plone is?
> 
> Julius
> 
> 
> 
> > 


--~--~-~--~~~---~--~~
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, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:15356] Re: T3 / table header with itemize?

2009-01-23 Thread Julius Minka

Hi Ulrich,

did you succeed to align header with items?
My header is moved too much to the left.

Julius

On Po, 2008-12-29 at 04:51 -0800, Atanasius wrote:
> Hi folks!
> 
> I use the mechanism (posted from Julius Minka on December, 7th) to
> display a table via itemize:
> 
> db.firmen.represent=lambda row:\
> DIV(SPAN(TD(A(row.firma,_href=t2.action('wiki/firmabearbeiten',
> [row.id]))),_class="col1",_width="100px"), SPAN(TD
> (row.ort),_class="col1",_width="100px"))
> 
> Now I wonder if it is possible to display the field names (or better
> custom names) as a header for each column.
> 
> Any ideas? Thanks in advance
> 
> Ulrich
> > 


--~--~-~--~~~---~--~~
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, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:15392] submit_button

2009-01-24 Thread Julius Minka

submit_button is working in SQLFORM, but not int t2.
Is this intentional? How to change the label on submit button using t2?
Julius



--~--~-~--~~~---~--~~
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, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:15393] Re: submit_button

2009-01-24 Thread Julius Minka

sorry, I found it in the archive:
form.element(_type='submit').update(_value='click me!')

On So, 2009-01-24 at 20:59 +0100, Julius Minka wrote:
> submit_button is working in SQLFORM, but not int t2.
> Is this intentional? How to change the label on submit button using t2?
> Julius
> 
> 
> 
> > 


--~--~-~--~~~---~--~~
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, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:15483] Re: Session variable

2009-01-26 Thread Julius Minka

can you explain following in more depth?

"The view contains a menu, when the visitor clicks one of the menu items
one of the other functions should be exposed. The problem is passing on
the id."

my guess is you would like to have following:
in controlller function:
int(request.args[-1])
it gives you id from the view.

julius

On Po, 2009-01-26 at 12:38 -0800, annet wrote:
> In my application I have a controller with a number of functions. The
> first function gets an id from request.vars and uses it as a parameter
> in several queries, the result sets are returned in dictionaries. When
> I expose the function, the view consists of  elements in
> which the contents of the dictionaries are displayed. The view
> contains a menu, when the visitor clicks one of the menu items one of
> the other functions should be exposed. The problem is passing on the
> id.
> 
> I tried adding a session variable to the controller outside the
> functions:
> 
> session.idvariable
> 
> 
> And then in the first function give the idvariable a value:
> 
> session.idvariable=request.vars.id
> 
> (request.vars.id works when used as a parameter, so that cannot be the
> problem)
> 
> 
> And in the other functions retrieve it:
> 
> id=session.idvariable
> 
> 
> But that doesn't work. Does one of you know why?
> 
> 
> Best regards,
> 
> Annet
> > 


--~--~-~--~~~---~--~~
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, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:15563] t2.display

2009-01-28 Thread Julius Minka

can I somehow change the output of t2.display?

I need 2 things:
1. to format a date field
2. to change a reference to an other table to the corresponding value
from that other table

quick view at t2 source reveals, that t2.display returns
DIV(TABLE(*items),_class='t2-display')

that is my issue - how to change things inside it?
or is there any other way to customize it?

julius minka


--~--~-~--~~~---~--~~
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, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:15605] import_from_csv_file failure

2009-01-29 Thread Julius Minka

I put following code to a function in controller an ran it:

db.export_to_csv_file(open('f7bkp','w'))
for table in db.tables: db[table].truncate()
db.import_from_csv_file(open('f7bkp','r'))

export OK, drop tables OK, but import gave me:
File
"/home/julo/+/kubler/factor7/web2py/applications/factor7/controllers/ware.py", 
line 37, in receive
db.import_from_csv_file(open('f7bkp','r'))
  File "/home/julo/+/kubler/factor7/web2py/gluon/sql.py", line 651, in
import_from_csv_file
line=ifile.readline()
ValueError: Mixing iteration and read methods would lose data

In my model I did one change before, which was not reflected in my
sqlite database (expected behavior?). I have changed invoice.invoice_nr
from default type to integer. That was the reason for reloading of the
database. I hoped to get back changed database without data loss.
Here is the table:

TABLE invoice
invoice.id,invoice.invoice_nr,invoice.date,invoice.customer_id,invoice.issue_date,invoice.delivery_date,invoice.maturity_date,invoice.advance_pay,invoice.skonto
1,1,2009-01-10,1,2009-01-11,2009-01-14,2009-01-30,1000.0,3.0
2,2,2009-01-14,2,2009-01-15,2009-01-17,2009-01-20,15.0,2.0
3,3,2009-01-16,1,2009-01-18,2009-01-19,2009-01-29,0.0,3.0
4,4,2009-01-17,2,2009-01-18,2009-01-20,2009-01-30,15.0,0.0
6,5,2009-01-17,2,2009-01-19,2009-01-20,2009-01-21,0.0,5.0
7,6,2009-01-17,1,2009-01-19,2009-01-21,2009-01-28,0.0,0.0
8,7,2009-01-28,2,2009-01-28,2009-01-30,2009-02-02,100.0,0.0

I believe this was not the reason for failure as that column contains
just integer values and none of the tables were imported.

What could be the reason for import failure?
If needed I can provide you with the complete exported file and model.
Julius Minka


--~--~-~--~~~---~--~~
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, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:16605] value of a field based on other field in the form

2009-02-20 Thread Julius Minka

In a form, I have a dropdown and a textfield. 
Based on a selection made in the dropdown box (company name) I need to
fill the textfield (latest date for payment) with date counted as 
today+days. Days field is in the same table and row as the company name.
How to achieve that? I guess some Javascript or JQuery is needed.
Julius


--~--~-~--~~~---~--~~
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, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:16609] Re: value of a field based on other field in the form

2009-02-20 Thread Julius Minka


On Pi, 2009-02-20 at 04:28 -0800, Fran wrote:
> On Feb 20, 12:02 pm, Julius Minka  wrote:
> > How to achieve that? I guess some Javascript or JQuery is needed.
> 
> jQuery is great at this, yes.
> Something like:
> $(function() {
> $("select#company_name").change(function() {
> // What is the new type?
> type=$(this).val();
> if (type=="good") {
> $('input#date').val($("select#days").val())
> }
> }
> }
> 

Thanks, 
I guess this solves the problem as of getting and setting the values in
the form. Am I right, this doesn't solve getting respective days value
from the database? Here I see the main problem for me - after selecting
company_name to get respective days from DB for calculation. 
Julius


--~--~-~--~~~---~--~~
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, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py] kpax error on 1.89.2

2010-11-16 Thread Julius Minka
I tried to run KPAX. When setting permissions after creating a new item
(chat, news,...) I am getting an error described here:
http://groups.google.com/group/web2py/msg/2283b527c10f2804

Anybody else having this issue?
Julius