On 8 October 2011 17:19, Massimo Di Pierro massimo.dipie...@gmail.comwrote:
Almost any query an be build using the dal.
How would this type of postgresql-query be translated into DAL?
WITH regional_sales AS (
SELECT region, SUM(amount) AS total_sales
FROM orders
GROUP
On Wed, 16 Sep 2009 19:08:57 -0700 (PDT)
mdipierro mdipie...@cs.depaul.edu wrote:
No but it would be really nice. If done right the same code would be
use to build tables (models) and forms.
I know it's an old thread, but I hope you won't mind...
Playing with Instant Press in order to move my
I found the solution, I was making it too complicated. Thank you for
indirectly solving my problem.
I moved the whol stuff to the cron job and make the frontend lean and mean. So
no need anymore for threads the frontend.
One question. when I run web2py in a cronjob can I use thread there ? Or
hi , i am developing the configurable system for four clients . i want
the code should be deployed on the single instance and should support
the diffrent features depending upon who is logged in...also there
should be a single database for all the clients..in order to impliment
multi tenecy i
Hi web2py users,
does anybody use Webfaction as hosting and use Webfactions SMTP servers
to send mail?
What settings are you using?
I can´t web2py to send mails from Webfaction.
Kenneth
Sorry it took so long to get back. Been a crazy couple of days:
This is my controller:
@auth.requires_login()
def index():
form = SQLFORM.factory(
Field('partnumber', length=30, requires=IS_NOT_EMPTY()),
Field('quantity', 'double', default=1,
requires=IS_FLOAT_IN_RANGE(0.1,
I used Python's PDB extensively. I develop a couple of JSONRPC/XMLRPC
services with no GUI on web2py and logging helps, but sometimes you just
need to step through the code. Anywhere I need the Python code to break
execution, I just put in this line:
import pdb; pdb.set_trace()
Then you are
thanks a lot Marin, I've missed this change in generic.html
On 7 Ott, 12:06, Marin Pranjić marin.pran...@gmail.com wrote:
https://groups.google.com/forum/#!msg/web2py/26g9XA_0ZXE/4yiIHs5FivkJhttp://groups.google.com/group/web2py/browse_thread/thread/485ee82885...
It is related to security
Hi list,
I have a database table which looks like this:
postcode_cache
postcode (UNIQUE)
lat
lon
nearest
I want to test first whether or not a record exists for 'postcode' and
if a record does exist, I want to check whether the 'nearest' field
contains any data.
I've
in db.py
mail.settings.server = 'smtp.webfaction.com'
mail.settings.sender = 'some email of yours'
mail.settings.login = 'user:pwd' # your webfaction name and password,
you may change the password for mailboxes from webfaction panel
then from controllers
You cannot. The DAL does not support the WITH statement. You have to
use db.executesql
On Oct 10, 1:55 am, Johann Spies johann.sp...@gmail.com wrote:
On 8 October 2011 17:19, Massimo Di Pierro massimo.dipie...@gmail.comwrote:
Almost any query an be build using the dal.
How would this type
On Oct 10, 2:54 am, Mike Veltman mike.velt...@gmail.com wrote:
I found the solution, I was making it too complicated. Thank you for
indirectly solving my problem.
I moved the whol stuff to the cron job and make the frontend lean and mean. So
no need anymore for threads the frontend.
One
I like the new grid/smartgrid a lot, but when you have many linked tables
the grid appears a little bit cluttered.
What do you think of an option that hide all links/buttons (but not detail
button) from the grid, but show them on the detail view?
Thank you
--
Massimiliano
http://web2py.com/book/default/chapter/06?search=tenant
On Oct 10, 5:09 am, Saurabh S ggtestlo...@gmail.com wrote:
hi , i am developing the configurable system for four clients . i want
the code should be deployed on the single instance and should support
the diffrent features depending upon
row = db.postcode_cache(postcode=postcode)
if not row:
db.postcode_cache.insert(postcode=postcode,nearset=nearest)
elif not row.nearest: row.update_record(nearset=nearest)
else: pass # do nothing
On Oct 10, 8:22 am, Chris Rowson christopherrow...@gmail.com wrote:
Hi list,
I have a database
def grid(query, fields=None, field_id=None,
left=None, headers={}, columns=None,
orderby=None, searchable=True,
sortable=True, paginate=20, deletable=True,
Thank you Massimo :-)
Chris
On Mon, Oct 10, 2011 at 2:55 PM, Massimo Di Pierro
massimo.dipie...@gmail.com wrote:
row = db.postcode_cache(postcode=postcode)
if not row:
db.postcode_cache.insert(postcode=postcode,nearset=nearest)
elif not row.nearest: row.update_record(nearset=nearest)
else:
When I use IE9 to access admin and edit any file in an app, the
contents of the editor window are all highlighted and there's no way
to get out of it. This makes editing impossible.
Has anyone else found this?
Not that it really matters to me because I just use Chrome or Firefox,
instead. But
redirect() works by raising an HTTP exception, so I think the redirect in
your try is triggering your except, so it ends up flashing the response body
of the redirect. Why are you catching HTTP exceptions -- is anything in your
try likely to trigger an HTTP?
Anthony
On Monday, October 10,
Yes, the default editor does not work on IE9. It's usable in IE7/IE8, though
with an odd highlighting quirk. In IE9, you can switch to compatibility
mode, or there is a toggle editor option that changes the editor to a
regular text area (so no syntax highlighting). There's an alternative Amy
I didn't think about the try/except. The add_partnumber method will throw an
HTTP exception if something fails, so that's why I was catching it. I moved
the redirect() outside of the try/except and it is working as expected now.
Thanks for catching that!
On Oct 10, 2011, at 6:51 AM, Massimo Di Pierro wrote:
On Oct 10, 2:54 am, Mike Veltman mike.velt...@gmail.com wrote:
I found the solution, I was making it too complicated. Thank you for
indirectly solving my problem.
I moved the whol stuff to the cron job and make the frontend lean and
oops. true.
On Oct 10, 9:30 am, Jonathan Lundell jlund...@pobox.com wrote:
On Oct 10, 2011, at 6:51 AM, Massimo Di Pierro wrote:
On Oct 10, 2:54 am, Mike Veltman mike.velt...@gmail.com wrote:
I found the solution, I was making it too complicated. Thank you for
indirectly solving my
Thank you Massimo, I'm aware of that.
I was just looking for a way to show all buttons but detail only in the
detail view (the one generated from the grid) and not in the table view.
--
Massimiliano
On Mon, Oct 10, 2011 at 3:58 PM, Massimo Di Pierro
massimo.dipie...@gmail.com wrote:
def
You cannot, but open a ticket and we may add a flag for that.
On Oct 10, 9:35 am, Massimiliano mbelle...@gmail.com wrote:
Thank you Massimo, I'm aware of that.
I was just looking for a way to show all buttons but detail only in the
detail view (the one generated from the grid) and not in the
I have a form containing the following validator:
requires=IS_MATCH('\d{2}',error_message='no match 2 digits')
When the user violates this constraint an error message is being
displayed, however, this is written in the terminal:
Storage {'region': lazyT 'no match 2 digits'}
Why is that? Can I
Until now i did all my db queries with the DAL from web2py.
But first the first i now got a raw sql file that needs to be execute
at a certain point.
In the terminal i use the '\i' command to import and execute a sql
script.
If i try to use this with db.executesql(\i /path/to/file.sql) i get
an
Calls are not executed with the psql command, they are done with psycopg2.
You could try a subprocess.POpen call:
import subprocess
...
sp = subprocess.POpen(psql {insert remainder of command line here},
shell=True)
For more on the options of the subprocess
module:
The behavior of the date picker seems to have changed from a certain
version.
For now, we should apply a patch to the anytime.js:
545 - this.showPkr(null);event.preventDefault();},keyAhead:function()
545 + return;event.preventDefault();},keyAhead:function()
[for readable version
re the image application: my recommendation is use blobstore for the
images. then you can use the google high-performance image serving URL
(which last i checked both is faster than anything you can do directly and
cheaper). That serves your images then using the same technology as picassa
Many thanks Vasile,
I´m 100% sure I tested the same setting many times before, but no luck.
Now I copied your settings and voila it works.
It´s sometimes so frustrating to search for errors and after hours of
searching it just works without finding what was wrong. But I guess
thats the life
I've an existing table:
db.define_table('service_type',
Field('cost_car_km', 'decimal(7,2)', notnull=True), ...)
there is already some data in the table. Now I changed the field to
Field('cost_car_km', 'decimal(7,3)', notnull=True),
the next time I try to call a page I get this error:
Specify a default value for the field, there may be NULLs in that column
right now, which violates the NULL contraint you are adding to the table.
Perhaps 0 would make a good default for your field.
Web2py DAL is Freaking Best Piece of Software Ever come into existance :) !
Use it , You Must!
On Sat, Oct 8, 2011 at 9:54 PM, Chris Rowson christopherrow...@gmail.comwrote:
Thanks Massimo,
I'm very new at this and found the DAL a bit intimidating. I'm
beginning to get the hang of it now
Can you please email me the patch?
On Oct 10, 11:35 am, kenji4569 hos...@s-cubism.jp wrote:
The behavior of the date picker seems to have changed from a certain
version.
For now, we should apply a patch to the anytime.js:
545 - this.showPkr(null);event.preventDefault();},keyAhead:function()
Is it possible to support with?
On Mon, Oct 10, 2011 at 8:21 PM, Massimo Di Pierro
massimo.dipie...@gmail.com wrote:
You cannot. The DAL does not support the WITH statement. You have to
use db.executesql
On Oct 10, 1:55 am, Johann Spies johann.sp...@gmail.com wrote:
On 8 October 2011
As shown in the example above the field already had a notnull=True
constraint so there were no NULLs in the existing rows. But
nevertheless it works with a default value, thanks!
It seems that a default value is needed for the migration process by
web2py. Is this true?
I can't say for sure, sorry. Given the error comes from PostgreSQL
(IntegrityError), I'd wager it's probably a PostgreSQL thing.
This is the field def:
Field('status', 'list:string'),
then:
db.mytable.status.requires = IS_IN_SET(
{'n': 'New', 'I':'In process', 'C':'Complete'},
zero = 'Choose'
)
When editing, SQLFORM shows the zero choice when on opening. The
choices display correctly and can be changed.
On the
Since 'status' is a list:string field, why not set multiple=True?
IS_IN_SET(..., multiple=True)
Anthony
On Monday, October 10, 2011 2:45:48 PM UTC-4, Cliff wrote:
This is the field def:
Field('status', 'list:string'),
then:
db.mytable.status.requires = IS_IN_SET(
{'n': 'New',
I would like to use concept of shared form
(http://web2py.com/book/default/chapter/07#Sharing-Forms) and I want to have
a more submit buttons, each to different action on controller. How can I
sinmply make a more buttons each submiting form to different action.
Is there a way to use DAL to make a GAE query by entity name (not just
numeric id)? I remember a discussion on the list about GAE keys with parents
and a proposed patch for DAL to be able to pass GAE Key instead of if id. I
see this implemented in the DAL code:
with
{{=request.url}}
i will get
/some/my/url/address
but when I tray next example it is not working:
{{
myurl = request.url:
i = /some/my/url/address:
if i == myurl:
response.writ('my first HTML output')
else:
response.write('my other HTML output')
pass
}}
how to resolve this, I need one part
Are you using list:string? Can you post the relevant parts of your model
and controller?
Anthony,
I don't want multiple values. I just want one of those values.
Is IS_IN_SET the incorrect way to do what I want.
On Oct 10, 2:52 pm, Anthony abasta...@gmail.com wrote:
Since 'status' is a list:string field, why not set multiple=True?
IS_IN_SET(..., multiple=True)
Anthony
On
Open a ticket. It is not going to happen today but we are committed to
make DAL more and more powerful.
On Oct 10, 1:17 pm, Phyo Arkar phyo.arkarl...@gmail.com wrote:
Is it possible to support with?
On Mon, Oct 10, 2011 at 8:21 PM, Massimo Di Pierro
massimo.dipie...@gmail.com wrote:
On Mon, Oct 10, 2011 at 5:38 PM, Cliff cjk...@gmail.com wrote:
Anthony,
I don't want multiple values. I just want one of those values.
If you want only one value, why are you using list:string?
change to
Field('status', 'string'),
Paolo,
I finished the setting and access http://ochiba-183(My PC Name) but it
shows the default index.php under www and not web2py.
d4 - open %WINDOWS%\system32\drivers\etc\hosts file and add the
alias 127.0.0.1 web2py.localhost. Replace server's IP to 127.0.0.1
and access to web2py from not
On Monday, October 10, 2011 4:03:49 PM UTC-4, miroslavgojic wrote:
with
{{=request.url}}
i will get
/some/my/url/address
but when I tray next example it is not working:
{{
myurl = request.url:
i = /some/my/url/address:
if i == myurl:
response.writ('my first HTML output')
else:
Do you mean one form with multiple submit buttons?
On the form:
{{=INPUT(_type='submit', _name='submit_one')}}
{{=INPUT(_type='submit', _name='submit_two')}}
In the controller:
if request.vars['submit_one']:
do something ## maybe call a function
elif request.vars['submit_two']
do
If you want only one value, why are you using list:string?
Misread the book :(
Thanks, anyway.
I'm not sure there's an easy way to do that in HTML, as the form's 'action'
attribute determines where the form is posted. But you might use Javascript
(jQuery) to dynamically change the form's action based on the button that is
clicked.
See
Wait a minute, though. I want a drop down menu.
So if I do this:
Field('status', 'string', requires = IS_IN_SET({'A' : 'Apple', 'B':
'Banana'}))
I will get a drop down?
On Oct 10, 4:40 pm, Bruno Rocha rochacbr...@gmail.com wrote:
On Mon, Oct 10, 2011 at 5:38 PM, Cliff cjk...@gmail.com wrote:
On Monday, October 10, 2011 5:01:52 PM UTC-4, Cliff wrote:
Wait a minute, though. I want a drop down menu.
So if I do this:
Field('status', 'string', requires = IS_IN_SET({'A' : 'Apple', 'B':
'Banana'}))
I will get a drop down?
Yes.
Made the change as recommended - still not working.
On Oct 10, 5:01 pm, Cliff cjk...@gmail.com wrote:
Wait a minute, though. I want a drop down menu.
So if I do this:
Field('status', 'string', requires = IS_IN_SET({'A' : 'Apple', 'B':
'Banana'}))
I will get a drop down?
On Oct 10, 4:40
See http://web2py.com/book/default/chapter/07#Widgets.
On Monday, October 10, 2011 5:09:03 PM UTC-4, Anthony wrote:
On Monday, October 10, 2011 5:01:52 PM UTC-4, Cliff wrote:
Wait a minute, though. I want a drop down menu.
So if I do this:
Field('status', 'string', requires =
This is much better ...
just how to define condition only for index page (or function or controller)
{{if condition:}}
how to make definition of condition -
there no need to be request.url it can be request.controller
when I tray this I get an error:
{{if {{=request.function}} == index:}}
your
Hi Omi,
I wasn't sure this part, so I just add 127.0.0.1 ochiba-183 to my hosts.
Try to replace with 10.30.6.122 ochiba-183
Let me know if it works.
Ciao.
Paolo
{{if {{=request.function}} == index:}}
Yes, once you're inside a {{}}, you can write any Python and refer to any
global (or local) variables -- so no need to nest another {{=}} in there.
Mostly fixed now. There was also a bug in my controller code that was
complicating things.
One problem remains. With readonly=True, the field still shows the
dictionary key rather than the value.
On Oct 10, 5:09 pm, Cliff cjk...@gmail.com wrote:
Made the change as recommended - still not
just tested
values = ((0, 'value 1'), (1, 'value 2))
db.table.field.requires = IS_IN_SET(values)
works ok.
On Mon, Oct 10, 2011 at 7:01 PM, Cliff cjk...@gmail.com wrote:
Mostly fixed now. There was also a bug in my controller code that was
complicating things.
One problem remains. With
In fact this
{{if {{=request.function}} == index:}}
is wrong because web2py would look for the first {{ and the first }}
and try interpret the code in between as python. By
if {{=request.function is not valid python.
You want:
{{if request.function == 'index':}}
On Oct 10, 4:28 pm, Anthony
I'm using the Field in a rather unconventional way - I just have a
number of Field objects in a class that I refer to as my model (its
not actually connected to any database), and I use the SQLFORM.factory
to generate the form. The actual Field entry in the form looks like
this:
AutoStart =
Paolo,
You made my day !! web2py is up and pyodbc works fine under wsgi !!!
Grazie molto!
On Oct 10, 4:20 pm, Paolo Caruccio paolo.carucci...@gmail.com wrote:
Hi Omi,
I wasn't sure this part, so I just add 127.0.0.1 ochiba-183 to my hosts.
Try to replace with 10.30.6.122 ochiba-183
Let me
I am very glad I helped
Ciao.
Paolo
The result is splendid with your changes.
I want only suggest to replace the row # 1344 in /gluon/sqlhtml.py with this
jQuery('#w2p_query_fields').val('').change();
so the change event is fired and when you query again the .w2p_query_row is
hidden.
Ciao.
Paolo
On Monday, October 10, 2011 6:01:49 PM UTC-4, Cliff wrote:
Mostly fixed now. There was also a bug in my controller code that was
complicating things.
One problem remains. With readonly=True, the field still shows the
dictionary key rather than the value.
With readonly, I guess it's
Resolved:
After researching, I see this problem plagues many other developers as
well.
The root cause is that the Distribution Windows Build of Apache 2.2 is
built with msvcr71.dll which is the C++ runtime dll
for Visual Studio 2003!!! But, most recent builds of python .pyd files
which link to
Anyone have a quick perspective on the pros/cons of handling tags like
this:
Option 1:
db.define_table('item',Field('tags','list:string'))
Option 2:
db.define_table('tag')
db.define_table('item',Field('tags','list:reference tag'))
Options 3:
db.define_table('item')
db.define_table('tag')
On Mon, Oct 10, 2011 at 9:36 PM, pbreit pbreitenb...@gmail.com wrote:
Option 1:
db.define_table('item',Field('tags','list:string'))
I am using the Option 1.
for me it is better because I end with pure Python list, which I can run
map, reduce, filter etc...
also contains and belongs are
Clarifying:
Option 1:
db.define_table('item',Field('tags','list:string'))
*Pro*:
Easy search:
tag = request.args(0)
results = db(db.item.tags.contains(tag)).select()
*Con*:
build a tag cloud
records = db(db.item.id0).select(db.item.tags)
alltags = [] # loop thought records to populate the
Done. Thank you!
On Oct 10, 6:11 pm, Paolo Caruccio paolo.carucci...@gmail.com wrote:
The result is splendid with your changes.
I want only suggest to replace the row # 1344 in /gluon/sqlhtml.py with this
jQuery('#w2p_query_fields').val('').change();
so the change event is fired and when
I think Option 1 if faster on GAE Datastore. Option 3 is the best on
SQL because you can do
db.define_table('data', Field('value'))
db.define_table('tag', Field('record_id', db.data), Field('name'))
def search_or(data=db.data, tag=db.tag, tags=[]):
rows = db(data.id==tag.record_id)\
I like this, and it is really smarter than list:string option, but, imagine
a blog where users include tags in an INPUT text field, this will be more
difficult to store tags in other table (you can do using ajax or building a
checkbox list of tags) but it is easy just to let the user put tags in a
Massimo,
I sent a patch with two more minor updates.
On 10月11日, 午前3:17, Massimo Di Pierro massimo.dipie...@gmail.com
wrote:
Can you please email me the patch?
On Oct 10, 11:35 am, kenji4569 hos...@s-cubism.jp wrote:
The behavior of the date picker seems to have changed from a certain
Hi,
has any one gotten this error when using this combination: windows +
apache + mod_wsgi ?
Syntax error on line 518 of C:/Program Files (x86)/Apache Software
Foundation/Ap
ache2.2/conf/httpd.conf:
LogFormat takes 1-2 arguments, a log format string (see docs) and an
optional fo
rmat name
Note
Sorry, the error points to line 518, which is this:
LogFormat %h %l %u %t %r %s %b common
Thanks,
Mart :)
On Oct 10, 11:24 pm, mart msenecal...@gmail.com wrote:
Hi,
has any one gotten this error when using this combination: windows +
apache + mod_wsgi ?
Syntax error on line 518 of
Try opening your file, reading its contents and then having db.executesql()
execute what was read. Should work assuming the file's contents can be run
by psycopg2 (i.e some special psql stuff might not work)
#untested code
f = open('/path/to/file.sql', 'r')
db.executesql(f.read())
found the problem :)
line should be:
LogFormat %h %l %u %t \%r\ %s %b common
instead of
LogFormat %h %l %u %t %r %s %b common
Service started properly now.
Thanks,
Mart :)
On Oct 10, 11:29 pm, mart msenecal...@gmail.com wrote:
Sorry, the error points to line 518, which is this:
Hi,
So this combination seems to be working well, except I can't log in to
the admin interface. Getting this msg/exception:
admin disabled because unable to access password file
Is there a quick fix?
Thanks,
Mart :)
heya mart,
I think that is an easy one, you need rename a file parameters_nnn,py to
parameters_.py where is the port your app listens to.
Enjoy
Hey MidGe,
well, now its an easy one, but that's only because you gave me the
answer! :)
Thanks for that!, now its working great!
Much appreciated,
Mart :)
On Oct 10, 11:58 pm, MidGe degreef.mic...@gmail.com wrote:
heya mart,
I think that is an easy one, you need rename a file
By the way, the original file gets created the very first time you run the
rocket server.
So you need run the server once for a minute or so to let the file be
created.. and then rename the file if needed to the port you are listening
to.
On Tue, Oct 11, 2011 at 12:32 AM, Brian M bmere...@gmail.com wrote:
Try opening your file, reading its contents and then having db.executesql()
execute what was read. Should work assuming the file's contents can be run
by psycopg2 (i.e some special psql stuff might not work)
#untested code
thanks for the tip! :)
mart
On Oct 11, 12:04 am, MidGe degreef.mic...@gmail.com wrote:
By the way, the original file gets created the very first time you run the
rocket server.
So you need run the server once for a minute or so to let the file be
created.. and then rename the file if
85 matches
Mail list logo