[web2py] Re: Why showing a log in option inside of the admin interface

2011-10-06 Thread MidGe
OK, I did a complete re download and re-install of the system.

Right from the first log in in the admin GUI, using the password given on 
first execution of the rocket server to create the parameters file, I get 
the double logo as soon as I enter the admin area. See what it looks like 
here: http://i.imgur.com/7LZGP.png  

Note: this is web2py out of the box.  No change at all.  I know the 
system recognizes the password because if I enter a wrong one it gives back 
a message to that effect, and if I give the right one it doesn't it just 
presents the login screen again although I appear logged in.

Has anyone got any ideas?  


[web2py] GAE with database

2011-10-06 Thread ramkrishan bhatt
Hello
Is'nt it good for web2py framwork also. can be use this
http://googlecode.blogspot.com/2011/10/google-cloud-sql-your-database-in-cloud.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+blogspot%2FDcni+%28Google+Code+Blog%29


[web2py] Re: Cannot serve any pages after fresh install of Python2.5

2011-10-06 Thread pbreit
I was thinking a clean install of ubuntu. You might be fine developing on 2.6 
or 2.7 since it's unlikely you'll use any 2.7 features. 10.04 is popular for 
development since it's a long term version.


Re: [web2py] Re: Help for creating template

2011-10-06 Thread Miroslav Gojic
Thanks for blocks - that work, this is similar to modules in joomla, I can
write small block and get content on specific place at layout.

I tray to use next code:
response .menu =
[('Google', False, 'http://www.google.com',[]),
 ('Index',  True,  URL
('index'), [])]

but without any success.
I reed in book that mentioned code I must put in controller but how to get
same than in layout and does in controller I must use definition or haw.


- - Miroslav Gojic - -



On Thu, Oct 6, 2011 at 23:12, pbreit  wrote:

> Generally you only need one include, {{include}}, which is going to
> incorporate the content from your view.
>
> But you can also use include to specify another view file to incorporate:
> http://web2py.com/book/default/chapter/05#Page-Layout
>
> Example: {{include 'page.html'}}
>
> You also might check out "blocks":
> http://web2py.com/book/default/chapter/05#Blocks-in-Views
>
>
>


[web2py] Re: Cannot serve any pages after fresh install of Python2.5

2011-10-06 Thread Peter G.
I did start with a clean install of both web2py and Python 2.5. The
reason why I'm "downgrading" (so to speak) to 2.5 is because I'm
planning on running my web app on Google App Engine, and GAE runs on
Python 2.5.2.

I know that Ubuntu 11.04 comes pre-installed with 2.6 and 2.7, so I
had to manually compile and install 2.5 from source.

I tried to run a fresh instance of web2py extracted from the zip file
with 2.6 and 2.7 afterwards, and they both failed with the same error,
which leads me to believe perhaps the error is elsewhere and is not
Python/web2py related. Given the context of the errors, could it be at
the database layer? And if so, what would be a good approach to
unearth the underlying problem caused by the db connection?

On Oct 6, 1:00 pm, pbreit  wrote:
> I'd suggest starting over with a clean install if possible. Is there some
> reason you are installing 2.5? If not, I'd avoid it and use what your server
> comes with.
>
> I use Ubuntu 10.04 which is a "long term support" release and comes with
> Python 2.6. But 11.04 should work fine, too.


[web2py] Re: Cannot serve any pages after fresh install of Python2.5

2011-10-06 Thread Peter G.
A clean install of Ubuntu, web2py, and/or Python? I did start with a
clean install of both web2py and Python (compiled from source). The
reason I'm "downgrading" (so to speak) to 2.5 is because I'm making an
app that I wish to run on Google App Engine, and GAE runs Python
2.5.2, so I'd like to develop in the same environment so as to not run
into any troubles down the line. I know that Ubuntu 11.04 comes with
2.6 and 2.7, so I had to install 2.5 separately.

The funny thing is, even if I run web2py with Python 2.6 or 2.7 (which
worked flawlessly before), it no longer works, and displays the same
error... Could it be something database related? More specifically,
the error seems to be complaining about a certain db operation. Maybe
it's not Python/web2py related at all?

Thoughts?

On Oct 6, 1:00 pm, pbreit  wrote:
> I'd suggest starting over with a clean install if possible. Is there some
> reason you are installing 2.5? If not, I'd avoid it and use what your server
> comes with.
>
> I use Ubuntu 10.04 which is a "long term support" release and comes with
> Python 2.6. But 11.04 should work fine, too.


[web2py] Re: error: () takes exactly 1 argument (2 given)

2011-10-06 Thread Massimo Di Pierro
OLD syntax:

represent=lambda id: settings.gender[id][1][:1])

new syntax

represent=lambda id, row: settings.gender[id][1][:1])

Notice we did not break backward compatibilty because the new syntax
is ONLY enforced in te new grid and smartgrid tools.

