+1
should this be included in web2py/contrib?
On Jul 22, 5:35 pm, Bruno Rocha rochacbr...@gmail.com wrote:
Hi,
I present you PowerGrid Plugin (now in beta 0.1)
[http://labs.blouweb.com/PowerGrid/]
What is it?
A plugin to show, manage and paginate data
It works with paginated JSON
You never want to do this:
n = q.count()
s = db(q)
for i in range(1,n):
r = s.select( limitby=(i,1)).first()
# do something with r
instead you consider something like this:
i, m = 0, 1000
while True:
rows = db(q).select(limitby=(i*m,(i+1)*m))
for r in rows:
# do something with
Yes ... too many :(
Here's a 'simple' one:
The database table definition, which I use as a form for input:
db.define_table('scorecard',
Field('offense1', db.player, requires=IS_IN_DB( db, 'player.id',
'%(name)s', zero=T('choose one')) ),
Field('defense1', db.player,
What's wrong with this method -
http://web2py.com/book/default/chapter/07#Custom-forms - you can put the
form widgets wherever you want? Or specifically, how would
better/smarter/proper use of the #id table-field entries help? What would
you like to see in the rendered form HTML that would
Thanks, Massimo!
Even if I grab 1000 at a time (which is definitely better to do!!),
I still have to wait for minutes before I get rows back!
However, I have found that this is 'fast' :
n = db.table.count() # not sure if that's the syntax, but somehow find out
how many records in table
for
Thanks, Vineet! Lot's of good info there!
I don't have actual code yet, because I couldn't even get the db queries to
work in a reasonable amount of time.
The little code I showed in my initial post already runs slow ( my DB
records are db.itemEntry, not db.table ...).
The slowness (so
I am just a beginner with CSS/HTML, and so maybe I have a misconceived idea
of what CSS can/should do and the right way to use it.
Naively, I thought that I could use the #id=table-field entries in CSS to
control placement/shape of the form elements, and not need to change much
more in the
I am having a hard time migrating data from sqlite to postgres
This is the command that I use
./web2py.py -S testapp -M -N -R scripts/cpdb.py -A -f
sqlite://applications/testapp/databases/storage.sqlite -y 'sqlite://
applications/testapp/databases/storage.sqlite' -Y 'postgres://
It sounds like web2py is not able to open either the sqlite file or
postgres database. Have you tried to use both connection strings in a
model file to test that both works?
Kenneth
I am having a hard time migrating data from sqlite to postgres
This is the command that I use
./web2py.py
Hi Kenneth,
Yes both the connection strings work in db.py which I too find
very puzzling.
On Jul 23, 12:24 pm, Kenneth Lundström kenneth.t.lundst...@gmail.com
wrote:
It sounds like web2py is not able to open either the sqlite file or
postgres database. Have you tried to use both connection
Hey, all
I was having difficulties sending from web2py, when I realized there
is no SSL encryption support. Since this is already built into
smtplib, it was a simple addition. I should mention this wont work on
GAE, and I have not comprehensively tested it.
diff -r 800e086037d9 gluon/tools.py
There is a solution in trunk. Please check it:
http://code.google.com/p/web2py/issues/detail?id=342
print T(hello) #defualt
print T(hello, language=it-it) #etc etc
On Jul 22, 4:52 am, jamarcer jamar...@gmail.com wrote:
Hello:
I have added a comment to the ticket:
+1
in trunk ... now.
Massimo
On Jul 23, 2:30 am, Eric Vicenti ericvice...@gmail.com wrote:
Hey, all
I was having difficulties sending from web2py, when I realized there
is no SSL encryption support. Since this is already built into
smtplib, it was a simple addition. I should mention this
Hi Massimo,
How to add a IS_NOT_EMPTY constrait to list:reference field? This
seems a simple task but I ends up opening a can of worms. :-/ Here is
what I did.
1. Firstly, setup the sandbox.
db.define_table('tag',
Field('name', requires=IS_NOT_EMPTY()), format='%(name)s')
Try IS_LIST_OF(IS_IN_DB(.))
On Jul 23, 2:52 am, Iceberg iceb...@21cn.com wrote:
Hi Massimo,
How to add a IS_NOT_EMPTY constrait to list:reference field? This
seems a simple task but I ends up opening a can of worms. :-/ Here is
what I did.
1. Firstly, setup the sandbox.
I somehow manged to install to install Postgres into Xampp directory ( by
following a tutorial i found on web ) to use it under xampp environment
which is working perfectly fine.
But now i think that python dosnt know where is Postgres located on my
machine.
I have instlled Psycopg2 using
web2py doesn´t care where your Postgres is installed. If you can get
Psycopg2 to work with your Postgres then web2py should work too.
Kenneth
I somehow manged to install to install Postgres into Xampp directory (
by following a tutorial i found on web ) to use it under xampp
environment
I guess we have to wait for maybe Massimo to look into this.
Kenneth
Hi Kenneth, Yes both the connection strings work in db.py which I too
find very puzzling. On Jul 23, 12:24 pm, Kenneth Lundström
kenneth.t.lundst...@gmail.com wrote:
It sounds like web2py is not able to open either the
Mart wrote it.Let's wait for his opinion first. ;-)
On Jul 23, 3:26 am, Kenneth Lundström kenneth.t.lundst...@gmail.com
wrote:
I guess we have to wait for maybe Massimo to look into this.
Kenneth
Hi Kenneth, Yes both the connection strings work in db.py which I too
find very puzzling. On
It works.
Thanks Massimo.
2011/7/23 Massimo Di Pierro massimo.dipie...@gmail.com
There is a solution in trunk. Please check it:
http://code.google.com/p/web2py/issues/detail?id=342
print T(hello) #defualt
print T(hello, language=it-it) #etc etc
On Jul 22, 4:52 am, jamarcer
I was also going to do it.. but if you submitted first I'm going to
watch it :)
On Jul 23, 2:10 am, blackthorne francisco@gmail.com wrote:
Hi,
just submitted a talk proposal on web2py for the Codebits 2011 event
yield in Lisbon, Portugal (November). I invite you to support me with
your
Take a look to this:
http://martin.tecnodoc.com.ar/default/post/2011/04/13/2_hacking-web2py-sqlform-part-1
I have to make the part 2, to show more complex css form with sqlforms.
2011/7/23 Luis Goncalves l...@vision.caltech.edu
I am just a beginner with CSS/HTML, and so maybe I have a
Very nice and have a lot of examples. I'm rewriting powerpack, to come in a
few weeks in version 2.0. Do you want to include in it also as an example?
2011/7/23 Massimo Di Pierro massimo.dipie...@gmail.com
+1
should this be included in web2py/contrib?
On Jul 22, 5:35 pm, Bruno Rocha
I'm rewriting it, but it's a different story. It's called powerpack. Instant
press is blog/ cms application solution oriented to visual. But in powerpack
I want to achieve that could make an cms or blog but this don't mix with
the rest of the application, because powerpack is boilerplate app like
Ah !
The database-tier did not flash into my mind.
I have not used sqlite anytime.
I am using MySQL; the table structure is partially normalised,
suitable indexed.
Because of these optimizations, whenever I query a huge table (1
million rows), I get very fast response.
I don't know whether any
You have exposed two relatively advanced programming topics: code
profiling and database performance tuning.
Because I am a relative noobie to both Python and Sqlite, I cannot
unfortunately give you specific directions.
But I can offer an approach you might try. Maybe you should first
learn
very nice work Bruno !
On Fri, Jul 22, 2011 at 11:35 PM, Bruno Rocha rochacbr...@gmail.com wrote:
Hi,
I present you PowerGrid Plugin (now in beta 0.1) [
http://labs.blouweb.com/PowerGrid/]
What is it?
A plugin to show, manage and paginate data
It works with paginated JSON callbacks, you
Thanks but, it doesn't work either. Still tickets. Do you have another
suggestion?
On Jul 23, 3:54 pm, Massimo Di Pierro massimo.dipie...@gmail.com
wrote:
Try IS_LIST_OF(IS_IN_DB(.))
On Jul 23, 2:52 am, Iceberg iceb...@21cn.com wrote:
Hi Massimo,
How to add a IS_NOT_EMPTY
ArrC, the proper way is to start the database using xampp (using
control panel, or script) then use web2py. Actually web2py will come
up even when the database it not up, but to actually interact with it
the db needs to be up.
So if yo get something like, failed to ... after 5 tries, just start
On Jul 22, 2011, at 7:35 PM, Ross Peoples wrote:
After some hacking on the welcome application, I have finally got this
working! I attached a screenshot of a /default/test function I created.
That URL uses the test.html view when viewed on the desktop browser, and
the same URL uses the
On Jul 23, 2011, at 12:30 AM, Eric Vicenti wrote:
I was having difficulties sending from web2py, when I realized there
is no SSL encryption support. Since this is already built into
smtplib, it was a simple addition. I should mention this wont work on
GAE, and I have not comprehensively
I had given that some thought, but went with '.mobile.html' for clarity. I
suppose I could make it just '.m.html', but that might be hard to see in a
list of files. I could have just made it '.mobile', or something, but then
code editors won't pick up on it. It's actually kind of annoying
I´m creating a form with SQLFORM that includes 6 fields.
One field is f_customer with requires IS_IN_DB()
Now I'd like to add a new field not taken directly from database. Lets
call it f_extra.
f_customer is a drop-down and f_extra would also be a drop-down. Now I
have a list of
On Jul 23, 2011, at 8:11 AM, Ross Peoples wrote:
I had given that some thought, but went with '.mobile.html' for clarity. I
suppose I could make it just '.m.html', but that might be hard to see in a
list of files. I could have just made it '.mobile', or something, but then
code editors
Pl. beware of indexing.
It is a double-edged sword.
Indexing too many columns would increase the data-size.
One can first run a query with explain extended clause (in MySQL
database).
That can tell which column(s) would need an index.
On Jul 23, 6:29 pm, Cliff cjk...@gmail.com wrote:
You have
install web2py.src, not web2py for windows.ok.
Ovidio Marinho Falcao Neto
ovidio...@gmail.com
88269088
Paraiba-Brasil
2011/7/23 ArrC justmailnav...@gmail.com
I somehow manged to install to install Postgres into Xampp directory (
On Saturday, July 23, 2011 3:06:13 AM UTC-4, Luis Goncalves wrote:
I am just a beginner with CSS/HTML, and so maybe I have a misconceived
idea of what CSS can/should do and the right way to use it.
Naively, I thought that I could use the #id=table-field entries in CSS to
control
In my welcome app's db.py file, this is what I use to switch to the mobile
view:
if request.is_mobile and request.extension == 'html':
mobile_view = os.path.join(
request.controller, request.function + '.mobile.html'
)
if os.path.exists(os.path.join(request.folder,
I have experience with mysql:
if mysql is started that will work just fine
db = DAL('mysql://root:@localhost/mydb')
python shouldn't know where is mysql - it runs a on a port 3306, and python
mysql drivers know that :)
Fantastic! I modified the WebGrid slice to recommend using this
instead. Great work.
On Jul 22, 5:35 pm, Bruno Rocha rochacbr...@gmail.com wrote:
Hi,
I present you PowerGrid Plugin (now in beta 0.1)
[http://labs.blouweb.com/PowerGrid/]
What is it?
A plugin to show, manage and paginate
If processing one row at a time works, then go for it. If you want to try
more at a time, use Massimo's approach and just make the number smaller than
1000.
I'm newish to programming and found the Instant Press code very hard to
follow. I'm sure it's well designed but can be challenging since it's a
departure from other projects. I found the best approach is to follow the
patterns as presented in the Book as much as possible.
+1 to be part of web2py contrib ...
I see what the problem is. The default widget overrides the validator.
Before we look for a solution let me undertand what you need.
The way you phrased looks like you want users to input the IDs of the
tags. I suspect you want instead the user to insert tag names, perhaps
comma separated, and
@Martin,
Sounds really interesting! I'll check it out, and definitely keep an
eye on the project! Thanks!
@pbreit
I agree that, at first, it was a little confusing, but once I saw the
pattern it became a lot easier to trace. (get the configurations and
superclass through the model files, and
On Jul 23, 2011, at 9:19 AM, Ross Peoples wrote:
In my welcome app's db.py file, this is what I use to switch to the mobile
view:
if request.is_mobile and request.extension == 'html':
mobile_view = os.path.join(
request.controller, request.function + '.mobile.html'
)
That's a fair statement.
Indices not only increase the size of the data, they also slow down db
writes, because the index tables need to be written as well as the
data tables.
Still, you want to avoid a full table scan on a table with millions of
records.
Sqlite also has an explain command,
As I guess Massimo wanted to post these answers to the list and not only
to me, I´ll forward his answers here.
On Jul 23, 10:19 am, Kenneth Lundströmkenneth.t.lundst...@gmail.com
wrote:
I m creating a form with SQLFORM that includes 6 fields.
One field is f_customer with requires
From the user-interface aspect, of course we expect end user to input
real names, rather than IDs. Actually web2py already provides a nice-
looking multi-selection widget by default, in scenario 1 of my first
post.
The only and real problem right now, is that end user can add/edit a
record with
On Saturday, July 23, 2011 1:33:09 PM UTC-4, Kenneth wrote:
3) Instead of creating a custom layout for this form I d like to add the
field in the controller with something like:
form.element('table').insert(2,TR('label',INPUT(_name='name'))), but how
do I add a SELECT with many OPTIONS?
Say Dave, is xlwt included into current w2p version? Or I need to add
the library by myself?
On 22 июл, 05:05, Dave davidramsayreinh...@gmail.com wrote:
I added these two lines and its working now!
response.headers['Content-Disposition']='attachment;
filename=test.xls'
Hi everybody!! How could I make a google like in web2py, I mean I have:
db.define_table('article',
Field('site', db.site),
Field('section',db.section),
Field('date,'datetime'),
Field('author','string'),
Field('header','string'),
Field('body','text'))
and I like to have a
That thought had occurred to me about mobile phones vs tablets, but I didn't
want to get too complex with this right away. However, you are correct that
many sites have an iPhone/mobile site, and iPad site, and a desktop site. I
think I'll try to expand my patch to replace request.is_mobile
The SMTP protocol can be encrypted at a low level with either TLS or
SSL. It depends on the SMTP server. Most hosts will offer one or both,
and they should tell you, as well as the corresponding port (typically
465 or 587 for secured connections). If you are configured with TLS or
no security when
STARTTLS is the negotiated protocol of SSL. it's a method of establishing the
connection using plain text, becoming aware that the server supports an
encrypted layer and then initiating an SSL session. plain SSL is the dumb,
or blind, approach to smtps. failure to negotiate SSL via protocol
Hey there ,
You can use it like this but you need to build the Css for the
textbox of the search :
def search():
ajax search
return
dict(form=FORM(INPUT(_id='keyword',_class=textbox,_name='keyword',
_onkeyup=ajax('bg_find', ['keyword'], 'target');)),
OR if You Want YOU can Check this search plugin
http://www.web2pyslices.com/slices/take_slice/115
so, cpdb.py runs on its own (no need to invoque with web2py.py).
this is the short version of its usage:
usage: cpdb.py [-h] -f SOURCEFOLDER -F TARGETFOLDER -y
SOURCECONNECTIONSTRING -Y TARGETCONNECTIONSTRING
[-a AUTOIMPORT] -d DAL [-t {True,False}] [-b
I would prefer TLS as well, but for some reason GoDaddy Email doesn't
support it. For all technical purposes, though, it shouldn't matter.
On Jul 23, 1:14 pm, David Ford da...@blue-labs.org wrote:
STARTTLS is the negotiated protocol of SSL. it's a method of establishing
the connection using
addendum:
when it has run successfully, you should see an output similar to this
in you shell:
dalPath: /Users/mart/aptanaApps/src/blueLite/pyUtils/sql/blueSQL
db.tables: ['affectedFile', 'archive', 'auth_cas', 'auth_event',
'auth_group', 'auth_membership', 'auth_permission', 'auth_user',
On Jul 23, 2011, at 1:59 PM, Eric Vicenti wrote:
I would prefer TLS as well, but for some reason GoDaddy Email doesn't
support it. For all technical purposes, though, it shouldn't matter.
That works for me, as long as there's a reason for it being there.
On Jul 23, 1:14 pm, David Ford
Hi Chris,
I for one am glad that you reanimated this thread :-)
Your findings probably led to hg commit #2119 which has the commit
comment possible __builtin__ fix for jython, thanks Chris Clark.
This raised some hopes, but the current hg tip still doesn't work on
Jython yet (at least for me).
yet another addendum:
to me cpdb.py is just a skeleton, it will copy a DB and all that good
stuff, but you can add to it for quick access to tables @ from
something like a bash shell...
as an example, i have a variation on this that uses urllib2 to
download full DB's, connects to it and a python
On Jul 23, 2011, at 12:36 PM, Ross Peoples wrote:
That thought had occurred to me about mobile phones vs tablets, but I didn't
want to get too complex with this right away. However, you are correct that
many sites have an iPhone/mobile site, and iPad site, and a desktop site. I
think I'll
When I first read about subdirectories I saw this structure:
views/default/index.html
views/default/mobile/index.html
views/default/tablet/index.html
If no mobile/tablet directory or index.html is found it defaults to
/views/default/index.html
Kenneth
On Jul 23, 2011, at 12:36 PM, Ross
Not sure about which directory structure works best, but as for falling
back, it tries to go to the most specific device first, then will fallback
to the desktop html if not found. So an iPad will go to the tablet, if
there's no view for that, should it fall back to mobile, or to desktop?
That
Developers will probably want to take a variety of approaches to handling
mobile vs. desktop, so we should probably be careful about being too
opinionated here and only offering one inflexible approach. For some of this
stuff, it might make more sense to offer some recipes and/or a plug-in
On Jul 23, 2011, at 3:20 PM, Anthony wrote:
Developers will probably want to take a variety of approaches to handling
mobile vs. desktop, so we should probably be careful about being too
opinionated here and only offering one inflexible approach. For some of this
stuff, it might make more
cyber,
You can download it from here:
http://www.python-excel.org/
If you are using ubuntu linux distribution you can install it like this:
sudo apt-get install python-xlwt
Thank you Massimo for your answers.
I can´t get the onvalidation to work.
My code looks like this:
def check(form):
if ((form.vars.f_internal != 0 and form.vars.f_customer != None) or
(form.vars.f_internal == 0 and form.vars.f_customer == None)):
form.errors.f_customer = a and b
oh... i just remembered, we can also use it from the web2py/scripts
dir and use the 'default' paths (i think)... let me get back with
this...
On Jul 23, 5:15 pm, mart msenecal...@gmail.com wrote:
yet another addendum:
to me cpdb.py is just a skeleton, it will copy a DB and all that good
That's an issue with your Python code. You should either move the import
outside the function or only import specific objects from the Decimal module
(which is probably a better idea -- from module import * is usually not
recommended).
Anthony
On Saturday, July 23, 2011 6:57:54 PM UTC-4,
I'm a bit with Anthony. I don't yet see a big role for the framework. I
don't think selectively creating mobile versions of certain views is that
common a pattern and is easily accomplished with an if-then in the view.
if you cd to your web2py/scripts directory and run something like:
python cpdb.py -f ./applications/welcome/databases -F ./dbTest -y
sqlite://storage.sqlite -Y sqlite://storage2.sqlite -d ../gluon, it
should work...
my source db has migrate=False, i think that is a must, but Massimo
can confirm
Cool!
On Fri, Jul 22, 2011 at 3:24 PM, Bruno Rocha rochacbr...@gmail.com wrote:
I have some (in portuguese)
web2py + Ipython ( IDE for what?)
http://vimeo.com/26387038
Comet
http://vimeo.com/18399381
PowerTable
http://vimeo.com/18447603
Uploadify
http://vimeo.com/20107460
I am
Thank you ron_m!!! That worked more than fine!
On Wed, Jul 20, 2011 at 11:16 AM, ron_m ron.mco...@gmail.com wrote:
Run 2 copies of web2py, one for the script and the other for the web site.
If the database is SQLite you will end up with blocking problems if the
background task takes too
I´m working with the wiki example like this
return dict(form=FORM(INPUT(_id='keyword',_name='keyword',
_onkeyup=ajax('bg_find', ['keyword'], 'target');)),
target_div=DIV(_id='target'))
def bg_find():
pattern = '%' + request.vars.keyword.lower() + '%'
pages =
Solved, wrong syntax xD
Another doubt is there a way to generate the results like google, I mean UL
of headers and for each header a short preview of the article?
On Sat, Jul 23, 2011 at 8:38 PM, Ismael Serratos ialejandr...@gmail.comwrote:
I´m working with the wiki example like this
Can you please show it to me .. i may need it ..
On Sat, Jul 23, 2011 at 2:34 AM, tomt tom_tren...@yahoo.com wrote:
DatabaseError: malformed database schema (comments) - near by:
Hi Tom, I just tested it and works normally with latest web2py from download
link, I am using Ubuntu 11.04 and Python 2.7.
It seens to be a problem in
On Sat, Jul 23, 2011 at 3:13 AM, Massimo Di Pierro
massimo.dipie...@gmail.com wrote:
should this be included in web2py/contrib?
Would be very nice if it can go to contrib, but wait it to left beta
version, I am doing a lot of tests and writing a better docs.
as it uses model and controller,
On Sat, Jul 23, 2011 at 1:22 PM, mr.freeze nfre...@gmail.com wrote:
Fantastic! I modified the WebGrid slice to recommend using this
instead. Great work.
Nice, thanks!
But, this is in beta, some things can crash, and webgrid works with more
datasources, PowerGrid is working only with Table
On Sat, Jul 23, 2011 at 8:23 AM, Martín Mulone mulone.mar...@gmail.comwrote:
Very nice and have a lot of examples. I'm rewriting powerpack, to come in a
few weeks in version 2.0. Do you want to include in it also as an example?
Hi Martin, of course it will be nice to have it included in your
On Saturday, July 23, 2011 9:47:26 PM UTC-4, Ialejandro wrote:
Solved, wrong syntax xD
Another doubt is there a way to generate the results like google, I mean UL
of headers and for each header a short preview of the article?
If you want to do true full text search, you might consider a
Hi,
I have written a text page abc with web2py wiki containing a label [[a]].
There are two links in default/index.html:
- a href=http://127.0.0.1:8000/test/plugin_wiki/page/abc#a;Link 1/a
- {{=A('Link 2',_href=URL('test','plugin_wiki','page',args=['abc#a']))}}
Link 1 opens
Hi,
what is the best way to write multilingual help pages using the wiki?
Regards Martin
86 matches
Mail list logo