The "crazy" need not be that crazy. I normally do:
db.Field('myfield','string',
widget=lambda field,value,**kwargs:
StringWidget.widget(field,value,_size=40,**kwargs)
so that the output field has a size=40 setting.
css should also work. Just make sure your definition appear in right
does't work the #mytable_myfield solution, and I can't understand why!
(no web2py_ajax.html in code)
On 9 Ott, 07:15, "mr.freeze" wrote:
> Try using the class:
>
> input.string {
> width: 450px;
>
> }
>
> or if you don't want to affect all input.string:
>
> #mytable_myfield{
> width: 450
Hi Massimo,
Okay, redirect returns page but without any variable. Any hint how to
render a page name "loggedin" that says; "Hi Ed, welcome!" after a
succesful login using the code i created?. Sorry, i'm a newbie with
very limited web2py knowledge and stucked on this. Thank you in
advance Massimo.
Try using the class:
input.string {
width: 450px;
}
or if you don't want to affect all input.string:
#mytable_myfield{
width: 450px;
}
or go crazy...
db.define_table('mytable',Field('myfield','string'))
db.mytable.myfield.widget = lambda f,v: INPUT(_type="text", _value=v,
_class="craz
i would assume yes, but I'm not 100% sure.
Also, you have to disable web2py_ajax.html for your css to work propery.
web2py_ajax uses javascript to go through every input and change its width
property, effectively overwriting your css definitions. (and not working if
they have javascript disabled)
I know, but no effect. Strange.
Do you know if SQLFORM's argument onvalidation is executed before
inserting row?
On 8 Ott, 22:51, Thadeus Burgess wrote:
> leone,
>
> To change the size in css you have to use the width property, there is no
> "size" property in css.
>
> input #table_field {
>
The plot thickens. It looks like reference fields are stored as type
long internally and hit a repr at line 449 of sql.py in sql_represent
function. That is where it is converting 8 to 8L. I think line 448:
if fieldtype.find('.'):
mind that redirect is a function that raises an HTTP exception which
causes the server to send and HTTP 303 response. redirect never
returns and your view is never rendered.
Massimo
On Oct 8, 9:22 pm, ed wrote:
> The display went well because i filled a session with a constant "Ed"
> and not a
The display went well because i filled a session with a constant "Ed"
and not a result of a db().select(). So, the constant variable was
displayed without a hitch. When i used db().select() the display went
like:
[{'first_name': 'Ed'}]
The above display is the result of the following code:
Control
hello,
on page 198 of the manual there is an example to set the filename of
the uploaded file.
It uses "if request.vars.image", but I found that this statement is
never True, with or without an uploaded file.
Using "if 'image' in request.vars" is also no good because it will
still be True when n
> I really don't know much about GAE.
> Can you help in this issue?
yeah sure, I'll have a look.
On Oct 9, 7:28 am, Álvaro Justen [Turicas]
wrote:
> On Thu, Oct 8, 2009 at 09:27, Richard wrote:
>
> > It's great when people from the community take ownership of useful
> > applications like this
ATTENTION
only support for MS SQL legacy tables is included.
I have also tested DB2, so it should be in soon.
If you want to add support for other DBs then you have to modify
SQL_DIALECTS (around line 133 in sql.py) for your particular DB. I
don't have all the different DBs installed, so your he
yes.
-Thadeus
On Thu, Oct 8, 2009 at 4:55 PM, mdipierro wrote:
>
> Do you have multiple=True
>
> On Oct 8, 1:08 pm, Thadeus Burgess wrote:
> > Massimo, I removed the None option, however it seems when nothing is
> > selected, it does not pass validation!?
> >
> > -Thadeus
> >
> > On Wed, Oc
If the wiki does not use joins it should work on GAE. I do not recall
but if there are joins I am sure they can be removed.
Massimo
On Oct 8, 3:28 pm, Álvaro Justen [Turicas]
wrote:
> On Thu, Oct 8, 2009 at 09:27, Richard wrote:
>
> > It's great when people from the community take ownership of
Perhaps they have a small number of max connections? This should not
be a problem.
On Oct 8, 3:22 pm, Julio wrote:
> In your DB declaration (model) are you opening more than one
> concurrent connection? - I've seen that happen before (not on
> webfaction, but my own boxes), try removing the "poo
Do you have multiple=True
On Oct 8, 1:08 pm, Thadeus Burgess wrote:
> Massimo, I removed the None option, however it seems when nothing is
> selected, it does not pass validation!?
>
> -Thadeus
>
> On Wed, Oct 7, 2009 at 4:30 PM, Thadeus Burgess wrote:
>
> > Awesome, thanks a bunch!
>
> > -Thade
leone,
To change the size in css you have to use the width property, there is no
"size" property in css.
input #table_field {
width: 350px;
}
-Thadeus
On Thu, Oct 8, 2009 at 3:07 PM, leone wrote:
>
> Second question solved.
> About input length css has no effect.
> SQLFORM(onvalidation
On Thu, Oct 8, 2009 at 09:27, Richard wrote:
>
> It's great when people from the community take ownership of useful
> applications like this!
>
>
> Is the wiki able to run on the GAE?
I really don't know much about GAE.
Can you help in this issue?
> I noticed a few links that could perhaps be m
In your DB declaration (model) are you opening more than one
concurrent connection? - I've seen that happen before (not on
webfaction, but my own boxes), try removing the "pool_size" option in
the model if you have it set..
On Oct 8, 11:33 am, drayco wrote:
> Hi, I don't want this error happen.
Second question solved.
About input length css has no effect.
SQLFORM(onvalidation is executed before or after inserting row?
On 8 Ott, 17:23, Thadeus Burgess wrote:
> massimo,
>
> On my machine locally, web2py_ajax.html seems to overwrite any length
> settings put into css..
>
> The jQuery comm
Hi Massimo,
there is an interesting project for SQLAlchemy:
GeoAlchemy: Using SQLAlchemy with Spatial Databases
http://geoalchemy.org/
Do you think something like this is possible with the DAL you are writing?
Best,
Timmie
--~--~-~--~~~---~--~~
You received thi
On Thu, Oct 8, 2009 at 15:22, drayco wrote:
>
> With two machines with Windos Vista and IE6 It didn't work.
http://iedeathmarch.org/
--
Álvaro Justen
Peta5 - Telecomunicações e Software Livre
21 3021-6001 / 9898-0141
http://www.peta5.com.br/
--~--~-~--~~~---~--
Hi, I don't want this error happen. Please, Can you teach me how to
avoid this error with MySQL in WebFaction?
Traceback (most recent call last):
File "/home/user/webapps/app/web2py/gluon/restricted.py", line 178,
in restricted
exec ccode in environment
File "/home/user/webapps/app/web2py
With two machines with Windos Vista and IE6 It didn't work.
On Oct 6, 10:31 pm, mdipierro wrote:
> Has anybody tried submenus and IE. Do they work? I assumed they did
> not I tried once and it did not work for me.
>
> Massimo
--~--~-~--~~~---~--~~
You received thi
I am using checkboxes widget.
-Thadeus
On Thu, Oct 8, 2009 at 1:08 PM, Thadeus Burgess wrote:
> Massimo, I removed the None option, however it seems when nothing is
> selected, it does not pass validation!?
>
> -Thadeus
>
>
>
>
>
> On Wed, Oct 7, 2009 at 4:30 PM, Thadeus Burgess wrote:
>
>> A
Massimo, I removed the None option, however it seems when nothing is
selected, it does not pass validation!?
-Thadeus
On Wed, Oct 7, 2009 at 4:30 PM, Thadeus Burgess wrote:
> Awesome, thanks a bunch!
>
> -Thadeus
>
>
>
>
> On Wed, Oct 7, 2009 at 3:42 PM, mdipierro wrote:
>
>> tore integers.
yes - it's all pretty straight forward.
On Thu, Oct 8, 2009 at 1:02 PM, Carl wrote:
>
> Thanks! Nice and straightforward.
>
> On Thursday, October 8, 2009, mdipierro wrote:
> >
> > rows=db(db.auth_user.id>0).select(db.auth_user.email)
>
Realize that the expression in the db() portion is like t
Thanks! Nice and straightforward.
On Thursday, October 8, 2009, mdipierro wrote:
>
> rows=db(db.auth_user.id>0).select(db.auth_user.email)
>
> On Oct 8, 12:24 pm, Carl wrote:
>> hi,
>>
>> I've got a user id which I'd like to use to look-up that user's email
>> address.
>> I'm using Auth to crea
class ShortStr(str):
"""Small class to extend str functionality to add several (?)
custom methods
"""
def __init__(self, value):
self.value = value
def shorten(self, length=20, etc=' ..'):
""" Shortens the string to length 'length' and
adds 'etc' to the en
rows=db(db.auth_user.id>0).select(db.auth_user.email)
On Oct 8, 12:24 pm, Carl wrote:
> hi,
>
> I've got a user id which I'd like to use to look-up that user's email
> address.
> I'm using Auth to create all user accounts.
>
> I need to present a set of user email's to the currently logged in
>
hi,
I've got a user id which I'd like to use to look-up that user's email
address.
I'm using Auth to create all user accounts.
I need to present a set of user email's to the currently logged in
user.
thanks
--~--~-~--~~~---~--~~
You received this message because
That works! Thanks!
--Peter
On Oct 8, 12:17 pm, Thadeus Burgess wrote:
> You can set those in your controller dynamically.
>
> for example
>
> def admin_edit():
> db.tablename.fieldname.writable = True
> db.tablename.fieldname.readable = True
>
> return dict(form=crud(db.table
On Thu, Oct 8, 2009 at 11:04 AM, Youngblood wrote:
>
> I figured the problem out, it was missing the upload folder. I didnt
> copy that folder and the database over because the data on my computer
> was test data and i didnt want to over write the real data on the
> server. once i created the uplo
I think display_errors is an appropriate name.
Yes, I keep forgetting about the backwards compatibility thing :P
With this, could the form.custom.errors be added as well without breaking
anything?
-Thadeus
On Thu, Oct 8, 2009 at 11:24 AM, mdipierro wrote:
>
> Changing the default to False
Changing the default to False (even only or custom forms) would break
backward compatibility. We cannot do that. If no objections I will add
the display_errors but I will take suggestions for a better name.
Massimo
On Oct 8, 11:09 am, Thadeus Burgess wrote:
> >we just need to talk about this mo
You can set those in your controller dynamically.
for example
def admin_edit():
db.tablename.fieldname.writable = True
db.tablename.fieldname.readable = True
return dict(form=crud(db.tablename))
def normal_edit():
db.tablename.fieldname.writable = False
db.tablenam
>we just need to talk about this more and get more opinions. I can be
>convinced. The code you proposed does not show errors by default any
>more.
>That is a break of backward compatibility.
Yes, that is why I was requesting help from web2py gurus :P
I like the idea for
form.display_errors = Fal
I figured the problem out, it was missing the upload folder. I didnt
copy that folder and the database over because the data on my computer
was test data and i didnt want to over write the real data on the
server. once i created the upload folder it works fine.
Would it be a good idea to have web2
I never had to do this. All the JS libraries I ever used use relative
references since they do now know in which folder they are installed.
I do not understand.
On Oct 8, 10:42 am, Álvaro Justen [Turicas]
wrote:
> On Thu, Oct 8, 2009 at 07:30, sebastian wrote:
>
> > Hi All,
>
> > I am using a J
This could work, but this solution is more permanent than I want.
I'd like to make it so that I could dynamically select the fields I
want to edit. I know I can do it with SQLform but without all of the
nice features that crud provides.
Other thoughts?
thanks!
--Peter
On Oct 8, 11:30 am, Thade
can you try from a windows shell
C:\\Inetpub\\wwwroot\\web2py\\applications\\init/databases\\..\\uploads
\\
C:\\Inetpub\\wwwroot\\web2py\\applications\\init\\uploads\\
does any of them work?
On Oct 8, 9:35 am, Youngblood wrote:
> I am getting the following error and i can't figure out why:
>
On Thu, Oct 8, 2009 at 07:30, sebastian wrote:
>
> Hi All,
>
> I am using a JS library (http://jquery.com/demo/thickbox/) which refer
> to "images/something.jpg". That works perfectly on static HTML but
> web2py translates it as "http://blabla/init/default/images/
> something.jpg".
>
> as work
I have to admit I read Markus too fast and I missed that point.
On Oct 8, 9:33 am, Yarko Tymciurak wrote:
> On Thu, Oct 8, 2009 at 9:06 AM, mdipierro wrote:
>
> > On a second thought why is this not supported?
>
> > Because I am not convinced this is a good idea.
>
> > If every record of ta
Try setting the fields that you do not want edited with their
writable=False. Then using the basic {{=form}} syntax.
db.tablename.fieldname.writable = False
db.tablename.fieldname.readable = False
-Thadeus
On Thu, Oct 8, 2009 at 10:21 AM, Peter Woolf wrote:
> Hello,I'm very pleased with how
massimo,
On my machine locally, web2py_ajax.html seems to overwrite any length
settings put into css..
The jQuery commands that change the length need to be either commented out
or removed.
-Thadeus
On Thu, Oct 8, 2009 at 8:07 AM, mdipierro wrote:
>
> You should set it using css. For a tab
If you are wanting to split the text in python, just use splices!
MAX_LENGTH = 252
mystr = """
this is actually a very very long text blob about why this guy on his
blog thinks that IE is evil, though it has no real content and is really
just a waiste of time reading!
"""
You can go
short
maybe, but if that is the problem where is it coming from. in the
sqlform that is generated, i just click browse to select picture, so
i'm not putting any of the path in there.
another point i meant to mention, my laptop is running Vista Home
Premium 64bit, the server is running Windows Server 20
just to point out:
On Thu, Oct 8, 2009 at 9:35 AM, Youngblood wrote:
>
> I am getting the following error and i can't figure out why:
>
> Traceback (most recent call last):
> File "gluon/restricted.py", line 178, in restricted
> File "C:/Inetpub/wwwroot/web2py/applications/init/controllers/
> i
I am getting the following error and i can't figure out why:
Traceback (most recent call last):
File "gluon/restricted.py", line 178, in restricted
File "C:/Inetpub/wwwroot/web2py/applications/init/controllers/
inventory.py", line 344, in
File "gluon/globals.py", line 102, in
File "C:/I
On Thu, Oct 8, 2009 at 9:06 AM, mdipierro wrote:
>
> On a second thought why is this not supported?
>
> Because I am not convinced this is a good idea.
>
> If every record of table A only references one record of table B and
> vice versa then perhaps there should be only one table AB.
>
> If
On Thu, Oct 8, 2009 at 3:59 AM, Markus Schmitz wrote:
>
> Hi everybody,
>
> .
> looks something like this:
>
> db.define_table('ports',
>Field('name','string'),
>Field('port_agent_id','references port_agents') # this references
> ahead and does not work
>
You have a typo here - this
Python 2.5. I will email the application to you since the controller
and model are fairly large.
On Oct 8, 12:45 am, mdipierro wrote:
> and which python version.
>
> usually>>> a=8L
> >>> print str(a)
> 8
> >>> print repr(a)
>
> 8L
>
> but there is no repr in DAL anymore.
> strange
>
> On Oct 7
On a second thought why is this not supported?
Because I am not convinced this is a good idea.
If every record of table A only references one record of table B and
vice versa then perhaps there should be only one table AB.
If this is a one (A) to many (B) relation then A cannot contain a
re
The Spanish Mirror of Slashdot, discuss about RoR vs Django...
http://preguntas.barrapunto.com/article.pl?sid=09/10/05/1211242
translated:
http://translate.google.com/translate?prev=hp&hl=es&js=y&u=http%3A%2F%2Fpreguntas.barrapunto.com%2Farticle.pl%3Fsid%3D09%2F10%2F05%2F1211242&sl=es&tl=en&hist
Thanks Richard, I'll improve it, when I have more time .
Alex F
El 08/10/2009 14:34, Richard escribió:
> nice - I prefer it to the default theme.
>
>
> On Oct 8, 9:50 am, Alex Fanjul wrote:
>
>> Yes of course.
>> Here it is.
>>
>> Alex F
>>
>> El 07/10/2009 20:50, mdipierro escribió:
>>
>>
>
it is located in static (same directory of jquery)
On Thu, Oct 8, 2009 at 1:57 PM, mdipierro wrote:
>
> Something is wrong somewhere. Where is the Js library located? Is it
> in static?
>
> On Oct 8, 5:30 am, sebastian wrote:
> > Hi All,
> >
> > I am using a JS library (http://jquery.com/demo/t
sorry, please try again.
On Oct 8, 7:23 am, Alex Fanjul wrote:
> With {{=LOAD('plugin_hello',ajax=True)}} it throws this ticket:
>
> Traceback(most recent call last):
>
> File"E:\Downloads\Programacion\Python\web2py\devel\gluon\restricted.py",line178,inrestricted
> execccodeinenviron
Where is this function so i can modify it.
On 4 oct, 20:06, Iceberg wrote:
> The IS_UPPER() is based on python's upper(). In python document it
> said,
>
> Return a copy of the string converted to uppercase.
> For 8-bit strings, this method is locale-dependent.
>
> So if your locale doesn't
Thank you Markus,
technically they are not allowed but you can do with a trick
db.define_table('ports',
Field('name','string'),
Field('port_agent_id','integer')
)
db.define_table('port_agents',
field('name','string',
Field('port_id', db.ports),
)
db.ports.port_agent_id
You should set it using css. For a table "table" and a field "field"
the id of the input field is
"#table_field"
you should be able to do something like this in the page
input #table_field { size: 5 }
On Oct 8, 8:01 am, leone wrote:
> Two questions:
> 1) how can I set the length of an html
Hi everybody,
After evaluating quite a number of web frameworks, I ended up with
web2py and frankly I am more than impressed. It rocks in many ways
(could talk about it for some time really) and fits very close to my
internal requirements.
But I am a newbee and I am running into newbee problems:
I do not know if it a good idea but you can
create a controller called, for example "any" and in it
def index():
response.view='any/%s.html' % request.args(0)
return dict()
and then in routes.py:
routes_in=('/yourapp/any/(?P.*)','/yourapp/any/index/\g'),)
routes_out=('/yourapp/any/in
Two questions:
1) how can I set the length of an html input field generated by
SQLFORM? They have all the same size.
2) It needs same commit() using SQLite? My submits seem to generate
no rows.
Thanks in advance.
--~--~-~--~~~---~--~~
You received this message beca
Something is wrong somewhere. Where is the Js library located? Is it
in static?
On Oct 8, 5:30 am, sebastian wrote:
> Hi All,
>
> I am using a JS library (http://jquery.com/demo/thickbox/) which refer
> to "images/something.jpg". That works perfectly on static HTML but
> web2py translates it a
this functionality can be twofold
1. "simple" css hack that will cover fix it instantly :)
http://www.css3.com/css-text-overflow/
2. "hard" way would be count words and if too long (or too many chars)
split at last space in "too much" from right side (oposite side
search)
http://www.wdvl
db.define_table(,migrate=False)
the table must have the declared field AND and field called 'id'
autoincrement primary key.
On Oct 8, 1:16 am, Arvind wrote:
> Hello,
>
> I have already defined tables in a database.
> I need to generate forms using sql form
> in my code
>
> db = DAL('sqlite:
nice - I prefer it to the default theme.
On Oct 8, 9:50 am, Alex Fanjul wrote:
> Yes of course.
> Here it is.
>
> Alex F
>
> El 07/10/2009 20:50, mdipierro escribió:
>
>
>
> > Could you email it to me as a zip? I have problems with rar. sorry.
>
> > On Oct 7, 11:55 am, Alex Fanjul wrote:
>
> >
I have some long strings. How do I shorten them with the "..." feature?
So when I talk on and on it will... :P
Regards,
Jason Brower
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to t
I don't think so. But I doubt that 2 lines a page is that big of a
deal. It comes in especially handy when you need to call the page.
On Thu, Oct 8, 2009 at 3:17 PM, sebastian wrote:
>
> Hi All,
>
> I have a lot of pages that do not need any controller activity.
> Therefore I have a lot of
>
It's great when people from the community take ownership of useful
applications like this!
Is the wiki able to run on the GAE?
I noticed a few links that could perhaps be made more pretty:
- tags
- edit page
Also is it possible to edit the page I'm looking at directly? I only
saw the edit link
With {{=LOAD('plugin_hello',ajax=True)}} it throws this ticket:
Traceback(most recent call last):
File"E:\Downloads\Programacion\Python\web2py\devel\gluon\restricted.py",line178,inrestricted
execccodeinenvironment
File"E:\Downloads\Programacion\Python\web2py\devel\applications\test/
Ok, I got it working
little correction (name > your_name):
def index():
form=SQLFORM.factory(Field('your_name'))
if form.accepts(request.vars,session):
return "Hello "+form.vars.your_name
else:
return form.xml()
thanks,
alex f
El 05/10/2009 6:40, mdipier
Hi All,
I have a lot of pages that do not need any controller activity.
Therefore I have a lot of
def my_function():
return dict()
and then a my_function.html with my html.
Is there any way to create html pages without creating any associated
function ?
thanks ?
--~--~-~--~~
Hi massimo, could you say me what is the easiest way to download from
trunk?
I tried by web interface, but I didnt find the donwload shurtcut, the
last time I download a bazaar client my computers (with windows 7)
showed some issues... :-(
thanks in advance,
alex f
El 05/10/2009 6:40, mdipi
Hi All,
I am using a JS library (http://jquery.com/demo/thickbox/) which refer
to "images/something.jpg". That works perfectly on static HTML but
web2py translates it as "http://blabla/init/default/images/
something.jpg".
as work around I'd like to create a controller names images that
returns
thanks :)
I will take some free time to write a example base on trunk :p
On Oct 7, 10:24 pm, mdipierro wrote:
> Check again. I added it now.
>
> On Oct 7, 6:42 am, AndCycle wrote:
>
> > oops, the patch been cut by width restriction on mailing list lol
>
> > here is pastebinhttp://pastebin.com/
On Oct 5, 12:46 pm, Carl wrote:
> Is this happening in your local development environment is it using
> sqlite?
> If so, the only solution I found was to delete the local database and
> start over.
>
> On Oct 5, 9:23 am,mika wrote:
>
>
>
> > hi!
>
> > The problem is that traceback shows that co
why wouldn't it be?
On Oct 8, 1:51 am, Richard wrote:
> is that the proper way to do it, having a separate controller for each
> operation? The routes approach sounds more flexible.
> Richard
>
> On Oct 7, 12:23 pm, Mengu wrote:
>
> > massimo,
>
> > actually this wasn't what i am asking, but th
Solved it. Was not able to refresh the changes I made.
On Oct 8, 4:29 pm, ed wrote:
> Correction on Controller code:
> if form.accepts(request.vars, session):
> em = request.vars.emailad
> row=db(db.auth_user.email==em).select (db.auth_user.first_name)
> return dict(red=redirect(URL(r=req
Correction on Controller code:
if form.accepts(request.vars, session):
em = request.vars.emailad
row=db(db.auth_user.email==em).select (db.auth_user.first_name)
return dict(red=redirect(URL(r=request,f='loggedin')),name=row)
...
View:
{{extend 'layout2.html'}}
Hi {{=name}}
...
Hi,
I've been trying to return a variable from a controller to a view
using dict() but wasn't able display it. I have the following code:
Controller:
if form.accepts(request.vars, session):
row=db(db.auth_user.email==em).select
(db.auth_user.first_name)
return dict(red=red
81 matches
Mail list logo