On Oct 6, 8:53 pm, niknok  wrote:
> When I try
>
>     form=SQLFORM.grid(db.person)
>
> with a defined represent parameter, I get the following error:
>
>     () takes exactly 1 argument (2 given)
>
> The person table is defined as:
>
> db.define_table('person'
>                 ,Field('birth_date', 'date', requires=IS_DATE())
>                 ,Field('last_name', notnull=True)
>                 ,Field('given_name', notnull=True)
>                 ,Field('middle_name', label="Mother's maiden name")
>                 ,Field('gender', 'integer', 
> requires=IS_IN_SET(settings.gender, zero='pick one')
>                         ,represent=lambda id: settings.gender[id][1][:1])
>                 ,Field('father', 'reference person'
>                        ,requires=IS_EMPTY_OR(IS_IN_DB(db('person.gender'==1), 
> 'person.id'
>                                           ,zero=T('pick one'
>                 ,Field('mother', 'reference person'
>                        ,requires=IS_EMPTY_OR(IS_IN_DB(db('person.gender'==2), 
> 'person.id'
>                                           ,'%(last_name)s, %(given_name)s 
> [%(birth_date)s]'
>                                           ,zero=T('pick one'
>                 ,auth.signature
>                 ,format='%(last_name)s, %(given_name)s [%(birth_date)s]'
>                 )


[web2py] Re: date picker on v1.99

2011-10-06 Thread Massimo Di Pierro
Which browser? When I tried it, if I remember, I was able to type.

On Oct 6, 8:48 pm, niknok  wrote:
> The new date picker looks very good. Is there a way to input dates by
> typing it directly (similar to default behaviour in older versions), in
> addition to selecting dates thru the calendar interface?
>
> /r
> Nik
>
> P.S.
> Though I couldn't type in a date, I could paste one.  (which is a
> behavior I don't expect from users)


[web2py] Help! import winrandom gives dll load failed error under Apache on Vista, but works under Rocket.

2011-10-06 Thread dlypka
My web2py app which uses paramiko  sftp, works fine under the Rocket
webserver,
but fails here when run under the Apache 2.2 webserver, under WINDOWS
VISTA Enterprise:

•   File "C:\Python27\lib\site-packages\Crypto\Random\OSRNG\nt.py", line
28

import winrandom  <--  failing to load some DLL  at line 28
--
from rng_base import BaseRNG

I imagine it is some kind of permissions problem, maybe with having to
load  a cryptographic C dll

I have already run a Process viewer and cleaned up the PATH to avoid
dll search failures.

This is a proof of concept app to a major U.S. corporation. They have
already seen it work under Rocket
and are very excited to see it deployed under a standard webserver.

An alternative is to use IIS7 but the web2py slice I read looked very
difficult to follow so I am trying Apache first.
We are also running Symantec anti virus (corporate edition) and we are
locked out from being able to disable it.
Not sure if antivirus interferes with Apache.  We only have this
corporate PC to use at the moment.

I would appreciate any clues or tips for configuring Apache to load
paramiko sftp under Windows.
Or links to straight-forward and $free steps for installing web2py
under IIS 7 in Vista.











[web2py] Re: Schema Changes in GAE

2011-10-06 Thread Joseph Jude
Thank you for your reply. Is there a way to run gae specific code (with gae 
objects) within web2py? or should this be executed only within gae 
environment (may be I need to modify app.yaml too then?)

Thank you in advance,
Joseph


[web2py] error: () takes exactly 1 argument (2 given)

2011-10-06 Thread niknok

When I try 

form=SQLFORM.grid(db.person) 


with a defined represent parameter, I get the following error: 

() takes exactly 1 argument (2 given)



The person table is defined as: 

db.define_table('person'
,Field('birth_date', 'date', requires=IS_DATE())
,Field('last_name', notnull=True)
,Field('given_name', notnull=True)
,Field('middle_name', label="Mother's maiden name")
,Field('gender', 'integer', requires=IS_IN_SET(settings.gender, 
zero='pick one')
,represent=lambda id: settings.gender[id][1][:1])
,Field('father', 'reference person'
   ,requires=IS_EMPTY_OR(IS_IN_DB(db('person.gender'==1), 
'person.id'
  ,zero=T('pick one'
,Field('mother', 'reference person'
   ,requires=IS_EMPTY_OR(IS_IN_DB(db('person.gender'==2), 
'person.id'
  ,'%(last_name)s, %(given_name)s 
[%(birth_date)s]'
  ,zero=T('pick one'
,auth.signature
,format='%(last_name)s, %(given_name)s [%(birth_date)s]'
)






[web2py] date picker on v1.99

2011-10-06 Thread niknok

The new date picker looks very good. Is there a way to input dates by
typing it directly (similar to default behaviour in older versions), in
addition to selecting dates thru the calendar interface?

/r
Nik 

P.S.
Though I couldn't type in a date, I could paste one.  (which is a
behavior I don't expect from users)


[web2py] question about preferred represenation and filtering

2011-10-06 Thread niknok
I have a self-referencing table [1] with a defined format for
representing a record in this fashion: "Lastname, Firstname
[-mm-dd]". In the father field, I expect it to display the drop-down
list of persons as defined in format, but it doesn't unless I define it
explicitly (like in the  mother field).  

Second, I tried dbset filter for the selection list of the  father and
mother  fields but I still get the whole table instead. 

I'm trying this out on v1.99.2. What am I doing wrong here?

TIA


[1]
db.define_table('person'
,Field('birth_date', 'date', requires=IS_DATE())
,Field('last_name', notnull=True)
,Field('given_name', notnull=True)
,Field('middle_name', label="Mother's maiden name")
,Field('gender', 'integer', requires=IS_IN_SET(settings.gender, 
zero='pick one'))
,Field('father', 'reference person'
   ,requires=IS_EMPTY_OR(IS_IN_DB(db('person.gender'==1), 
'person.id'
  ,zero=T('pick one'
,Field('mother', 'reference person'
   ,requires=IS_EMPTY_OR(IS_IN_DB(db('person.gender'==2), 
'person.id'
  ,'%(last_name)s, %(given_name)s 
[%(birth_date)s]'
,zero=T('pick one'
,auth.signature
,format='%(last_name)s, %(given_name)s [%(birth_date)s]'
)







[web2py] Re: Google Cloud SQL

2011-10-06 Thread Massimo Di Pierro
I guess this finally relieves me from the non-disclosure agreement ;-)

web2py has already been running on GAE+SQL since March:

 http://web2py-tests.appspot.com/mysql/tests

All web2py apps can now run GAE. Just use a connection string like:

DAL('google:sql://gmailcom:web2pytests/guestbook')

including:
- migrations
- all types of web2py queries (or, joins, like, etc.)
- transactions

By the week-end I will post a more detailed howto.
If you have used web2py to build your apps, this is the moment it pays
off.

Massimo


On Oct 6, 6:29 pm, pbreit  wrote:
> http://googlecode.blogspot.com/2011/10/google-cloud-sql-your-database...


[web2py] Re: criticism of web2py

2011-10-06 Thread TheSweetlink
+1

Coming from PHP months ago I had never touched python or anything
python related but was drawn to it by an article on how Disqus used
python and the whole MVC concept.

Tried Django but was met with less than nice responses when asking
questions while reading their book.

Found web2py as I like to hunt for all options before choosing and
found myself well aligned with web2py philosophies.

Just to name a few:
Default sane behaviour with easy ability to override,
Simple is better than complex,
Don't Repeat Yourself,
and my most favorite feature - An effort to be a COMPLETE and fully
integrated package.  I really prefer this to the glue frameworks out
there.

The book taught me python and web2py simultaneously and inspired me to
hunt all over for as much information as possible about python as I
can find.

As far as I'm concerned, if someone chooses another framework because
it makes them feel more 1337 that their using something tougher/more
"pythonic" in their view/insert subjective term here, fine.  If their
priest.py doesn't approve it as Roberto De Ioris humorously put it
above, good.  More secret sauce for us.

Still, I will continue to tell people about this amazing tool I've
found and the wonderful community behind it and look forward to web2py
winning more awards and accolades from the world over.

Congrats Massimo, contributors, and community.  Whether directly or
indirectly, you have all impacted my life for the better and I thank
you all for it.

David



On Oct 5, 8:37 pm, horridohobbyist  wrote:
> I like web2py. I think it's the best web framework out there...
>
> Let me explain where I'm coming from. My first experience as a web
> developer was with Smalltalk/Seaside in 2007. It came highly
> recommended to me by a friend. He told me that Seaside was very
> powerful, very flexible, and most importantly, really easy to learn. I
> value productivity and ease of use above all else when it comes to
> software development. I don't care about ideology or the ultimate in
> power and performance.
>
> My Seaside project was completed in record time. I was a happy camper.
>
> My attitude is definitely "non-geek-like". I am not a geek. I only
> care about getting the job done in the shortest time, with the least
> effort and the least pain. This has been my guiding principle over a
> 20-year career in IT (ranging from Fortran to C, from mainframe to
> PC).
>
> A year ago, I took a whack at Django, but I did not like it. I also
> tried Java-based Wicket. But neither passed the acid test of being
> really easy to learn and use.
>
> When I came across web2py a couple of months ago, I was utterly
> astonished. For a newbie, it's fall-off-the-log easy to pick up.
> That's important to me. And being easy to use doesn't mean that it's
> lacking in power. I can be phenomenally productive with web2py.
>
> My conclusion is that web2py is actually easier than Seaside
> (heresy!). It's also easier than Django, and it's definitely much
> easier than Wicket. I can't understand why programmers don't want the
> easiest tools. I prefer to enjoy my life, take it easy, rather than
> expose myself to aggravation and headache, regardless of how much
> power you gain.
>
> But that's just me.
>
> Richard
>
> On Oct 5, 10:07 am, Farsheed Ashouri 
> wrote:
>
> > i bet they event didn't create a simple site with Web2py. Don't trust them.
> > Just for test, use Django for a week and you'll be back to Web2py soon than
> > we expected and with headaches!!
> > Every day, I am creating a new website for my clients. When I was using
> > Django, just initial setup took me hours. I am not saying other frameworks
> > are not smart. Web2Py is just better.
>
>


[web2py] Re: Windows + Apache + mod_proxy

2011-10-06 Thread Paolo Caruccio
The following istructions have been adapted from
http://jdoe.asidev.com/2009/02/26/configure-web2py-to-run-behind-apache-with-wsgi-mod_wsgi/
for my dev enviroment Windows + Apache + mod_wsgi.
I  succesfully tested connection to db2 express from IMB through
pyodbc. Maybe it could help you.
I premise that I'm not a programmer and computer development is an
hobby for me, so my support will be very poor.
Below enviroment has been used for development only, not in
production.

PREREQUISITES: python 2.7 installed on Windows

STEP A - webserver preparation [http://sourceforge.net/projects/
miniserver/files/Uniform%20Server/7.1.11-Orion/]
a1 - download and install uniformserver;
a2 - after installation, access to the server administrator panel and
"SECURE" all entries in the "Server Security" page;
a3 - generate a new SSL certificate by "Tools > Server Key & Cert Gen"
link on right sidebar;
a4 - create a certificate signed by our CA using UniServer_CA_1.0
plugin [http://sourceforge.net/projects/miniserver/files/Plugins/
UniServer_CA/];
a5 - replace the files created in the a3 step in X:\UniServer\usr\local
\apache2\conf folder ( X is the drive where uniformserver has been
installed );
a6 - install new certificate in Trusted Certification Authorities.
Usually I put ca.crt file in main folder of my website, start the
server, and by browser go to http://localhost/ca.crt
 ( replace localhost with website name to simulate real situation )
and install the certificate following browser instructions;
a7 - start the server and check that https pages are accessible
without certificate errors.
Notes: when upgrade the server simply copy in their folders on the new
server the SSL files created in the previous version of the server

STEP B - mod_wsgi [http://code.google.com/p/modwsgi/wiki/
DownloadTheSoftware?tm=2]
b1 - download Windows binary selecting the correct one for the version
of Python and Apache that is being used ( I use mod_wsgi-win32-
ap22py27-3.3.so - Apache 2.2 / Python 2.7 );
b2 - stop UniServer, rename downloaded file in "mod_wsgi.so" and put
it in X:\UniServer\usr\local\apache2\modules folder ( X is the drive
where uniformserver has been installed );
b3 - add to X:\UniServer\usr\local\apache2\conf\httpd.conf file
following row: "LoadModule wsgi_module modules/mod_wsgi.so"( without
quotation marks );
b4 - restart UniServer and check that mod_wsgi is succesfully
installed.
Notes: when upgrade the server repeat the step B

STEP C - web2py (for sure you know where download it)
c1 - download web2py source code and unzip it in X:\UniServer\www
folder ( X is the drive where uniformserver has been installed );
c2 - stop UniServer, start web2py server in standard way by double
clicking X:\UniServer\www\web2py\web2py.py in order that it create its
own files (don't change default settings);
c3 - stop web2py server and check that in web2py folder there are
"options_std.py" e "parameters_8000.py";
c4 - open options_std.py and make sure of row "password = ''"
is present;
c5 - create following symlinks (only in windows7 by "mklink" command
or using "Symlink Creator" [http://code.google.com/p/symlinker/
downloads/list]):
 1) options_std.py -> options.py
 2) parameters_8000.py -> parameters_80.py
 3) parameters_8000.py -> parameters_443.py
Notes: in windowsXP copy files listed above on the left and rename
them with the names on the right.
   When upgrade web2py, rename or delete previous web2py folder, but
in the latter case make sure of backup your web2py apps.

STEP D - apache vhost file
d1 - stop UniServer, create a new "vhost_web2py.conf" file in X:
\UniServer\usr\local\apache2\conf folder ( X is the drive where
uniformserver has been installed ) with following content :

##VIRTUAL HOST SETUP##
# WEB2PY.LOCALHOST

ServerName SVN:80
DocumentRoot DIR/www/web2py
WSGIScriptAlias / DIR/www/web2py/wsgihandler.py
ServerAdmin EMAIL
# static files do not need WSGI

Order Allow,Deny
Allow from all

# everything else goes to web2py via wsgi

Order deny,allow
Allow from all

# Log. Can be disabled
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogLevel notice
CustomLog DIR/tmp/web2py.access.log common
ErrorLog DIR/tmp/web2py.error.log


#

ServerName SVN:4

[web2py] Re: manual file upload using SQLFORM.factory

2011-10-06 Thread TheSweetlink
My pleasure Alex.  I am glad that worked out for you.  Now that I look
at your code you got it to work in a way I didn't even think of.  May
we see a more complete example of your SQLFORM.factory?

Massimo,
I don't think I would know how to make it better other than Alex's
suggestion of adding some more info to the Book.

Especially when Alex came up with another way to do the manual upload
I think it's cool that web2py is that flexible.

I know it must be difficult to keep it all up to date with all the new
features cropping up left and right.  Nice work by the way to all that
did the most recent updates.

Viva web2py and its magnificent community,
David

On Oct 6, 4:12 pm, Alex  wrote:
> Hi David,
>
> works great, thanks!
>
> I'm now manually uploading with these few lines:
> field = Field('invoice_logo', 'upload',
> uploadfolder=os.path.join(request.folder,'uploads/'))
> field._tablename = 'admin_setting'
> uploaded_invoice_logo_filename =
> field.store(request.vars.invoice_logo.file,
> request.vars.invoice_logo.filename)
>
> @Massimo: now that I know, it's quite easy so I don't know much to
> make it better. It would be good if this would be mentioned in the
> documentation (there is already a short 'Manual Uploads' section),
> although this is probably not a common use case. And maybe it would be
> a good idea to have default values for uploadfolder and tablename?
>
> On 6 Okt., 03:46, Massimo Di Pierro 
> wrote:
>
> > Suggestions to make the behaviour better?
>
> > On Oct 5, 5:55 pm, TheSweetlink  wrote:
>
> > > Hello Alex,
>
> > > Two things I've found when manually uploading via SQLFORM.factory:
>
> > > 1)  You need to specify a table_name='...' to avoid the
> > > no_table_newfilename.extension issue like this:
>
> > > form = SQLFORM.factory(...Field definitions...,
> > > table_name='some_table_name')
>
> > > 2)  Additionally you must specify an uploadfolder in your upload Field
> > > definition similar to this:
>
> > > form = SQLFORM.factory(...,
> > > Field('invoice_logo', type='upload',
> > > uploadfolder=os.path.join(request.folder,'static/uploads/')),
> > > ..., table_name='whatever_you_like')
>
> > > **NOTE** 'static/uploads' is just an example, you can upload to
> > > wherever it will be appropriate.
>
> > > In this case the newly uploaded and renamed file to
> > > your_application's_dir/static/uploads/your_new_filename_here
>
> > > One gotcha to look out for following your field name as an example
> > > without the quotation marks:
>
> > > In your form.accepts(...):
>
> > > "request.vars.invoice_logo" will contain the original filename of your
> > > upload whereas
>
> > > "form.vars.invoice_logo_newfilename" will contain the newly renamed
> > > file like yourtablename.9203842903.thaoeu09gu023hgda3p.ext
>
> > > No need to call store() directly as SQLFORM.factory will take care of
> > > that for you.
>
> > > I hope that this helps you.
>
> > > -David Bloom
>
> > > On Oct 4, 7:53 pm, Alex  wrote:
>
> > > > Hi,
>
> > > > I've already spent quite some time with the following problem which I
> > > > think should be fairly easy. I hope someone can help me.
>
> > > > # model
> > > > db.define_table('admin_setting',
> > > >     Field('name', 'string', notnull=True),
> > > >     Field('value', 'string', notnull=True))
>
> > > > in the controller I'm creating a form for various admin settings.
> > > > form = SQLFORM.factory(
> > > >         Field('invoice_logo', 'upload'), ...)
>
> > > > the view works well and displays all fields.
>
> > > > When uploading a file for the logo the file should be handled like
> > > > always (file uploaded to uploads folder, renamed to uuid filename). in
> > > > the table admin_setting I want to store the filename of the uploaded
> > > > file in a row where name='invoice_logo' (the filename should be stored
> > > > in the value field).
>
> > > > How can I achieve this? currently I have this code (the update is
> > > > performed later and not shown here):
> > > > if form.accepts(request.vars, formname='admin_setting_form',
> > > > dbio=False):
> > > >   if request.vars.invoice_logo != None:
> > > >     if type(request.vars.invoice_logo) != str:
> > > >       request.vars.invoice_logo_filename =
> > > > request.vars.invoice_logo.filename
> > > >       field = Field('invoice_logo', 'upload')
> > > >       # field.store fails because field does not have a _tablename
> > > >       uploaded_file = field.store(request.vars.invoice_logo.file,
> > > > request.vars.invoice_logo.filename)
> > > >     else:
> > > >        del request.vars.invoice_logo # do not delete existing logo
>
>


[web2py] Google Cloud SQL

2011-10-06 Thread pbreit
http://googlecode.blogspot.com/2011/10/google-cloud-sql-your-database-in-cloud.html


[web2py] Re: Opening TB Modal Window in View from Controller Form On_submit

2011-10-06 Thread Anthony
Can't you do it with jQuery:

$(function() {
$('input[type="submit"]').click(function() {
[code to open your modal window]
});
}

On Thursday, October 6, 2011 6:18:27 PM UTC-4, D.P. wrote:
>
> I have a form created in my controller and passed by dictionary to my 
> view.  When the submit is clicked for the form, I need to open a modal 
> window (showing a generic progress indicator) while python is processing 
> some loops.  I don't need to do any callbacks with the progress, I'm just 
> showing a generic gif.
>
>
> Anyone have a good method for opening a modal window in the view on submit 
> when the form has been created in the controller?  Or can I just handle that 
> in the controller as well and pass it to the view?
>
> I'm able to accomplish this by creating the form and modal in the view, but 
> I'd prefer to keep the form in the controller and call the modal on_accept 
> from the view.
>
>
> D.P.
>


[web2py] Re: Delete plugin will also delete default theme

2011-10-06 Thread Anthony
Which layout plugin did you install?

On Thursday, October 6, 2011 6:27:27 PM UTC-4, Omi Chiba wrote:
>
> >Have you confirmed the default theme files have actually been deleted? 
> Not sure where it's located... 
>

It would be /views/layout.html and /static/css/base.css.
 

>
> > When using the layout plugin, had you modified your layout.html to extend 
> the 
> > plugin layout.html 
>
> No. It's a brand new app. I think you can also re-produce it very 
> easily.  By the way, web2py version is the latest (Version 1.99.2) 
> one. 
>
>
> On Oct 6, 3:51 pm, Anthony  wrote: 
> > Have you confirmed the default theme files have actually been deleted? 
> When 
> > using the layout plugin, had you modified your layout.html to extend the 
> > plugin layout.html, and if so, did you change it back after deleting the 
> > plugin? 
> > 
> > Anthony 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > On Thursday, October 6, 2011 4:34:17 PM UTC-4, Omi Chiba wrote: 
> > 
> > > See attached screen shot. 
> > 
> > > 1. Download layout plugin 
> > > 2. Upload to your app 
> > > 3. Click "delete plugin" 
> > > 4. Now I'm naked like attached screen.



[web2py] Re: GAE BULK UPLOAD AND DOWNLOAD

2011-10-06 Thread howesc
is this a one-time or a many-time operation?

you can consider using the GAE bulkloader for database backup/restore: 
http://code.google.com/appengine/docs/python/tools/uploadingdata.html

if you want the user to upload a CSV file and then process that file 
creating datastore records i suggest:
 - upload the CSV to the blobstore.  there are a few ways to do this, there 
is a slice about this here: http://www.web2pyslices.com/slices/take_slice/63
 - use the files API to read the blob and process it: 
http://code.google.com/appengine/docs/python/blobstore/overview.html#Writing_Files_to_the_Blobstore

good luck!

cfh


[web2py] Re: Schema Changes in GAE

2011-10-06 Thread howesc
adding columns is a no-op.  just add them in the model and viola.

keep in mind that if there is no data in the columns for existing records 
they will not be returned in queries that filter on those columns.

to rename the column (and pretty similarly to add data to a new column):
 - create a model that has both the old column and the new column name
 - create a controller that iterates over every row in the table.  copy data 
from the first column to the new column with the new name
 - if you have more than say 100 rows you will need to run as a taskqueue or 
backend task.  more than say 1000 rows and you might have to split taskqueue 
tasks
 - remember that ID's are not strictly increasing, so if the app is live and 
writes may happen to this table during the migration don't sort by ID.
 - if you care to delete the old column, create a true google model as a 
expando class with the old field not defined, query the rows, delete the old 
field and put.

here is a sample method that clears fields from a table (i'm certain that 
this does not properly iterate over more than 1000 rows, but i can't find 
the fixed version in my source control):

#remove recording to and from fields
def clear_recording_to_from():
"""
remove the device_id and device_token fields from end_user
"""
from google.appengine.ext import db as gdb
from google.appengine.api.datastore_types import Key
from google.appengine.api import taskqueue
  
class recording(gdb.Expando):
title = gdb.StringProperty(required=False)
  
#use a random (but invalid) string to make sure we find all objects,
# even those with explicit NULL
rows = recording.gql("WHERE title != 'asegsebob'").fetch(limit=1000)
for r in rows:
del r['to']
del r['from']
gdb.put(rows)
  
if len(rows) == 1000:
#there are probably more to process
taskqueue.add(url=URL(r=request))
 
return dict(message="Updating recordings")


[web2py] Opening TB Modal Window in View from Controller Form On_submit

2011-10-06 Thread D.P. Clark
I have a form created in my controller and passed by dictionary to my view.
When the submit is clicked for the form, I need to open a modal window
(showing a generic progress indicator) while python is processing some
loops.  I don't need to do any callbacks with the progress, I'm just showing
a generic gif.


Anyone have a good method for opening a modal window in the view on submit
when the form has been created in the controller?  Or can I just handle that
in the controller as well and pass it to the view?

I'm able to accomplish this by creating the form and modal in the view, but
I'd prefer to keep the form in the controller and call the modal on_accept
from the view.


D.P.


[web2py] Re: Delete plugin will also delete default theme

2011-10-06 Thread Omi Chiba
>Have you confirmed the default theme files have actually been deleted?
Not sure where it's located...

> When using the layout plugin, had you modified your layout.html to extend the
> plugin layout.html

No. It's a brand new app. I think you can also re-produce it very
easily.  By the way, web2py version is the latest (Version 1.99.2)
one.


On Oct 6, 3:51 pm, Anthony  wrote:
> Have you confirmed the default theme files have actually been deleted? When
> using the layout plugin, had you modified your layout.html to extend the
> plugin layout.html, and if so, did you change it back after deleting the
> plugin?
>
> Anthony
>
>
>
>
>
>
>
> On Thursday, October 6, 2011 4:34:17 PM UTC-4, Omi Chiba wrote:
>
> > See attached screen shot.
>
> > 1. Download layout plugin
> > 2. Upload to your app
> > 3. Click "delete plugin"
> > 4. Now I'm naked like attached screen.


[web2py] Re: Building up a Query from nothing

2011-10-06 Thread howesc
"if an extraneous "db.item.id>0" impacts the query performance at all?"

depending on the system it definitely does for sufficiently complex 
queries.  on GAE, probably no effect, on oracle,mysql, postgres it depends 
on how you setup your indexes - you can probably write indexes so it has 
close to no effect, but then you have to allocate space to store that 
(potentially extra) index.

cfh


[web2py] Re: SourceTree Mac hg/git client free for limited time

2011-10-06 Thread Massimo Di Pierro
:-)

On Oct 6, 2:37 pm, pbreit  wrote:
> http://www.sourcetreeapp.com/


[web2py] Re: new feature - need help

2011-10-06 Thread Massimo Di Pierro
My problem is the css. The rest we can discuss later.

Anyway, field = value is correct.

The search string is not DAL syntax, it is english. You can even write
"field equals value and otherfield starts with something" without =
and without quotes around values.

We can add OR support later but AND is automatic. Did you try add two
queries?
I am not trying to copy Access. I am trying to create a pluggable and
customizable way to built the search strings.
Massimo

On Oct 6, 2:28 pm, Richard Vézina  wrote:
> I just think for 2 min about it... A popup grid seems to me the appropriate
> display for this query builder...
>
> Grid :
>
> Field to search  Wich type of constrainer   Searched value  Add createria
> button
> Drop box          =, <, >, etc.                     User input         +
> button
> New row
>
> Maybe a 'AND' or 'OR' is needed for createria (between line)
>
> Maybe the table should just add a column at the begining when more then one
> creteria is entered user has to specify the AND or OR...
>
> So...
>
> AND/OR    Field to search  Wich type of constrainer   Searched value  Add
> createria button
>                 Drop box          =, <, >, etc.                     User
> input         + button
> Dropbox    New row
>
> Query completed (button)
>
> What about that?!
>
> jQuery UI dialog
>
> Richard
>
> On Thu, Oct 6, 2011 at 3:17 PM, Richard Vézina
> wrote:
>
>
>
>
>
>
>
> > Ok, not exactly a la access... Pretty good I notice this :
>
> > "=" create : "name = 'something'" should be "name == 'something'"
>
> > I don't think about to much about the background complexity of what you try
> > to achieve, but I don't understand why menu is an appropriate way to display
> > this query building thing.
>
> > Richard
>
> > On Thu, Oct 6, 2011 at 2:30 PM, Richard Vézina <
> > ml.richard.vez...@gmail.com> wrote:
>
> >> A la Access?! Great...
>
> >> I will try to give a ride to the new smartgrid to see that... Do you have
> >> a test app or do the code you publish earlier to try the new smartgrid
> >> enable automatically the searhcable function?...
>
> >> I try anyway.
>
> >> Richard
>
> >> On Thu, Oct 6, 2011 at 12:01 AM, Massimo Di Pierro <
> >> massimo.dipie...@gmail.com> wrote:
>
> >>> There is a new feature in trunk. When you make a searchable grid, it will
> >>> now show a button before the search input field. It says "Query". Hover 
> >>> over
> >>> it and it will create a popup menu so that you can build the query with 
> >>> the
> >>> mouse.
>
> >>> It works but the css is horrible and I could use some help fixing it.
> >>> The code is generated by a single function in sqlhtml.py build_search()
>
> >>> Massimo


[web2py] Re: Many to many query with two left joins - how to do in Web2py?

2011-10-06 Thread Massimo Di Pierro
Here is your SQL:

SELECT purchase_orders.issue_date, purchase_orders.number,
products.name
FROM purchase_orders LEFT JOIN  purchase_order_products ON
purchase_order_products.purchase_order_id =  purchase_orders.id LEFT
JOIN products ON  purchase_order_products.product_id = products.id

web2py-ese:

db().select(db.purchase_orders.issue_date, db.purchase_orders.number,
db.products.name,
left=[db.purchase_order_products.on(db.purchase_order_products.purchase_order_id
== db.purchase_orders.id),
   db.products.on(db.purchase_order_products.product_id ==
db.products.id)])




On Oct 6, 1:46 pm, Cliff  wrote:
> Actually 'name' comes from products.
>
> Maybe it would be clearer this way:
> SELECT purchase_orders.issue_date,
> purchase_orders.number,
> products.name
> FROM purchase_orders LEFT JOIN
>  purchase_order_products ON purchase_order_products.purchase_order_id
> =
>  purchase_orders.id LEFT JOIN products ON
>  purchase_order_products.product_id = products.id
>
> On Oct 6, 12:13 pm, Massimo Di Pierro 
> wrote:
>
>
>
>
>
>
>
> > Why do you left join products if you do not select anything from it?
>
> > On Oct 6, 7:40 am, Cliff  wrote:
>
> > > Here is the model, simplified:
>
> > > db.define_table('purchase_orders',
> > >     Field('issue_date', 'date',
> > >           comment = SPAN(a_comment, _style='color:orange;')),
> > >     Field('number', length=24, requires=IS_NOT_EMPTY(),
> > >           required=True, notnull=True,
> > >           comment=SPAN('Required', _style='color:orange;')),
> > >     Field('closed', 'boolean', readable=False, writable=False,
> > > default=False),
> > >     format = '%(number)s'
> > >     )
> > > db.define_table( 'products',
> > >     Field('name', length=256, required=True, notnull=True),
> > >     Field('internal_item_number', length=36),
> > >     format = '%(name)s'
> > >     )
> > > db.define_table('purchase_order_products',
> > >     Field('purchase_order_id', db.purchase_orders),
> > >     Field('product_id', db.products),
> > >     Field('quantity', 'decimal(12,3)'),
> > >     )
>
> > > in SQL I can make this query:
> > > SELECT issue_date, number, name FROM purchase_orders LEFT JOIN
> > > purchase_order_products ON purchase_order_products.purchase_order_id =
> > > purchase_orders.id LEFT JOIN products ON
> > > purchase_order_products.product_id = products.id
>
> > > How do I do this in Web2py?


Re: [web2py] Re: Help for creating template

2011-10-06 Thread pbreit
Generally you only need one include, {{include}}, which is going to 
incorporate the content from your view.

But you can also use include to specify another view file to incorporate:
http://web2py.com/book/default/chapter/05#Page-Layout

Example: {{include 'page.html'}}

You also might check out "blocks":
http://web2py.com/book/default/chapter/05#Blocks-in-Views




[web2py] Re: Delete plugin will also delete default theme

2011-10-06 Thread Anthony
Have you confirmed the default theme files have actually been deleted? When 
using the layout plugin, had you modified your layout.html to extend the 
plugin layout.html, and if so, did you change it back after deleting the 
plugin?

Anthony

On Thursday, October 6, 2011 4:34:17 PM UTC-4, Omi Chiba wrote:
>
> See attached screen shot.
>
> 1. Download layout plugin
> 2. Upload to your app
> 3. Click "delete plugin"
> 4. Now I'm naked like attached screen.
>


Re: [web2py] Re: Help for creating template

2011-10-06 Thread Miroslav Gojic
For now I have problem to put different view in specific position on
page/layout

I don't have to much problems with HTML/CSS - three or more columns - at
2006 I resolved this :)

My problem is how to have more than one include, but I see that is possible
to use include page.html and I will tray this options.



- - Miroslav Gojic - -



On Thu, Oct 6, 2011 at 22:19, Anthony  wrote:

>
>- Header:
>
> http://code.google.com/p/web2py/source/browse/applications/welcome/views/layout.html#90
>- Status Bar:
>
> http://code.google.com/p/web2py/source/browse/applications/welcome/views/layout.html#100
>- Main Body (including two optional sidebars):
>
> http://code.google.com/p/web2py/source/browse/applications/welcome/views/layout.html#117
>- Content (within main body):
>
> http://code.google.com/p/web2py/source/browse/applications/welcome/views/layout.html#128
>- Footer:
>
> http://code.google.com/p/web2py/source/browse/applications/welcome/views/layout.html#146
>
>
> The {{include}} appears in the "content" section at line 129 -- that's were
> your particular view gets inserted into the main layout.
>
> Note, although web2py provides some help with layout via the scaffolding
> ('welcome') app, layout is really a client-side HTML/CSS issue. web2py
> doesn't define/design your layout for you -- you design your layout, and
> web2py can dynamically generate it and the content that goes into it. If you
> need a three column layout, you have to figure out how to do that using
> HTML/CSS. If you need help with that, you might consider one of the many CSS
> layout frameworks available (e.g., www.getskeleton.com).
>
> If you want to make your pages modular, you could use template blocks (
> http://web2py.com/book/default/chapter/05#Blocks-in-Views) and/or
> components (http://web2py.com/book/default/chapter/13#Components).
> However, you'll still have to design a layout to contain your blocks and
> components.
>
> Anthony
>
>
> On Thursday, October 6, 2011 3:32:26 PM UTC-4, miroslavgojic wrote:
>
>> I didn't find any simple example, I look at my layout.html but it is to
>> much complicated for my needs, or I must my template from beginning to end
>> that I can understood.
>>
>> I look in the book but nothing helpful for beginners, and where is that
>> thing commented, here on the group.
>>
>>
>> - - Miroslav Gojic - -
>>
>>
>>
>> On Thu, Oct 6, 2011 at 21:23, pbreit  wrote:
>>
>>> The default layout.html is configured with a Header, Body and Footer.
>>> It's well-commented so that's a good place to start.
>>
>>
>>


Re: [web2py] Re: CRUD and Auth

2011-10-06 Thread Miroslav Gojic
Just simple instead CRUD i put Auth and get my settings for form.

I know that there is more than one form (there is three forms: login,
registration, and lost password)

- - Miroslav Gojic - -


On Thu, Oct 6, 2011 at 22:27, Anthony  wrote:

> auth.settings.formstyle = 'divs'
>
> Also, in the 'user' function, auth() returns a form object -- you can
> customize that as desired via the methods described here:
> http://web2py.com/book/default/chapter/07#Custom-forms. Note, auth()
> returns a different kind of form (e.g., login, registration, etc.) depending
> on the particular request args passed to 'user', so you need to make your
> customizations conditional on the type of form.
>
> Anthony
>
>
> On Thursday, October 6, 2011 3:25:14 PM UTC-4, miroslavgojic wrote:
>>
>> Can I apply CURD to Authentication
>>
>> I use gluon.tools Auth but can I use CURD to Auth
>>
>> exactly can I use curd.settings.formstyle = 'divs' on Auth and how
>
>


Re: [web2py] Re: How to setup Web2py on live Linux server

2011-10-06 Thread Miroslav Gojic
I will tray to instal Centos and then to put web2py in online usage.

After that linux installation it will be more questions


- - Miroslav Gojic - -



On Thu, Oct 6, 2011 at 21:51, pbreit  wrote:

> Should work OK I think. There are no costs or licensing needs just to run
> Web2py so go for it.
>
> You could review the Fedora setup script:
>
> http://code.google.com/p/web2py/source/browse/scripts/setup-web2py-fedora.sh
>
> I'm not sure it would run successfully on your setup but you can manually
> enter in the commands that you think you need and see how it goes.
>


[web2py] Delete plugin will also delete default theme

2011-10-06 Thread Omi Chiba
See attached screen shot.

1. Download layout plugin
2. Upload to your app
3. Click "delete plugin"
4. Now I'm naked like attached screen.
<>

[web2py] SQLFORM.grid() problem - latest trunk

2011-10-06 Thread Jim Steil

Hi

I installed the latest from trunk today and am now getting the following.

Traceback(most recent call last):
  File"C:\dev\web2py\gluon\restricted.py",line194,inrestricted
execccodeinenvironment
  File"C:/dev/web2py/applications/FoodPantry/controllers/default.py"  
,line155,in
  File"C:\dev\web2py\gluon\globals.py",line149,in
self._caller=lambdaf:f()
  File"C:\dev\web2py\gluon\tools.py",line2467,inf
returnaction(*a, **b)
  File"C:/dev/web2py/applications/FoodPantry/controllers/default.py"  
,line108,inparticipants
ui='jquery-ui',csv=False,details=False)
  File"C:\dev\web2py\gluon\sqlhtml.py",line1868,insmartgrid
user_signature=user_signature,**kwargs)
TypeError:unbound method grid()must be called withSQLFORM  instance as first 
argument(got Query instance instead)



My call to the grid is:

columns = ['member.firstName', 'member.lastName', 'member.city',
   'member.state', 'member.phone', 'member.joinedOn',
   'memberCampaign.campaignId',
   'memberCampaign.amount', 'memberCampaign.paidOn',
   'memberTag.tagId']
orderby = [db.member.lastName, db.member.firstName]
db.memberCampaign['_plural'] = 'Campaigns'
db.memberTag['_plural'] = 'Tags'
grid = SQLFORM.smartgrid(db.member, columns=columns, details=False,
 ui='jquery-ui', csv=False)
return dict(grid=grid)

Any thoughts on what might be causing this.  Worked fine up until today.

-Jim

--
Jim Steil
VP of Information Technology
Quality Liquid Feeds, Inc.
608.935.2345 office
608.341.9896 cell


[web2py] Re: CRUD and Auth

2011-10-06 Thread Anthony
auth.settings.formstyle = 'divs'

Also, in the 'user' function, auth() returns a form object -- you can 
customize that as desired via the methods described 
here: http://web2py.com/book/default/chapter/07#Custom-forms. Note, auth() 
returns a different kind of form (e.g., login, registration, etc.) depending 
on the particular request args passed to 'user', so you need to make your 
customizations conditional on the type of form.

Anthony

On Thursday, October 6, 2011 3:25:14 PM UTC-4, miroslavgojic wrote:
>
> Can I apply CURD to Authentication 
>
> I use gluon.tools Auth but can I use CURD to Auth 
>
> exactly can I use curd.settings.formstyle = 'divs' on Auth and how



Re: [web2py] Re: Help for creating template

2011-10-06 Thread Anthony

   
   - 
   Header: 
http://code.google.com/p/web2py/source/browse/applications/welcome/views/layout.html#90
   - Status 
   Bar: 
http://code.google.com/p/web2py/source/browse/applications/welcome/views/layout.html#100
   - Main Body (including two optional 
   sidebars): 
http://code.google.com/p/web2py/source/browse/applications/welcome/views/layout.html#117
   - Content (within main 
   body): 
http://code.google.com/p/web2py/source/browse/applications/welcome/views/layout.html#128
   - 
   Footer: 
http://code.google.com/p/web2py/source/browse/applications/welcome/views/layout.html#146
   

The {{include}} appears in the "content" section at line 129 -- that's were 
your particular view gets inserted into the main layout.

Note, although web2py provides some help with layout via the scaffolding 
('welcome') app, layout is really a client-side HTML/CSS issue. web2py 
doesn't define/design your layout for you -- you design your layout, and 
web2py can dynamically generate it and the content that goes into it. If you 
need a three column layout, you have to figure out how to do that using 
HTML/CSS. If you need help with that, you might consider one of the many CSS 
layout frameworks available (e.g., www.getskeleton.com).

If you want to make your pages modular, you could use template blocks 
(http://web2py.com/book/default/chapter/05#Blocks-in-Views) and/or 
components (http://web2py.com/book/default/chapter/13#Components). However, 
you'll still have to design a layout to contain your blocks and components.

Anthony


On Thursday, October 6, 2011 3:32:26 PM UTC-4, miroslavgojic wrote:
>
> I didn't find any simple example, I look at my layout.html but it is to 
> much complicated for my needs, or I must my template from beginning to end 
> that I can understood.
>
> I look in the book but nothing helpful for beginners, and where is that 
> thing commented, here on the group. 
>
>
> - - Miroslav Gojic - -
>
>
>
> On Thu, Oct 6, 2011 at 21:23, pbreit  wrote:
>
>> The default layout.html is configured with a Header, Body and Footer. It's 
>> well-commented so that's a good place to start.
>
>
>

[web2py] Re: Web2py/modj/tomcat

2011-10-06 Thread Chris Clark
On Oct 6, 7:57 am, Sergio  wrote:
> I have successfully run web2py with jython, now I'd like to run it
> from Tomcat using modj.

That is awesome! What version of web2py and Jython have you got
working? Could you share your patches?

> I ran into two problems so far:
>  - web2py is looking for its version file in tomcat/bin. Why the hell?

I noticed that the import monkey patching wasn't working well/at-all
with Jython 2.5.2, my guess is this is another manifestation. See the
issue tracker for more information.


>  - my servlet "gets in the way". Let's say its address 
> ishttp://host:8080/myservlet/
> When called without an app name, web2py will try to run the "welcome"
> app, and redirects me tohttp://host:8080/welcome/default/indexwhen
> it should redirect me tohttp://host:8080/myservlet/welcome/default/index
> instead. I have tried to play with routes_out to add the servlet's
> name to the path but I couldn't get it to work. Any ideas?

Are you using snakefight to generate config files for modjy or
creating by hand?

Chris



[web2py] Re: manual file upload using SQLFORM.factory

2011-10-06 Thread Alex
Hi David,

works great, thanks!

I'm now manually uploading with these few lines:
field = Field('invoice_logo', 'upload',
uploadfolder=os.path.join(request.folder,'uploads/'))
field._tablename = 'admin_setting'
uploaded_invoice_logo_filename =
field.store(request.vars.invoice_logo.file,
request.vars.invoice_logo.filename)

@Massimo: now that I know, it's quite easy so I don't know much to
make it better. It would be good if this would be mentioned in the
documentation (there is already a short 'Manual Uploads' section),
although this is probably not a common use case. And maybe it would be
a good idea to have default values for uploadfolder and tablename?

On 6 Okt., 03:46, Massimo Di Pierro 
wrote:
> Suggestions to make the behaviour better?
>
> On Oct 5, 5:55 pm, TheSweetlink  wrote:
>
>
>
> > Hello Alex,
>
> > Two things I've found when manually uploading via SQLFORM.factory:
>
> > 1)  You need to specify a table_name='...' to avoid the
> > no_table_newfilename.extension issue like this:
>
> > form = SQLFORM.factory(...Field definitions...,
> > table_name='some_table_name')
>
> > 2)  Additionally you must specify an uploadfolder in your upload Field
> > definition similar to this:
>
> > form = SQLFORM.factory(...,
> > Field('invoice_logo', type='upload',
> > uploadfolder=os.path.join(request.folder,'static/uploads/')),
> > ..., table_name='whatever_you_like')
>
> > **NOTE** 'static/uploads' is just an example, you can upload to
> > wherever it will be appropriate.
>
> > In this case the newly uploaded and renamed file to
> > your_application's_dir/static/uploads/your_new_filename_here
>
> > One gotcha to look out for following your field name as an example
> > without the quotation marks:
>
> > In your form.accepts(...):
>
> > "request.vars.invoice_logo" will contain the original filename of your
> > upload whereas
>
> > "form.vars.invoice_logo_newfilename" will contain the newly renamed
> > file like yourtablename.9203842903.thaoeu09gu023hgda3p.ext
>
> > No need to call store() directly as SQLFORM.factory will take care of
> > that for you.
>
> > I hope that this helps you.
>
> > -David Bloom
>
> > On Oct 4, 7:53 pm, Alex  wrote:
>
> > > Hi,
>
> > > I've already spent quite some time with the following problem which I
> > > think should be fairly easy. I hope someone can help me.
>
> > > # model
> > > db.define_table('admin_setting',
> > >     Field('name', 'string', notnull=True),
> > >     Field('value', 'string', notnull=True))
>
> > > in the controller I'm creating a form for various admin settings.
> > > form = SQLFORM.factory(
> > >         Field('invoice_logo', 'upload'), ...)
>
> > > the view works well and displays all fields.
>
> > > When uploading a file for the logo the file should be handled like
> > > always (file uploaded to uploads folder, renamed to uuid filename). in
> > > the table admin_setting I want to store the filename of the uploaded
> > > file in a row where name='invoice_logo' (the filename should be stored
> > > in the value field).
>
> > > How can I achieve this? currently I have this code (the update is
> > > performed later and not shown here):
> > > if form.accepts(request.vars, formname='admin_setting_form',
> > > dbio=False):
> > >   if request.vars.invoice_logo != None:
> > >     if type(request.vars.invoice_logo) != str:
> > >       request.vars.invoice_logo_filename =
> > > request.vars.invoice_logo.filename
> > >       field = Field('invoice_logo', 'upload')
> > >       # field.store fails because field does not have a _tablename
> > >       uploaded_file = field.store(request.vars.invoice_logo.file,
> > > request.vars.invoice_logo.filename)
> > >     else:
> > >        del request.vars.invoice_logo # do not delete existing logo


[web2py] Re: On demond migrations

2011-10-06 Thread pbreit
It does seem like a button or function to "run migrations" might be a nice 
idea. Not sure how it would interact with migrate/fake_migrate settings, 
though. Override them all?

[web2py] Re: Cannot serve any pages after fresh install of Python2.5

2011-10-06 Thread pbreit
I'd suggest starting over with a clean install if possible. Is there some 
reason you are installing 2.5? If not, I'd avoid it and use what your server 
comes with.

I use Ubuntu 10.04 which is a "long term support" release and comes with 
Python 2.6. But 11.04 should work fine, too.


[web2py] Re: Sending Email Under Linux

2011-10-06 Thread pbreit
It's hard to say. The problem in establishing SMTP connections frequently 
has to do with ports or SSL/TLS. Does Rogers have any information about 
connecting to it?

[web2py] Re: How to setup Web2py on live Linux server

2011-10-06 Thread pbreit
Should work OK I think. There are no costs or licensing needs just to run 
Web2py so go for it.

You could review the Fedora setup script:
http://code.google.com/p/web2py/source/browse/scripts/setup-web2py-fedora.sh

I'm not sure it would run successfully on your setup but you can manually 
enter in the commands that you think you need and see how it goes.


[web2py] Re: Dealing with UTC and converting to local time

2011-10-06 Thread TheSweetlink
For those interested in timezones and your international site I found
a nice js script after much hunting to detect utc timezone offset,
whether or not it is DST, and the hemisphere of the client.

https://bitbucket.org/pellepim/jstimezonedetect

Another plus:  "Provided under the Do Whatever You Want With This Code
License."

Enjoy.

-David

On Oct 5, 10:20 am, Farsheed Ashouri 
wrote:
> Thank you Massimo, You solution is very good. I am using a javascript code
> that detects timezone and other things, but i should change it to your way
> for sure. Although this script does the job for me but it's more
> complicated.
>
>  detect_timezone.js
> 13KViewDownload


[web2py] Re: Building up a Query from nothing

2011-10-06 Thread pbreit
I like the "query &= fragment" approach better but am not sure how or if you 
can set up the default. Does anyone know if an extraneous "db.item.id>0" 
impacts the query performance at all?

[web2py] SourceTree Mac hg/git client free for limited time

2011-10-06 Thread pbreit
http://www.sourcetreeapp.com/


Re: [web2py] Re: Help for creating template

2011-10-06 Thread Miroslav Gojic
I didn't find any simple example, I look at my layout.html but it is to much
complicated for my needs, or I must my template from beginning to end that I
can understood.

I look in the book but nothing helpful for beginners, and where is that
thing commented, here on the group.


- - Miroslav Gojic - -



On Thu, Oct 6, 2011 at 21:23, pbreit  wrote:

> The default layout.html is configured with a Header, Body and Footer. It's
> well-commented so that's a good place to start.


Re: [web2py] new feature - need help

2011-10-06 Thread Richard Vézina
I just think for 2 min about it... A popup grid seems to me the appropriate
display for this query builder...

Grid :

Field to search  Wich type of constrainer   Searched value  Add createria
button
Drop box  =, <, >, etc. User input +
button
New row

Maybe a 'AND' or 'OR' is needed for createria (between line)

Maybe the table should just add a column at the begining when more then one
creteria is entered user has to specify the AND or OR...

So...

AND/ORField to search  Wich type of constrainer   Searched value  Add
createria button
Drop box  =, <, >, etc. User
input + button
DropboxNew row

Query completed (button)

What about that?!

jQuery UI dialog

Richard


On Thu, Oct 6, 2011 at 3:17 PM, Richard Vézina
wrote:

> Ok, not exactly a la access... Pretty good I notice this :
>
>
> "=" create : "name = 'something'" should be "name == 'something'"
>
> I don't think about to much about the background complexity of what you try
> to achieve, but I don't understand why menu is an appropriate way to display
> this query building thing.
>
> Richard
>
>
> On Thu, Oct 6, 2011 at 2:30 PM, Richard Vézina <
> ml.richard.vez...@gmail.com> wrote:
>
>> A la Access?! Great...
>>
>> I will try to give a ride to the new smartgrid to see that... Do you have
>> a test app or do the code you publish earlier to try the new smartgrid
>> enable automatically the searhcable function?...
>>
>> I try anyway.
>>
>> Richard
>>
>>
>> On Thu, Oct 6, 2011 at 12:01 AM, Massimo Di Pierro <
>> massimo.dipie...@gmail.com> wrote:
>>
>>> There is a new feature in trunk. When you make a searchable grid, it will
>>> now show a button before the search input field. It says "Query". Hover over
>>> it and it will create a popup menu so that you can build the query with the
>>> mouse.
>>>
>>> It works but the css is horrible and I could use some help fixing it.
>>> The code is generated by a single function in sqlhtml.py build_search()
>>>
>>> Massimo
>>
>>
>>
>


[web2py] CRUD and Auth

2011-10-06 Thread miroslavgojic
Can I apply CURD to Authentication

I use gluon.tools Auth but can I use CURD to Auth

exactly can I use curd.settings.formstyle = 'divs' on Auth and how


[web2py] Re: Help for creating template

2011-10-06 Thread pbreit
The default layout.html is configured with a Header, Body and Footer. It's 
well-commented so that's a good place to start.

Re: [web2py] new feature - need help

2011-10-06 Thread Richard Vézina
Ok, not exactly a la access... Pretty good I notice this :


"=" create : "name = 'something'" should be "name == 'something'"

I don't think about to much about the background complexity of what you try
to achieve, but I don't understand why menu is an appropriate way to display
this query building thing.

Richard

On Thu, Oct 6, 2011 at 2:30 PM, Richard Vézina
wrote:

> A la Access?! Great...
>
> I will try to give a ride to the new smartgrid to see that... Do you have a
> test app or do the code you publish earlier to try the new smartgrid enable
> automatically the searhcable function?...
>
> I try anyway.
>
> Richard
>
>
> On Thu, Oct 6, 2011 at 12:01 AM, Massimo Di Pierro <
> massimo.dipie...@gmail.com> wrote:
>
>> There is a new feature in trunk. When you make a searchable grid, it will
>> now show a button before the search input field. It says "Query". Hover over
>> it and it will create a popup menu so that you can build the query with the
>> mouse.
>>
>> It works but the css is horrible and I could use some help fixing it.
>> The code is generated by a single function in sqlhtml.py build_search()
>>
>> Massimo
>
>
>


[web2py] Help for creating template

2011-10-06 Thread miroslavgojic

I'm trying to create, or figure-out, how to create my template for
site but not go so well for now.

I see some examples, main code of template is in layout.html. - is
this correct

Head information are manually created or with some variables. - this I
understood
hear I can give title to my page, meta tags, keywords, ... make css
file definition and so on

I have problem to understood how to create my body

I have three main section - Header, footer and content
in content I have three columns
in columns I need put different content, how to create modules and put
same to columns.
something like in joomla modules and  I put my module on column and I
get my content

Where I can find some information abut this problem.


[web2py] Re: Many to many query with two left joins - how to do in Web2py?

2011-10-06 Thread Cliff
Actually 'name' comes from products.

Maybe it would be clearer this way:
SELECT purchase_orders.issue_date,
purchase_orders.number,
products.name
FROM purchase_orders LEFT JOIN
 purchase_order_products ON purchase_order_products.purchase_order_id
=
 purchase_orders.id LEFT JOIN products ON
 purchase_order_products.product_id = products.id


On Oct 6, 12:13 pm, Massimo Di Pierro 
wrote:
> Why do you left join products if you do not select anything from it?
>
> On Oct 6, 7:40 am, Cliff  wrote:
>
>
>
> > Here is the model, simplified:
>
> > db.define_table('purchase_orders',
> >     Field('issue_date', 'date',
> >           comment = SPAN(a_comment, _style='color:orange;')),
> >     Field('number', length=24, requires=IS_NOT_EMPTY(),
> >           required=True, notnull=True,
> >           comment=SPAN('Required', _style='color:orange;')),
> >     Field('closed', 'boolean', readable=False, writable=False,
> > default=False),
> >     format = '%(number)s'
> >     )
> > db.define_table( 'products',
> >     Field('name', length=256, required=True, notnull=True),
> >     Field('internal_item_number', length=36),
> >     format = '%(name)s'
> >     )
> > db.define_table('purchase_order_products',
> >     Field('purchase_order_id', db.purchase_orders),
> >     Field('product_id', db.products),
> >     Field('quantity', 'decimal(12,3)'),
> >     )
>
> > in SQL I can make this query:
> > SELECT issue_date, number, name FROM purchase_orders LEFT JOIN
> > purchase_order_products ON purchase_order_products.purchase_order_id =
> > purchase_orders.id LEFT JOIN products ON
> > purchase_order_products.product_id = products.id
>
> > How do I do this in Web2py?


Re: [web2py] new feature - need help

2011-10-06 Thread Richard Vézina
A la Access?! Great...

I will try to give a ride to the new smartgrid to see that... Do you have a
test app or do the code you publish earlier to try the new smartgrid enable
automatically the searhcable function?...

I try anyway.

Richard

On Thu, Oct 6, 2011 at 12:01 AM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> There is a new feature in trunk. When you make a searchable grid, it will
> now show a button before the search input field. It says "Query". Hover over
> it and it will create a popup menu so that you can build the query with the
> mouse.
>
> It works but the css is horrible and I could use some help fixing it.
> The code is generated by a single function in sqlhtml.py build_search()
>
> Massimo


[web2py] Re: SELECT / OPTGROUP

2011-10-06 Thread Dominique
Thanks for replying.

value=""bla bla bla  SubRegion 3" already tried without success ...
Any other idea ?


On Oct 6, 7:27 pm, puercoespin 
wrote:
> For selected, try
>
>  (_name="region_to_search",
> value="bla bla bla  SubRegion 3")
>
> instead of
>
> (_name="region_to_search",
> selected="bla bla bla  SubRegion 3")
>
> On 6 oct, 18:27, Dominique  wrote:
>
>
>
>
>
>
>
> > Hello All,
>
> > First things first:  congratulations to Massimo and all those who
> > help.
> > Web2py is really a great framework.
> > Even for non-professional developers like me, it is both easy and
> > powerful.
> > A big big thank for providing such a nice framework.
> > I am trying to learn web2py (with an average Python level), so forgive
> > me for my silly questions (there will be others ;))
>
> > Could anybody help me with this SELECT / OPTGROUP problem ?
> > The following SELECT with OPTGROUP example illustrates my problems
> > (see below).
> > May be it is more a python difficulty than a web2py problem... (I am
> > not a professional).
>
> > 1) How to make an item of the list "selected", for instance 'SubRegion
> > 3' ? I tried with value= 'SubRegion 3' or selected='SubRegion 3'  but
> > in this case, it doesn't work.
> > Idea: the visitor gives his region, then his region is automatically
> > pre-selected when he's in the search area.
> > He can change it too.
> > 2) keepvalues=True  does not work in my example (although it usually
> > works fine with INPUTs, SELECTs,...)
> > 3) If someone has a more elegant way to program the building of the
> > select, I would appreciate ;)
> > 4) Something else: I also made another form to generate a query (and
> > its result) with a sort order.
> > Is there a way to programmatically trigger the submit button when the
> > sort order is changed ?
> > (ie: I want the user to avoid having to click on submit after he
> > changed the sort order)
>
> > Thanks in advance for any help
> > Dominique
>
> > In models:
> > db.define_table('region',
> >         Field('name', 'string', length=250))
> > db.define_table('subregion',
> >         Field('name', 'string', length=250),
> >     Field('region', db.region))
> > db.region.insert(name="Region A")
> > db.region.insert(name="Region B")
> > db.subregion.insert(name="SubRegion 1", region=1)
> > db.subregion.insert(name="SubRegion 2", region=1)
> > db.subregion.insert(name="SubRegion 3", region=2)
> > db.subregion.insert(name="SubRegion 4", region=2)
> > db.subregion.insert(name="SubRegion 5", region=2)
> > db.subregion.insert(name="SubRegion 6", region=2)
>
> > In Controller:
> > def search_form():
> >     q = db(db.region.id==db.subregion.region)\
> >     .select(orderby=db.region.name | db.subregion.name)
>
> >     def get_it(rows):
> >         """
> >         Creates a list of tuples to be used in the SELECT helper:
> >         [('Region A',['bla bla bla  SubRegion 1','bla bla bla
> > SubRegion 2', 'bla bla bla  SubRegion 3']),
> >         ('Region A',['bla bla bla  SubRegion 4','bla bla bla
> > SubRegion 5', 'bla bla bla  SubRegion 6'])]
> >         """
> >         alist=[]
> >         for row in rows:
> >             nr = row.region.name
> >             if nr not in alist:
> >                 alist.append(nr)
> >         the_list=[]
> >         for elem in alist:
> >             newlist=[]
> >             for row in rows:
> >                 if row.region.name == elem:
> >                     newlist.append('bla bla bla  '+row.subregion.name)
> >             the_list.append([elem,OPTGROUP(*newlist)])
> >         return the_list
>
> >     t=None
> >     form=FORM(
> >             TR("",SELECT(*get_it(q), **dict(_name="region_to_search",
> > selected="bla bla bla  SubRegion 3"))),
> >             TR("",INPUT(_type="submit",_value="Search"))
> >               )
>
> >     if form.accepts(request.vars, session, keepvalues=True):
> >         t=form.vars.region_to_search
> >         response.flash="%s"%t
>
> >     return dict(q=q, form=form)
>
> > All this returns something like (there are gluon objects inside...):
> > 
> > Region A
> > 
> > bla bla bla  SubRegion 1 > option>
> > bla bla bla  SubRegion 2 > option>
> > 
> > 
> > Region B
> > bla bla bla  SubRegion 3 > option>
> > bla bla bla  SubRegion 4 > option>
> > bla bla bla  SubRegion 5 > option>
> > bla bla bla  SubRegion 6 > option>
> > 
> > 
> > 


[web2py] Re: SELECT / OPTGROUP

2011-10-06 Thread puercoespin
For selected, try

 (_name="region_to_search",
value="bla bla bla  SubRegion 3")

instead of

(_name="region_to_search",
selected="bla bla bla  SubRegion 3")



On 6 oct, 18:27, Dominique  wrote:
> Hello All,
>
> First things first:  congratulations to Massimo and all those who
> help.
> Web2py is really a great framework.
> Even for non-professional developers like me, it is both easy and
> powerful.
> A big big thank for providing such a nice framework.
> I am trying to learn web2py (with an average Python level), so forgive
> me for my silly questions (there will be others ;))
>
> Could anybody help me with this SELECT / OPTGROUP problem ?
> The following SELECT with OPTGROUP example illustrates my problems
> (see below).
> May be it is more a python difficulty than a web2py problem... (I am
> not a professional).
>
> 1) How to make an item of the list "selected", for instance 'SubRegion
> 3' ? I tried with value= 'SubRegion 3' or selected='SubRegion 3'  but
> in this case, it doesn't work.
> Idea: the visitor gives his region, then his region is automatically
> pre-selected when he's in the search area.
> He can change it too.
> 2) keepvalues=True  does not work in my example (although it usually
> works fine with INPUTs, SELECTs,...)
> 3) If someone has a more elegant way to program the building of the
> select, I would appreciate ;)
> 4) Something else: I also made another form to generate a query (and
> its result) with a sort order.
> Is there a way to programmatically trigger the submit button when the
> sort order is changed ?
> (ie: I want the user to avoid having to click on submit after he
> changed the sort order)
>
> Thanks in advance for any help
> Dominique
>
> In models:
> db.define_table('region',
>         Field('name', 'string', length=250))
> db.define_table('subregion',
>         Field('name', 'string', length=250),
>     Field('region', db.region))
> db.region.insert(name="Region A")
> db.region.insert(name="Region B")
> db.subregion.insert(name="SubRegion 1", region=1)
> db.subregion.insert(name="SubRegion 2", region=1)
> db.subregion.insert(name="SubRegion 3", region=2)
> db.subregion.insert(name="SubRegion 4", region=2)
> db.subregion.insert(name="SubRegion 5", region=2)
> db.subregion.insert(name="SubRegion 6", region=2)
>
> In Controller:
> def search_form():
>     q = db(db.region.id==db.subregion.region)\
>     .select(orderby=db.region.name | db.subregion.name)
>
>     def get_it(rows):
>         """
>         Creates a list of tuples to be used in the SELECT helper:
>         [('Region A',['bla bla bla  SubRegion 1','bla bla bla
> SubRegion 2', 'bla bla bla  SubRegion 3']),
>         ('Region A',['bla bla bla  SubRegion 4','bla bla bla
> SubRegion 5', 'bla bla bla  SubRegion 6'])]
>         """
>         alist=[]
>         for row in rows:
>             nr = row.region.name
>             if nr not in alist:
>                 alist.append(nr)
>         the_list=[]
>         for elem in alist:
>             newlist=[]
>             for row in rows:
>                 if row.region.name == elem:
>                     newlist.append('bla bla bla  '+row.subregion.name)
>             the_list.append([elem,OPTGROUP(*newlist)])
>         return the_list
>
>     t=None
>     form=FORM(
>             TR("",SELECT(*get_it(q), **dict(_name="region_to_search",
> selected="bla bla bla  SubRegion 3"))),
>             TR("",INPUT(_type="submit",_value="Search"))
>               )
>
>     if form.accepts(request.vars, session, keepvalues=True):
>         t=form.vars.region_to_search
>         response.flash="%s"%t
>
>     return dict(q=q, form=form)
>
> All this returns something like (there are gluon objects inside...):
> 
> Region A
> 
> bla bla bla  SubRegion 1 option>
> bla bla bla  SubRegion 2 option>
> 
> 
> Region B
> bla bla bla  SubRegion 3 option>
> bla bla bla  SubRegion 4 option>
> bla bla bla  SubRegion 5 option>
> bla bla bla  SubRegion 6 option>
> 
> 
> 


[web2py] Re: vote for Pycharm support for Web2py

2011-10-06 Thread mikech
Bump again.  The new Pycharm Early Access Program has released a new version 
discussed at: 
http://blog.jetbrains.com/pycharm/2011/10/new-pycharm-2-0-eap-build-cython-coffeescript-code-coverage/
  
It now has support for Cython and Coffeescript.  The latter sounds very 
interesting.

[web2py] Schema Changes in GAE

2011-10-06 Thread Joseph Jude
Hello All,
As much as I wanted to avoid, eventually I had to add two columns and rename 
a column to an existing table in GAE which contain data. Is there a way 
(after much search, I'm not even asking for an easy way) to do that?

Thanks,
Joseph


[web2py] Re: is it possible to update the html using elements?

2011-10-06 Thread Anthony
HTML helpers act as Python lists with respect to their components, so if you 
know the indexes, you can do things like:

grid[i][j][k] = some_other_html_element
del grid[i][j][k]

I'm not sure if you can do assignments or deletions via .elements(), though.

Anthony

On Thursday, October 6, 2011 12:39:54 PM UTC-4, apple wrote:
>
> web2py elements allows me to parse the dom; change attributes; and 
> insert elements. But is it possible to remove elements entirely or to 
> replace elements with new html? 
>
> e.g. I can hide the buttons in a grid by doing this: 
>
> pagination=grid.elements('.web2py_paginator') 
> if pagination: 
> pagination[0].update(_style="visibility:hidden") 
>
> But is there a way I could replace the buttons with some html 
> generated in web2py? 
>
>

[web2py] Re: Overriding Grid/Smartgrid's 'Edit/Delete/View'

2011-10-06 Thread apple
If you use jqueryui then the links are rendered as buttons.

On Oct 6, 1:42 pm, Javier Pepe  wrote:
> Hello
>
> Along with the question of Johann, you can add new buttons to the grid
> / SmartGrid, because the links are render as links, and not as
> buttons.
>
> Thanks
>
>
>
>
>
>
>
> On Thu, Oct 6, 2011 at 9:36 AM, apple  wrote:
> > You can add your own buttons using:
>
> > links = [lambda row: A('Edit',_href=URL("controller","edit",
> > args=["update", tablename, a.id]))
>
> > and set editable, deletable, details  to False.
>
> > On Oct 6, 12:48 pm, Johann Spies  wrote:
> >> How do I override the views/controllers  triggered by the buttons  
> >> mentioned
> >> in the subject line when using SQLFORM.grid/smartgrid?
>
> >> Regards
> >> Johann
>
> >> --
> >>  May grace and peace be yours in abundance through the full knowledge of 
> >> God
> >> and of Jesus our Lord!  His divine power has given us everything we need 
> >> for
> >> life and godliness through the full knowledge of the one who called us by
> >> his own glory and excellence.
> >>                                                     2 Pet. 1:2b,3a


[web2py] Re: Building up a Query from nothing

2011-10-06 Thread howesc
how about use bruno's suggestion, but leave out the default at the top.  if 
the list of queries is empty when you get to the reduce step then set 
query=(db.table.id>0) otherwise do the reduce?


[web2py] SELECT / OPTGROUP

2011-10-06 Thread Dominique
Hello All,

First things first:  congratulations to Massimo and all those who
help.
Web2py is really a great framework.
Even for non-professional developers like me, it is both easy and
powerful.
A big big thank for providing such a nice framework.
I am trying to learn web2py (with an average Python level), so forgive
me for my silly questions (there will be others ;))

Could anybody help me with this SELECT / OPTGROUP problem ?
The following SELECT with OPTGROUP example illustrates my problems
(see below).
May be it is more a python difficulty than a web2py problem... (I am
not a professional).

1) How to make an item of the list "selected", for instance 'SubRegion
3' ? I tried with value= 'SubRegion 3' or selected='SubRegion 3'  but
in this case, it doesn't work.
Idea: the visitor gives his region, then his region is automatically
pre-selected when he's in the search area.
He can change it too.
2) keepvalues=True  does not work in my example (although it usually
works fine with INPUTs, SELECTs,...)
3) If someone has a more elegant way to program the building of the
select, I would appreciate ;)
4) Something else: I also made another form to generate a query (and
its result) with a sort order.
Is there a way to programmatically trigger the submit button when the
sort order is changed ?
(ie: I want the user to avoid having to click on submit after he
changed the sort order)

Thanks in advance for any help
Dominique

In models:
db.define_table('region',
Field('name', 'string', length=250))
db.define_table('subregion',
Field('name', 'string', length=250),
Field('region', db.region))
db.region.insert(name="Region A")
db.region.insert(name="Region B")
db.subregion.insert(name="SubRegion 1", region=1)
db.subregion.insert(name="SubRegion 2", region=1)
db.subregion.insert(name="SubRegion 3", region=2)
db.subregion.insert(name="SubRegion 4", region=2)
db.subregion.insert(name="SubRegion 5", region=2)
db.subregion.insert(name="SubRegion 6", region=2)

In Controller:
def search_form():
q = db(db.region.id==db.subregion.region)\
.select(orderby=db.region.name | db.subregion.name)

def get_it(rows):
"""
Creates a list of tuples to be used in the SELECT helper:
[('Region A',['bla bla bla  SubRegion 1','bla bla bla
SubRegion 2', 'bla bla bla  SubRegion 3']),
('Region A',['bla bla bla  SubRegion 4','bla bla bla
SubRegion 5', 'bla bla bla  SubRegion 6'])]
"""
alist=[]
for row in rows:
nr = row.region.name
if nr not in alist:
alist.append(nr)
the_list=[]
for elem in alist:
newlist=[]
for row in rows:
if row.region.name == elem:
newlist.append('bla bla bla  '+row.subregion.name)
the_list.append([elem,OPTGROUP(*newlist)])
return the_list

t=None
form=FORM(
TR("",SELECT(*get_it(q), **dict(_name="region_to_search",
selected="bla bla bla  SubRegion 3"))),
TR("",INPUT(_type="submit",_value="Search"))
  )

if form.accepts(request.vars, session, keepvalues=True):
t=form.vars.region_to_search
response.flash="%s"%t

return dict(q=q, form=form)

All this returns something like (there are gluon objects inside...):

Region A

bla bla bla  SubRegion 1
bla bla bla  SubRegion 2


Region B
bla bla bla  SubRegion 3
bla bla bla  SubRegion 4
bla bla bla  SubRegion 5
bla bla bla  SubRegion 6





[web2py] is it possible to update the html using elements?

2011-10-06 Thread apple
web2py elements allows me to parse the dom; change attributes; and
insert elements. But is it possible to remove elements entirely or to
replace elements with new html?

e.g. I can hide the buttons in a grid by doing this:

pagination=grid.elements('.web2py_paginator')
if pagination:
pagination[0].update(_style="visibility:hidden")

But is there a way I could replace the buttons with some html
generated in web2py?



[web2py] Re: Would there be an advantage to having more discussion on Stackoverflow?

2011-10-06 Thread Anthony
Well, it's possible that at some point Google Groups will include Q&A 
functionality, as alluded to at the end of this 
announcement: 
https://groups.google.com/d/topic/googlegroups-announce/2ccywee6dE4/discussion.

The idea for the new web2pyslices.com was that it would include Q&A 
functionality as well, though not sure if/when to expect that.

As already noted, one benefit of SO is that it increases the public exposure 
of web2py. I try to monitor it and answer questions, but it's not quite as 
easy to stay on top of posts -- even though I'm following the "web2py" tag, 
it typically takes from several hours up to a full day before I receive 
email alerts about new questions posted.

Anthony

On Thursday, October 6, 2011 11:39:56 AM UTC-4, monotasker wrote:
>
> I may be different than others, but SO is usually the first place I go with 
> questions. I asked my first couple of web2py questions on SO and then was 
> steered here. Massimo seems to point people here quite deliberately when 
> they post questions on SO, and the web2py site (as well as the book) points 
> people here as *the* place for support and discussion. So I suspect that 
> simply stating that SO is the preferred forum for how-to and problem-solving 
> questions would largely do the trick.
>
> I do see what you mean about possibly dissipating answers. I guess the 
> issue would be having to watch two forums instead of one. I wonder whether 
> that's why Massimo has emphasized this group as a one-stop-shop--so that 
> it's a more manageable workflow for him. As the community grows, though, I 
> wonder whether a shift will actually help to reduce the "noise" of repeated 
> answers.
>
> Yes, it's easy to filter questions here. But I find that I still often have 
> to read through scores of answers before realizing that my particular 
> question hasn't been answered yet.
>


[web2py] Re: openid server

2011-10-06 Thread Anthony
Do you specifically need to create an openid server? If you just need some 
kind of central single sign-on solution, web2py now has built in CAS client 
and server functionality -- 
see http://web2py.com/book/default/chapter/08#Central-Authentication-Service.

Anthony

On Thursday, September 1, 2011 1:57:14 PM UTC-4, MB wrote:
>
> How i can build my own openid server for my w2p app? thank you!!!



[web2py] How to setup Web2py on live Linux server

2011-10-06 Thread miroslavgojic
I have server on my academic network on public IP address

On server now I use ClearOS linux and for my needs it is good.

Now I have intetion to install web2py on server, can I do this on
ClearOS or I must change linux
What linux for server should I use, does Centos can satisfied my
needs.

Is there some details what I must know before I put server with web2py
in online mode.

Is there some license agreement or fee for usage and explanation of
web2py on online servers

Because I have empty server without important content what is good
practice to make setup of server.



[web2py] Re: Many to many query with two left joins - how to do in Web2py?

2011-10-06 Thread Massimo Di Pierro
Why do you left join products if you do not select anything from it?

On Oct 6, 7:40 am, Cliff  wrote:
> Here is the model, simplified:
>
> db.define_table('purchase_orders',
>     Field('issue_date', 'date',
>           comment = SPAN(a_comment, _style='color:orange;')),
>     Field('number', length=24, requires=IS_NOT_EMPTY(),
>           required=True, notnull=True,
>           comment=SPAN('Required', _style='color:orange;')),
>     Field('closed', 'boolean', readable=False, writable=False,
> default=False),
>     format = '%(number)s'
>     )
> db.define_table( 'products',
>     Field('name', length=256, required=True, notnull=True),
>     Field('internal_item_number', length=36),
>     format = '%(name)s'
>     )
> db.define_table('purchase_order_products',
>     Field('purchase_order_id', db.purchase_orders),
>     Field('product_id', db.products),
>     Field('quantity', 'decimal(12,3)'),
>     )
>
> in SQL I can make this query:
> SELECT issue_date, number, name FROM purchase_orders LEFT JOIN
> purchase_order_products ON purchase_order_products.purchase_order_id =
> purchase_orders.id LEFT JOIN products ON
> purchase_order_products.product_id = products.id
>
> How do I do this in Web2py?


[web2py] Re: Form output format

2011-10-06 Thread miroslavgojic
Thank you, this was helpful for me.

In chroma developer tools is ease way to read code and it is sorted by
tags.

regards
Miroslav

On Oct 6, 12:02 pm, Anthony  wrote:
> On Thursday, October 6, 2011 3:46:04 AM UTC-4, miroslavgojic wrote:
>
> > For what need web2py use next code in form on end of form definition.
>
> > 
> > 
> > 
> > 
> > 
>
> These are hidden fields used by web2py to process submitted forms. _next is
> used by Auth to store the URL originally requested before a redirect to the
> login page -- Auth will redirect back to that URL after successful login.
> _formname stores the name of the form so web2py knows which form to process
> (necessary when there is more than one form on a page). _formkey is a unique
> key associated with a particular instance of a form and is also stored in
> the user session -- upon submission, the keys must match (this is to prevent
> double form submission and to protect against cross site request forgery
> attacks).
>
> Seehttp://web2py.com/book/default/chapter/07#Hidden-fields.
>
> Anthony


[web2py] Re: openid server

2011-10-06 Thread selecta
i'm on it so far the only implementation i have seen is 
https://bitbucket.org/bottiger/web2py-openid/overview but we cannot get it 
get it working :( 
tell me if you were more successful with something


[web2py] Re: Would there be an advantage to having more discussion on Stackoverflow?

2011-10-06 Thread monotasker
I may be different than others, but SO is usually the first place I go with 
questions. I asked my first couple of web2py questions on SO and then was 
steered here. Massimo seems to point people here quite deliberately when 
they post questions on SO, and the web2py site (as well as the book) points 
people here as *the* place for support and discussion. So I suspect that 
simply stating that SO is the preferred forum for how-to and problem-solving 
questions would largely do the trick.

I do see what you mean about possibly dissipating answers. I guess the issue 
would be having to watch two forums instead of one. I wonder whether that's 
why Massimo has emphasized this group as a one-stop-shop--so that it's a 
more manageable workflow for him. As the community grows, though, I wonder 
whether a shift will actually help to reduce the "noise" of repeated 
answers.

Yes, it's easy to filter questions here. But I find that I still often have 
to read through scores of answers before realizing that my particular 
question hasn't been answered yet.


[web2py] Re: Email Form

2011-10-06 Thread Anthony
The one associated with mail.settings.sender. web2py Mail assumes you have 
access to an smtp mail server and attempts to send an email from that 
server. In this case, you are sending email from your own Gmail account.

On Thursday, October 6, 2011 10:31:41 AM UTC-4, Web2Py Freak wrote:
>
> what user name and password ??



[web2py] Re: ajax function : None returned

2011-10-06 Thread Vineet
Hi juanduke !
Thanks for the tip.
It worked.
I will do some more complicated work on this now.

Cheers,
Vineet

On Oct 6, 5:03 pm, juanduke  wrote:
> Hi Vineet:
>
> You need to change this line;
>
>    
>
> for this line:
>
>    
>
> (change id='name' for name="name")
> HTH!!!
> Bye


[web2py] Web2py/modj/tomcat

2011-10-06 Thread Sergio
Hi folks,

I have successfully run web2py with jython, now I'd like to run it
from Tomcat using modj.
I ran into two problems so far:
 - web2py is looking for its version file in tomcat/bin. Why the hell?
 - my servlet "gets in the way". Let's say its address is
http://host:8080/myservlet/
When called without an app name, web2py will try to run the "welcome"
app, and redirects me to http://host:8080/welcome/default/index when
it should redirect me to http://host:8080/myservlet/welcome/default/index
instead. I have tried to play with routes_out to add the servlet's
name to the path but I couldn't get it to work. Any ideas?
TIA

Sergio


Re: [web2py] Re: Email Form

2011-10-06 Thread Manuele

On 06/10/2011 16:31, Web2Py Freak wrote:

what user name and password ??

the one of your gmail account


[web2py] Re: Email Form

2011-10-06 Thread Web2Py Freak
what user name and password ??


[web2py] Re: Email Form

2011-10-06 Thread Anthony
You need:

mail.settings.login = 'your_username:your_password'

Anthony

On Thursday, October 6, 2011 10:16:01 AM UTC-4, Web2Py Freak wrote:
>
> ok , but i want to use my gmail hassan...@gmail.com to send mail 
> so i did : 
>
> mail.settings.server ='smtp.gmail.com:587'  # your SMTP server 
> mail.settings.sender = 'hassan...@gmail.com' # your email 
> mail.settings.login = None   # your credentials or None 
>
>
> and : 
>
>  form=SQLFORM(db.blogcomments,separator=False) 
>   if form.accepts(request.vars,session): 
>   response.flash=response.flash_formsent 
>   mail.send(to=['hassan_...@hotmail.com'], subject='A blog 
> comment has been posted by ' + 
> form.vars.author,message=form.vars.comment) 
>   form=['Your Comment Has Been Made'] 
>   elif form.errors: 
>   response.flash=response.flash_formerror 
>   else: 
>   response.flash=response.flash_form 
>
>
>
>
> so what is wrong here ???



[web2py] Re: Email Form

2011-10-06 Thread Web2Py Freak
ok , but i want to use my gmail hassanalna...@gmail.com to send mail
so i did :

mail.settings.server ='smtp.gmail.com:587'  # your SMTP server
mail.settings.sender = 'hassanalna...@gmail.com' # your email
mail.settings.login = None   # your credentials or None


and :

 form=SQLFORM(db.blogcomments,separator=False)
  if form.accepts(request.vars,session):
  response.flash=response.flash_formsent
  mail.send(to=['hassan_alna...@hotmail.com'], subject='A blog
comment has been posted by ' +
form.vars.author,message=form.vars.comment)
  form=['Your Comment Has Been Made']
  elif form.errors:
  response.flash=response.flash_formerror
  else:
  response.flash=response.flash_form




so what is wrong here ???


[web2py] Re: Email Form

2011-10-06 Thread Anthony
Look at http://web2py.com/book/default/chapter/08#Auth-and-Mail for details 
on sending email.

You can create a regular form, and once the form is accepted, use the 
form.vars (i.e., email address, message body, etc.) to send an email as per 
the above instructions.

Anthony

On Thursday, October 6, 2011 9:34:36 AM UTC-4, Web2Py Freak wrote:
>
> Dear all , 
>
> can anyone tell me how can i make a email form to send to my email 
> am using webfaction for hosting  .. so tell me what to do ??



[web2py] Email Form

2011-10-06 Thread Web2Py Freak
Dear all ,

can anyone tell me how can i make a email form to send to my email
am using webfaction for hosting  .. so tell me what to do ??


Re: [web2py] Re: Overriding Grid/Smartgrid's 'Edit/Delete/View'

2011-10-06 Thread Javier Pepe
Hello

Along with the question of Johann, you can add new buttons to the grid
/ SmartGrid, because the links are render as links, and not as
buttons.

Thanks

On Thu, Oct 6, 2011 at 9:36 AM, apple  wrote:
> You can add your own buttons using:
>
> links = [lambda row: A('Edit',_href=URL("controller","edit",
> args=["update", tablename, a.id]))
>
> and set editable, deletable, details  to False.
>
>
> On Oct 6, 12:48 pm, Johann Spies  wrote:
>> How do I override the views/controllers  triggered by the buttons  mentioned
>> in the subject line when using SQLFORM.grid/smartgrid?
>>
>> Regards
>> Johann
>>
>> --
>>  May grace and peace be yours in abundance through the full knowledge of God
>> and of Jesus our Lord!  His divine power has given us everything we need for
>> life and godliness through the full knowledge of the one who called us by
>> his own glory and excellence.
>>                                                     2 Pet. 1:2b,3a


Re: [web2py] Re: Overriding Grid/Smartgrid's 'Edit/Delete/View'

2011-10-06 Thread Johann Spies
On 6 October 2011 14:36, apple  wrote:

> You can add your own buttons using:
>
> links = [lambda row: A('Edit',_href=URL("controller","edit",
> args=["update", tablename, a.id]))
>
> and set editable, deletable, details  to False.
>
>
>
Thanks!

Johann

-- 
 May grace and peace be yours in abundance through the full knowledge of God
and of Jesus our Lord!  His divine power has given us everything we need for
life and godliness through the full knowledge of the one who called us by
his own glory and excellence.
2 Pet. 1:2b,3a


[web2py] Many to many query with two left joins - how to do in Web2py?

2011-10-06 Thread Cliff
Here is the model, simplified:

db.define_table('purchase_orders',
Field('issue_date', 'date',
  comment = SPAN(a_comment, _style='color:orange;')),
Field('number', length=24, requires=IS_NOT_EMPTY(),
  required=True, notnull=True,
  comment=SPAN('Required', _style='color:orange;')),
Field('closed', 'boolean', readable=False, writable=False,
default=False),
format = '%(number)s'
)
db.define_table( 'products',
Field('name', length=256, required=True, notnull=True),
Field('internal_item_number', length=36),
format = '%(name)s'
)
db.define_table('purchase_order_products',
Field('purchase_order_id', db.purchase_orders),
Field('product_id', db.products),
Field('quantity', 'decimal(12,3)'),
)

in SQL I can make this query:
SELECT issue_date, number, name FROM purchase_orders LEFT JOIN
purchase_order_products ON purchase_order_products.purchase_order_id =
purchase_orders.id LEFT JOIN products ON
purchase_order_products.product_id = products.id

How do I do this in Web2py?


[web2py] Re: Overriding Grid/Smartgrid's 'Edit/Delete/View'

2011-10-06 Thread apple
You can add your own buttons using:

links = [lambda row: A('Edit',_href=URL("controller","edit",
args=["update", tablename, a.id]))

and set editable, deletable, details  to False.


On Oct 6, 12:48 pm, Johann Spies  wrote:
> How do I override the views/controllers  triggered by the buttons  mentioned
> in the subject line when using SQLFORM.grid/smartgrid?
>
> Regards
> Johann
>
> --
>  May grace and peace be yours in abundance through the full knowledge of God
> and of Jesus our Lord!  His divine power has given us everything we need for
> life and godliness through the full knowledge of the one who called us by
> his own glory and excellence.
>                                                     2 Pet. 1:2b,3a


[web2py] Re: Cannot Register at wiki.web2py.com. Invalid Password

2011-10-06 Thread Anthony
Don't bother -- that wiki has not been maintained for a long time. Use the 
book and www.web2pyslices.com.

On Thursday, October 6, 2011 7:30:06 AM UTC-4, zanyzebra wrote:
>
> Hello Fellow users and administrators, 
>
> I was trying to register on the web2py wiki today, but could not. The 
> password field keeps giving me a "invalid" error. What are the 
> requirements for  a password. I have tried using alphanumeric with 
> special characters, with length of over 10 letters, but to no avail. 
>
> What is the issue?



[web2py] Cannot serve any pages after fresh install of Python2.5

2011-10-06 Thread Peter G.
I had a clean install of Ubuntu 11.04 + Python 2.7.1 running web2py
and it was working fine. Then I installed Python 2.5.6 by source,
tried visiting http://127.0.0.1:8000/ and I get the following errors
via Terminal:
DEBUG_c: Exception (,
AttributeError("'NoneType' object has no attribute
'PARSE_DECLTYPES'",))

This is printed 5 times (I guess it tries the connect 5 times).

In the admin interface through ticket system, I see the following:
TRACEBACK:
Traceback (most recent call last):
  File "/home/pyg/web2py/gluon/restricted.py", line 194, in restricted
exec ccode in environment
  File "/home/pyg/web2py/applications/examples/models/db.py", line 18,
in 
db = DAL('sqlite://storage.sqlite')
  File "/home/pyg/web2py/gluon/dal.py", line 4156, in __init__
raise RuntimeError, "Failure to connect, tried %d times:\n%s" %
(attempts, error)
RuntimeError: Failure to connect, tried 5 times:
'NoneType' object has no attribute 'PARSE_DECLTYPES'

In file: /home/pyg/web2py/applications/examples/models/db.py

I'm completely new to web2py (and still a relative newbie to Linux),
so I'm not exactly sure what the problem could be. Of course, I did a
quick google, but turned up nothing useful. The only thing related to
PARSE_DECLTYPES was another post in this exact usergroup, but it was a
completely different issue.

Thanks for any potential insight anyone can provide :)!


[web2py] Cannot Register at wiki.web2py.com. Invalid Password

2011-10-06 Thread zanyzebra
Hello Fellow users and administrators,

I was trying to register on the web2py wiki today, but could not. The
password field keeps giving me a "invalid" error. What are the
requirements for  a password. I have tried using alphanumeric with
special characters, with length of over 10 letters, but to no avail.

What is the issue?


[web2py] Re: ajax function : None returned

2011-10-06 Thread juanduke
Hi Vineet:

You need to change this line;

   

for this line:

   

(change id='name' for name="name")
HTH!!!
Bye



[web2py] ajax function : None returned

2011-10-06 Thread Vineet
I was studying ajax function.
Exactly reproduced the code from web2py book.
=default/one.html
{{extend 'layout.html'}}





==default.py===
def one():
  return dict()

def echo():
  return request.vars.name


After typing anything in the input box, "None" is displayed in the
target div.

Whether any correction is required in this code?

Thanks,
Vineet


[web2py] Room and Resource Reservation

2011-10-06 Thread António Ramos
Hello, i´d like to suggest this app

Room and Resource(auto, projector etc) Reservation with a nice callendar
like fullcalendar.

IT think it would be very usefull for an intranet use

Does anyone have something like this in web2py?


[web2py] Overriding Grid/Smartgrid's 'Edit/Delete/View'

2011-10-06 Thread Johann Spies
How do I override the views/controllers  triggered by the buttons  mentioned
in the subject line when using SQLFORM.grid/smartgrid?

Regards
Johann

-- 
 May grace and peace be yours in abundance through the full knowledge of God
and of Jesus our Lord!  His divine power has given us everything we need for
life and godliness through the full knowledge of the one who called us by
his own glory and excellence.
2 Pet. 1:2b,3a


[web2py] Re: Sending Email Under Linux

2011-10-06 Thread MidGe


"If 'smtp.broadband.rogers.com:25' works under Windows, why the hell 

wouldn't it work under Linux?? Oh well."


Maybe because windows runs a  'smtp.broadband.rogers.com:25' 
whereas Linux has not set such a server by default?!

 



[web2py] Re: Sending Email Under Linux

2011-10-06 Thread horridohobbyist
It would seem that Postfix is configured correctly after all. The
problem seems to be the server I've chosen -- 'smtp.gmail.com:587'
works, but 'smtp.broadband.rogers.com:25' doesn't. WTF.

If 'smtp.broadband.rogers.com:25' works under Windows, why the hell
wouldn't it work under Linux?? Oh well.

Richard

On Oct 6, 2:53 am, Johann Spies  wrote:
> On 6 October 2011 06:42, pbreit  wrote:
>
> > Check /var/log/mail.log
>
> > You might want to review Postfix install instructions for your version of
> > Linux. The Linode help docs are usually really good:
> >http://library.linode.com/email/postfix/gateway-ubuntu-10.10-maverick
>
> > But I think this Ubuntu one might be more helpful:
> >https://help.ubuntu.com/community/Postfix
>
> > The server name is going to be your server's name. As suggested, try
> > running:
>
> > sudo dpkg-reconfigure postfix
>
> Once your postfix is correctly configured, you can configure web2py to
> deliver to locallhost.  Then postfix will handle the email from there.
>
> Regards
> Johann
>
> --
>  May grace and peace be yours in abundance through the full knowledge of God
> and of Jesus our Lord!  His divine power has given us everything we need for
> life and godliness through the full knowledge of the one who called us by
> his own glory and excellence.
>                                                     2 Pet. 1:2b,3a


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

2011-10-06 Thread Anthony
On Thursday, October 6, 2011 3:15:41 AM UTC-4, guruyaya wrote:
>
> Hummm... multiple databases won't work this way.
>

Can add the db as a request argument -- something like:

@auth.requires_membership('admin')
def appadmin():
db = globals().get(request.args(0))
if db and isinstance(db, DAL):
return dict(form=SQLFORM.grid(db[request.args(1)]))
else:
session.flash = T('no such database: %s', (db,))
redirect(URL('index'))

 

>
> On Aug 18, 7:28 pm, Massimo Di Pierro  
> wrote: 
> > basically we almost get rid of appadmin completely and just do 
> > 
> > @auth.requires_membership('admin') 
> > def appadmin(): 
> >  return dict(form=SQLFORM.grid(db[request.args(0)])) 
> > 
>


[web2py] Re: On demond migrations

2011-10-06 Thread Anthony
You could do something like this:

DEVMODE = request.is_local
db = DAL(..., migrate_enabled=DEVMODE)

When the migrate_enabled argument to DAL() is set to False, all migrations 
are disabled (regardless of the 'migrate' setting for each individual 
define_table() call). You can either change it manually on production, or 
use some test to determine whether the app is running in the production 
environment (the above example turns migrations on only when the request is 
from the local machine).

Anthony

On Thursday, October 6, 2011 3:34:50 AM UTC-4, guruyaya wrote:
>
> Let me start by saying that I LOVE migrations. It makes development so 
> much easier. For me, it's the number 1 web2py killer feature: the fact 
> I don't have to think of databses while developing. 
> But in a production enviroment, migrations takes time and reasources. 
> I wouldn't want to run migration on each request. So with every 
> production change, I have to turn on migrations, go over my apps, and 
> then turn it off. 
> Is there a way to make migrations run from a script, even if migration 
> is set to false? 
> Thanks in advance 
> Yair



[web2py] Re: Form output format

2011-10-06 Thread Anthony
On Thursday, October 6, 2011 3:46:04 AM UTC-4, miroslavgojic wrote:
>
> For what need web2py use next code in form on end of form definition. 
>
>  
>  
>  
>  
> 
>

These are hidden fields used by web2py to process submitted forms. _next is 
used by Auth to store the URL originally requested before a redirect to the 
login page -- Auth will redirect back to that URL after successful login. 
_formname stores the name of the form so web2py knows which form to process 
(necessary when there is more than one form on a page). _formkey is a unique 
key associated with a particular instance of a form and is also stored in 
the user session -- upon submission, the keys must match (this is to prevent 
double form submission and to protect against cross site request forgery 
attacks).

See http://web2py.com/book/default/chapter/07#Hidden-fields.

Anthony


Re: [web2py] Re: Form output format

2011-10-06 Thread Miroslav Gojic
You have right, Chroma developer toll is better than Firefox addons




On Thu, Oct 6, 2011 at 10:56, Farsheed Ashouri
wrote:

> Chrome development tools is way better than firebug in my experience.
>
>
> On Thursday, October 6, 2011, miroslavgojic wrote:
>
>> Hi,
>>
>> I know for firebug and mozilla addons, and I use them.
>>
>> I try to use CDUR, crud.settings.formstyle = ('divs') and it is work
>> after some figuring out how to get that work
>>
>> I don't see problem to make form in more lines, just put CR (\n) or
>> what is notation for new line in python/web2py environment.
>>
>> But with divs I can finish my needs, in one or more lines is not so
>> important.
>>
>> For what need web2py use next code in form on end of form definition.
>>
>> 
>> 
>> 
>> 
>> 
>>
>> Thanks for help.
>>
>> On Oct 5, 11:11 pm, juanduke  wrote:
>> > Hi miroslavgojic:
>> >
>> > To see html and other things like css, javascript I recomend you use
>> firebug
>> > (a firefox addon) or similar in chrome (getfirebug.com)
>> > Other firefox addon (only useful to see html only) is: view source
>> chart.
>> > Both firebug and view source chart can be found in addons.mozilla.com
>> >
>> > To change the table of the form (generated) please see this (from the
>> > book:[SQLForm Chapter]
>> http://www.web2py.com/book/default/chapter/07?search=form+style):
>> > formstyle determines the style to be used when serializing the form in
>> html.
>> > It can be "table3cols" (default), "table2cols" (one row for label and
>> > comment, and one row for input), "ul" (makes an unordered list of input
>> > fields), "divs" (represents the form using css friendly divs, for
>> arbitrary
>> > customization). formstyle can also be a function that takes (record_id,
>> > field_label, field_widget, field_comment) as attributes and returns a
>> TR()
>> > object.
>> >
>> > HTH
>> >
>> > Bye
>
>
>
> --
> Sincerely,
> Farsheed Ashouri,
> ourway.ir
> Tel: +98 9388801504
>
>


Re: [web2py] Re: Form output format

2011-10-06 Thread Farsheed Ashouri
Chrome development tools is way better than firebug in my experience.

On Thursday, October 6, 2011, miroslavgojic wrote:

> Hi,
>
> I know for firebug and mozilla addons, and I use them.
>
> I try to use CDUR, crud.settings.formstyle = ('divs') and it is work
> after some figuring out how to get that work
>
> I don't see problem to make form in more lines, just put CR (\n) or
> what is notation for new line in python/web2py environment.
>
> But with divs I can finish my needs, in one or more lines is not so
> important.
>
> For what need web2py use next code in form on end of form definition.
>
> 
> 
> 
> 
> 
>
> Thanks for help.
>
> On Oct 5, 11:11 pm, juanduke > wrote:
> > Hi miroslavgojic:
> >
> > To see html and other things like css, javascript I recomend you use
> firebug
> > (a firefox addon) or similar in chrome (getfirebug.com)
> > Other firefox addon (only useful to see html only) is: view source chart.
> > Both firebug and view source chart can be found in addons.mozilla.com
> >
> > To change the table of the form (generated) please see this (from the
> > book:[SQLForm Chapter]
> http://www.web2py.com/book/default/chapter/07?search=form+style):
> > formstyle determines the style to be used when serializing the form in
> html.
> > It can be "table3cols" (default), "table2cols" (one row for label and
> > comment, and one row for input), "ul" (makes an unordered list of input
> > fields), "divs" (represents the form using css friendly divs, for
> arbitrary
> > customization). formstyle can also be a function that takes (record_id,
> > field_label, field_widget, field_comment) as attributes and returns a
> TR()
> > object.
> >
> > HTH
> >
> > Bye



-- 
Sincerely,
Farsheed Ashouri,
ourway.ir
Tel: +98 9388801504


[web2py] [SOLVED] how to do db administration of default auth tables?

2011-10-06 Thread stefaan
Near the top of the scaffolding application, it said:

db = DAL('sqlite://storage.sqlite')

Near the bottom of the application i had copied from my old
application the following:

db = SQLDB('sqlite://db.db')


So the variable db was used twice to indicate different tables.
I have no idea now how authentication could ever work like that...




[web2py] Re: Would there be an advantage to having more discussion on Stackoverflow?

2011-10-06 Thread pbreit
On one hand, that might be beneficial. On the other, it may dissipate and 
slow down answers. How do you really steer people there anyway?

[web2py] Re: Form output format

2011-10-06 Thread miroslavgojic
Hi,

I know for firebug and mozilla addons, and I use them.

I try to use CDUR, crud.settings.formstyle = ('divs') and it is work
after some figuring out how to get that work

I don't see problem to make form in more lines, just put CR (\n) or
what is notation for new line in python/web2py environment.

But with divs I can finish my needs, in one or more lines is not so
important.

For what need web2py use next code in form on end of form definition.







Thanks for help.

On Oct 5, 11:11 pm, juanduke  wrote:
> Hi miroslavgojic:
>
> To see html and other things like css, javascript I recomend you use firebug
> (a firefox addon) or similar in chrome (getfirebug.com)
> Other firefox addon (only useful to see html only) is: view source chart.
> Both firebug and view source chart can be found in addons.mozilla.com
>
> To change the table of the form (generated) please see this (from the
> book:[SQLForm 
> Chapter]http://www.web2py.com/book/default/chapter/07?search=form+style):
> formstyle determines the style to be used when serializing the form in html.
> It can be "table3cols" (default), "table2cols" (one row for label and
> comment, and one row for input), "ul" (makes an unordered list of input
> fields), "divs" (represents the form using css friendly divs, for arbitrary
> customization). formstyle can also be a function that takes (record_id,
> field_label, field_widget, field_comment) as attributes and returns a TR()
> object.
>
> HTH
>
> Bye


  1   2   >