[web2py] Re: zengarden anybody?

2010-03-20 Thread Yarko Tymciurak
On Mar 20, 8:27 pm, mdipierro  wrote:
> Just for fun:
>
>    http://web2py.com/zengarden
>
> then click on the [zengarden] link under the menu, under the "index"
> link. You can change the skin per user, per session.
> This is a bare bone welcome app with the layout

:-)  Lvely!!! :-)

>
>    http://web2py.com/zengarden/static/layout.html
>
> Problem: all zengarden layouts hardcode text in images for each skin.

Yeah - that's not _really_ a problem for us...  the "layouts" we can
parse;  the css we can include;
> This makes them not as general as we need them.
> It makes it more of a proof of concept than a useful tool
> unfortunately.

Actually, it's potentially a good proof of concept - by us shifting to
css-based (away from table, html based layout)  we are entering new,
nice spaces.

The fact that zengarden (for example) has provided a "template" css
and html files, which contain "more than you'll use" - what they've
effectively done (for graphics artists, non-programming designers) is
made this tractable.  For us, what this does is provide an example of
a namespace - we can look at what others do, and adopt / adapt, or
design a namespace based on their example.

It would make sense (as an excercise) to try to automate their css
names, and see if there are useful rules we can develope to actually
make something usefully skinnable...

(I'm likely to try this, just because of my surprise of how trivial /
easy esy-css was;  my experience with yahoo frames, other such
solutions left me... with more to digest / think about than I cared to
for layout)


>
> Other problem: some layouts are broken because assume a few divs that
> we do not have.

Well, that's the first thing we can do:  find a compatible class / id
set in our "base" css;  I think I'll play around w/ this, perhaps
tomorrow... first to try compatability w/ zengarden (just as an
excercise, if nothing else).

The second step will be to name, and programmatically output sections
- to see how that works;

The third will probably be to catalog use, so you can tell what web2py
applications "use" from the css set (since many skins are necessarily
a subset).

Fun awaits! :-)

- Yarko

>
> Massimo
>
> On Mar 20, 7:18 pm, Thadeus Burgess  wrote:
>
> > Well... the quickest way to change layouts is to store the
> > configuration in the database...
>
> > So have a table for web2py meta information, that contains
> > "current_layout" which is value is "layout.html" or "mynewlayout.html"
> > etc etc.
>
> > In all views instead of {{ extend "layout.html" }} it will be {{
> > extend current_layout }}. Then do the same with the CSS as well.
>
> > {{ response.files.append(my_current_css) }}
>
> > Cache these variables in RAM to save from un-necessary dbio
>
> > -Thadeus
>
> > On Sat, Mar 20, 2010 at 5:11 PM, Yarko Tymciurak
>
> >  wrote:
> > > Having said this, the zengarden shows how to accomplish some standard
> > > naming, and now to switch css to affect things
>
> > > That by itself is quite useful - and worth (for me at least) more
> > > closely...
>
> > > On Mar 20, 1:53 pm, Thadeus Burgess  wrote:
> > >> I envision having an app create wizard, you select a layout (based on
> > >> ez-css), and then select a skin for the layout. :)
>
> > >> -Thadeus
>
> > >> On Sat, Mar 20, 2010 at 1:50 PM, mr.freeze  wrote:
> > >> > I think the ability to select a skin when creating an app would be a
> > >> > major plus and help kick-start development for the design-impaired
> > >> > such as myself.
>
> > >> > On Mar 20, 1:32 pm, mdipierro  wrote:
> > >> >> I just came across this:
>
> > >> >>    http://www.csszengarden.com/
>
> > >> >> It is one simple html layout (only divs) with 210 PURE CSS skins:
>
> > >> >>    http://www.mezzoblue.com/zengarden/alldesigns/
>
> > >> >> This could be an option for the welcome app. If we use their html, it
> > >> >> would be trivial to add a small admin option that downloads a team to
> > >> >> zengarden and applies to skin. Options that require overriding the
> > >> >> HTML are more complex to handle.
>
> > >> >> What do you think?
>
> > >> >> Massimo
>
> > >> > --
> > >> > You received this message because you are subscribed to the Google 
> > >> > Groups "web2py-users" group.
> > >> > To post to this group, send email to web...@googlegroups.com.
> > >> > To unsubscribe from this group, send email to 
> > >> > web2py+unsubscr...@googlegroups.com.
> > >> > For more options, visit this group 
> > >> > athttp://groups.google.com/group/web2py?hl=en.
>
> > > --
> > > You received this message because you are subscribed to the Google Groups 
> > > "web2py-users" group.
> > > To post to this group, send email to web...@googlegroups.com.
> > > To unsubscribe from this group, send email to 
> > > web2py+unsubscr...@googlegroups.com.
> > > For more options, visit this group 
> > > athttp://groups.google.com/group/web2py?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To 

[web2py] Re: problem to use database

2010-03-20 Thread mr.freeze
db = DAL('mysql://root:r...@localhost/usbdv',pool_size=20)
vul=DAL('mysql://root:r...@localhost/sbdv',pool_size=20)

They're different. Does he need to do fake_migrate to make the .table
files?


On Mar 20, 10:23 pm, mdipierro  wrote:
> I do not understand. db and vui connect to the same database. why not
> "vui=db"? Are they defined in two different applications? If they are
> defined in the same applications db and vui should be the same
> connections else they will not see each other tables.
>
> On Mar 20, 8:38 pm, kike  wrote:
>
> > I have two databases, the first was created by auth, and the second is
> > a database with 14 tables, created previusly.
>
> > Traceback (most recent call last):
> >   File "/home/kike/sbdv/web2py/gluon/restricted.py", line 173, in
> > restricted
> >   File "/home/kike/Desktop/web2py/applications/SBDV/models/db.py",
> > line 58, in 
> >     Field('second_preference', vul.object_products, label='Preferencia
> > Secundaria'))
> >   File "/home/kike/sbdv/web2py/gluon/sql.py", line 1270, in
> > define_table
> >   File "/home/kike/sbdv/web2py/gluon/sql.py", line 1540, in
> > _create_references
> > SyntaxError: Table: table "object_vendors" does not exist
>
> > this is my code:
>
> > db = DAL('mysql://root:r...@localhost/usbdv',pool_size=20)
>
> > from gluon.tools import *
> > auth=Auth(globals(),db)
> > auth.settings.hmac_key='sha512:582aedbf-4d01-4f41-81ad-ffb7eed2ada4'
> > auth_table=db.define_table(
> >     auth.settings.table_user_name,
> >     Field('first_name', length=128, label='Nombre(s)'),
> >     Field('last_name', length=128, label='Apellidos'),
> >     Field('email', length=128, unique=True, label='Correo'),
> >     Field('password', 'password', length=256, readable=False,
> > label='Contraseña'),
> >     Field('registration_key', length=128, writable=False,
> > readable=False),
> >     Field('preference', vul.object_vendors, label='Preferencia
> > Principal'),
> >     Field('second_preference', vul.object_products, label='Preferencia
> > Secundaria'))
> >                              # creates all needed tables
>
> > auth_table.first_name.requires=IS_NOT_EMPTY()
> > auth_table.last_name.requires=IS_NOT_EMPTY()
> > auth_table.password.requires=[CRYPT()]
> > auth_table.email.requires=[IS_EMAIL(), IS_NOT_IN_DB(db,
> > auth_table.email)]
> > auth_table.preference.requires=IS_IN_DB(vul,'object_vendors.id','object_vendors.name')
> > auth_table.second_preference=IS_IN_DB(vul,'object_products.id','object_products.name')
> > auth.settings.table_user=auth_table
> > auth.define_tables()
>
> > and this is my declaration for the second databases(previusly
> > created):
>
> > vul=DAL('mysql://root:r...@localhost/sbdv',pool_size=20)
>
> > vul.define_table('object_vendors', migrate=False)
> > vul.define_table('object_products', migrate=False)
> > vul.define_table('object_versions', migrate=False)
> > vul.define_table('object_correlations', migrate=False)
> > vul.define_table('object_affect_types', migrate=False)
> > vul.define_table('object_links', migrate=False)
> > vul.define_table('vulnerabilities', migrate=False)
> > vul.define_table('credits', migrate=False)
> > vul.define_table('authors', migrate=False)
> > vul.define_table('ext_reference_types', migrate=False)
> > vul.define_table('ext_references', migrate=False)
> > vul.define_table('classification_types', migrate=False)
> > vul.define_table('classification_items', migrate=False)
> > vul.define_table('classifications', migrate=False)
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: web2py beautification

2010-03-20 Thread Yarko Tymciurak


On Mar 20, 6:57 pm, Pepe  wrote:
> Hello,
>
> i'm designer and before of that a human being, so i wonder: why make
> web2py less human readable?
>
> what's "ez-negmr" "ez-50"??

ez:  the prefix that identifies it as ez-css;

negmr, as Thadeus correctly pouinted out, is negative margin, and 50
is 50%;

By comparison, web2py base.css has width10em  (for example) - while
this is "more readable", that kind of readability is only suitable for
really simple things (width50em, after all, describes just ONE css
setting!!!).

Thadeus also pointed out - there are so, so few of the ez-css, and
they are short for some reason:  makes it easy to combine severall
classes in one div / span.

Anyway, in practice, after doing one layout, I was surprised at how
comfortable, easy it was.   So (the truth comes out!) I "told" Massimo
I'd "done" welcome in ez-css (I was sure it was trivial) --- when he
asked me to send it to him, it was a very, very short time to do (and
- if you look at the diff from Massimo's checkin, it really was a
trivial change!  that is a _good_ sign!).

Regards,
- Yarko

>
> the semantic of the most css framework is a problem, because they
> haven't.
>
> ...On the other hand:
> To have fewer elements is simpler to understand when you start to
> learn and use something new.
> To have a simple layout, without images, without a heavy css ... etc.
> I think it's better, perhaps more ugly, but faster to learn.
> Less elements = less uncertainty. This encourages the learning
> process.
>
> well, it's just what I think.
>
> Greetings!
>
> Pepe.
>
> On Mar 20, 1:25 pm, mdipierro  wrote:
>
> > Yarko did it! The new welcome with ez.css is in trunk. We still need
> > do add something to allow skinning and rearrange the css (right now we
> > have:
>
> > applications/welcome/static/base.css
> > applications/welcome/static/calendar.css
> > applications/welcome/static/ez-plug-min.css
> > applications/welcome/static/ez-plug.css
>
> > massimo
>
> > On Mar 19, 6:05 pm, Yarko Tymciurak 
> > wrote:
>
> > > On Mar 19, 2:24 am, mdipierro  wrote:
>
> > > > I played with ez-css (which I like) but yet it reminded why I used
> > > > tables.
>
> > > Yeah - the presence of tables in the layout really causes troubles!
>
> > > > Here is my problem and I am sure it is just me being dumb. Say
> > > > I want a header, a footer and two columns in between. I want the left
> > > > column of fixed with (a menu, 200px) and a right column to foll the
> > > > rest of the space (content). Because of the way it works (and most of
> > > > these frameworks work the same way), the columns float to right
> > > > therefore I must specifycontent before the menu. Hence I cannot find a
> > > > way to make the menu fixed width and the content fill the rest of the
> > > > space without messing up the alignment of the boxes. Can you do it?
>
> > > If I understand you, I think this is pretty easy w/ ez-css.   I have
> > > now done a few layouts w/ it in web2py (as of last night), and have
> > > sent you an ez-css layout.html for "welcome" app (it uses the css
> > > classes from base.css, but a few settings that were assigned to table
> > > elements, I had to update / put elsewhere - base.css has minor
> > > changes;  ez-plug.css remains stock).
>
> > > There are probably other things that could be cleaned up in base.css,
> > > but this was pretty easy (once I realized how to go about it).
>
> > > - Yarko
>
> > > > Massimo
>
> > > > On Mar 18, 11:46 pm, Yarko Tymciurak 
> > > > wrote:
>
> > > > > On Mar 18, 10:31 pm, mdipierro  wrote:
>
> > > > > > The problem I see is that it is too simple.
> > > > > > sizeXofY does not seem to guarantee that all columns have the same
> > > > > > lenght (ez-css does it).
> > > > > > I like to have the menu column fixed width and the main column 
> > > > > > elastic
> > > > > > and it does not do that (not sure if ez-css does).
>
> > > > > I have installed ez-css to try out / play with...  it does do fixed
> > > > > width + variable width columns:
>
> > > > > In multiple ways, actually (depending on how you nest it);   
> > > > > seehttp://www.ez-css.org/layouts
>
> > > > > See module 2A, 2B, layout 2, layout 3, etc
>
> > > > > Each of these use "ez-50", a 50% width element, or "ez-33", a 33%
> > > > > width element.
>
> > > > > ez-css encourages you to create your own width element if the pre-
> > > > > defined ones don't "do it" for you - so, create a
> > > > > ez-500px, and you'd have what you want.
>
> > > > > This seems like a really clean, easily modifiable and "combinable"
> > > > > package...  I'm going to play with it in the next few days to see how
> > > > > my opinion holds up in use.
>
> > > > > - Yarko
>
> > > > > > On Mar 18, 8:59 pm, villas  wrote:
>
> > > > > > > Ez-css seems like a good enough option,  but before making your 
> > > > > > > mind
> > > > > > > up, have a look at the simplicity of oocss.org/grids_docs.html 
> > > > > > > (with
> > > > > > > Firebug).  Oocss might give more possibiliti

[web2py] Re: problem to use database

2010-03-20 Thread mdipierro
I do not understand. db and vui connect to the same database. why not
"vui=db"? Are they defined in two different applications? If they are
defined in the same applications db and vui should be the same
connections else they will not see each other tables.

On Mar 20, 8:38 pm, kike  wrote:
> I have two databases, the first was created by auth, and the second is
> a database with 14 tables, created previusly.
>
> Traceback (most recent call last):
>   File "/home/kike/sbdv/web2py/gluon/restricted.py", line 173, in
> restricted
>   File "/home/kike/Desktop/web2py/applications/SBDV/models/db.py",
> line 58, in 
>     Field('second_preference', vul.object_products, label='Preferencia
> Secundaria'))
>   File "/home/kike/sbdv/web2py/gluon/sql.py", line 1270, in
> define_table
>   File "/home/kike/sbdv/web2py/gluon/sql.py", line 1540, in
> _create_references
> SyntaxError: Table: table "object_vendors" does not exist
>
> this is my code:
>
> db = DAL('mysql://root:r...@localhost/usbdv',pool_size=20)
>
> from gluon.tools import *
> auth=Auth(globals(),db)
> auth.settings.hmac_key='sha512:582aedbf-4d01-4f41-81ad-ffb7eed2ada4'
> auth_table=db.define_table(
>     auth.settings.table_user_name,
>     Field('first_name', length=128, label='Nombre(s)'),
>     Field('last_name', length=128, label='Apellidos'),
>     Field('email', length=128, unique=True, label='Correo'),
>     Field('password', 'password', length=256, readable=False,
> label='Contraseña'),
>     Field('registration_key', length=128, writable=False,
> readable=False),
>     Field('preference', vul.object_vendors, label='Preferencia
> Principal'),
>     Field('second_preference', vul.object_products, label='Preferencia
> Secundaria'))
>                              # creates all needed tables
>
> auth_table.first_name.requires=IS_NOT_EMPTY()
> auth_table.last_name.requires=IS_NOT_EMPTY()
> auth_table.password.requires=[CRYPT()]
> auth_table.email.requires=[IS_EMAIL(), IS_NOT_IN_DB(db,
> auth_table.email)]
> auth_table.preference.requires=IS_IN_DB(vul,'object_vendors.id','object_vendors.name')
> auth_table.second_preference=IS_IN_DB(vul,'object_products.id','object_products.name')
> auth.settings.table_user=auth_table
> auth.define_tables()
>
> and this is my declaration for the second databases(previusly
> created):
>
> vul=DAL('mysql://root:r...@localhost/sbdv',pool_size=20)
>
> vul.define_table('object_vendors', migrate=False)
> vul.define_table('object_products', migrate=False)
> vul.define_table('object_versions', migrate=False)
> vul.define_table('object_correlations', migrate=False)
> vul.define_table('object_affect_types', migrate=False)
> vul.define_table('object_links', migrate=False)
> vul.define_table('vulnerabilities', migrate=False)
> vul.define_table('credits', migrate=False)
> vul.define_table('authors', migrate=False)
> vul.define_table('ext_reference_types', migrate=False)
> vul.define_table('ext_references', migrate=False)
> vul.define_table('classification_types', migrate=False)
> vul.define_table('classification_items', migrate=False)
> vul.define_table('classifications', migrate=False)

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: zengarden anybody?

2010-03-20 Thread Thadeus Burgess
Nice :)

-Thadeus





On Sat, Mar 20, 2010 at 8:27 PM, mdipierro  wrote:
> Just for fun:
>
>   http://web2py.com/zengarden
>
> then click on the [zengarden] link under the menu, under the "index"
> link. You can change the skin per user, per session.
> This is a bare bone welcome app with the layout
>
>   http://web2py.com/zengarden/static/layout.html
>
> Problem: all zengarden layouts hardcode text in images for each skin.
> This makes them not as general as we need them.
> It makes it more of a proof of concept than a useful tool
> unfortunately.
>
> Other problem: some layouts are broken because assume a few divs that
> we do not have.
>
> Massimo
>
>
> On Mar 20, 7:18 pm, Thadeus Burgess  wrote:
>> Well... the quickest way to change layouts is to store the
>> configuration in the database...
>>
>> So have a table for web2py meta information, that contains
>> "current_layout" which is value is "layout.html" or "mynewlayout.html"
>> etc etc.
>>
>> In all views instead of {{ extend "layout.html" }} it will be {{
>> extend current_layout }}. Then do the same with the CSS as well.
>>
>> {{ response.files.append(my_current_css) }}
>>
>> Cache these variables in RAM to save from un-necessary dbio
>>
>> -Thadeus
>>
>> On Sat, Mar 20, 2010 at 5:11 PM, Yarko Tymciurak
>>
>>  wrote:
>> > Having said this, the zengarden shows how to accomplish some standard
>> > naming, and now to switch css to affect things
>>
>> > That by itself is quite useful - and worth (for me at least) more
>> > closely...
>>
>> > On Mar 20, 1:53 pm, Thadeus Burgess  wrote:
>> >> I envision having an app create wizard, you select a layout (based on
>> >> ez-css), and then select a skin for the layout. :)
>>
>> >> -Thadeus
>>
>> >> On Sat, Mar 20, 2010 at 1:50 PM, mr.freeze  wrote:
>> >> > I think the ability to select a skin when creating an app would be a
>> >> > major plus and help kick-start development for the design-impaired
>> >> > such as myself.
>>
>> >> > On Mar 20, 1:32 pm, mdipierro  wrote:
>> >> >> I just came across this:
>>
>> >> >>    http://www.csszengarden.com/
>>
>> >> >> It is one simple html layout (only divs) with 210 PURE CSS skins:
>>
>> >> >>    http://www.mezzoblue.com/zengarden/alldesigns/
>>
>> >> >> This could be an option for the welcome app. If we use their html, it
>> >> >> would be trivial to add a small admin option that downloads a team to
>> >> >> zengarden and applies to skin. Options that require overriding the
>> >> >> HTML are more complex to handle.
>>
>> >> >> What do you think?
>>
>> >> >> Massimo
>>
>> >> > --
>> >> > You received this message because you are subscribed to the Google 
>> >> > Groups "web2py-users" group.
>> >> > To post to this group, send email to web...@googlegroups.com.
>> >> > To unsubscribe from this group, send email to 
>> >> > web2py+unsubscr...@googlegroups.com.
>> >> > For more options, visit this group 
>> >> > athttp://groups.google.com/group/web2py?hl=en.
>>
>> > --
>> > You received this message because you are subscribed to the Google Groups 
>> > "web2py-users" group.
>> > To post to this group, send email to web...@googlegroups.com.
>> > To unsubscribe from this group, send email to 
>> > web2py+unsubscr...@googlegroups.com.
>> > For more options, visit this group 
>> > athttp://groups.google.com/group/web2py?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to 
> web2py+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/web2py?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: AutocompleteWidget on multiple forms on the same page

2010-03-20 Thread mdipierro
It should work with multiple fields as long they have different
names.

On Mar 20, 8:41 pm, Tito Garrido  wrote:
> Hi,
>
> I've created several forms using LOAD function... These forms has 1 field
> using AutocompleteWidget but this widget only works if there is just 1 form
> on the page...
>
> Is that expected?
>
> Regards,
>
> Tito
>
> --
>
> Linux User #387870
> .
>  _/_õ|__|
> ..º[ .-.___.-._| . . . .
> .__( o)__( o).:___

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: Joomla Templates

2010-03-20 Thread mdipierro
That appliance is very old and turned out not to be very popular. It
can only partially convert joomla templates. You still need to work on
them manually. It only works on some templates.

On Mar 20, 8:53 pm, Al  wrote:
> I have tried to beautify my application with some standard template. I
> cannot get the "Joomla Template" appliance to work, nor does the
> instructions in the following seem to work:
>
> http://www.web2py.com/AlterEgo/default/show/167
>
> I was testing the a Joomla 1.5 template from 
> here:http://joomportal.com/download-2069.html
>
> Could  anyone share how they incorporate such templates or any other
> compatible ones into web2py?
>
> Al

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: benchmarking: rocket vs pound with four rockets

2010-03-20 Thread mdipierro
There may be because of the extra logic for parsing http headers,
looking for models, controllers, views etc.
I do not know. It would be nice to quantify the web2py overhead.

Massimo


On Mar 20, 8:57 pm, Kuba Kucharski  wrote:
> you expect overhead from this? ;)
>
> def benchmark2():
>
>    return dict(data="test")

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: benchmarking: rocket vs pound with four rockets

2010-03-20 Thread Kuba Kucharski
you expect overhead from this? ;)

def benchmark2():

   return dict(data="test")

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Joomla Templates

2010-03-20 Thread Al
I have tried to beautify my application with some standard template. I
cannot get the "Joomla Template" appliance to work, nor does the
instructions in the following seem to work:

http://www.web2py.com/AlterEgo/default/show/167

I was testing the a Joomla 1.5 template from here:
http://joomportal.com/download-2069.html

Could  anyone share how they incorporate such templates or any other
compatible ones into web2py?

Al

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] AutocompleteWidget on multiple forms on the same page

2010-03-20 Thread Tito Garrido
Hi,

I've created several forms using LOAD function... These forms has 1 field
using AutocompleteWidget but this widget only works if there is just 1 form
on the page...

Is that expected?

Regards,

Tito

-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] problem to use database

2010-03-20 Thread kike
I have two databases, the first was created by auth, and the second is
a database with 14 tables, created previusly.

Traceback (most recent call last):
  File "/home/kike/sbdv/web2py/gluon/restricted.py", line 173, in
restricted
  File "/home/kike/Desktop/web2py/applications/SBDV/models/db.py",
line 58, in 
Field('second_preference', vul.object_products, label='Preferencia
Secundaria'))
  File "/home/kike/sbdv/web2py/gluon/sql.py", line 1270, in
define_table
  File "/home/kike/sbdv/web2py/gluon/sql.py", line 1540, in
_create_references
SyntaxError: Table: table "object_vendors" does not exist

this is my code:

db = DAL('mysql://root:r...@localhost/usbdv',pool_size=20)

from gluon.tools import *
auth=Auth(globals(),db)
auth.settings.hmac_key='sha512:582aedbf-4d01-4f41-81ad-ffb7eed2ada4'
auth_table=db.define_table(
auth.settings.table_user_name,
Field('first_name', length=128, label='Nombre(s)'),
Field('last_name', length=128, label='Apellidos'),
Field('email', length=128, unique=True, label='Correo'),
Field('password', 'password', length=256, readable=False,
label='Contraseña'),
Field('registration_key', length=128, writable=False,
readable=False),
Field('preference', vul.object_vendors, label='Preferencia
Principal'),
Field('second_preference', vul.object_products, label='Preferencia
Secundaria'))
 # creates all needed tables

auth_table.first_name.requires=IS_NOT_EMPTY()
auth_table.last_name.requires=IS_NOT_EMPTY()
auth_table.password.requires=[CRYPT()]
auth_table.email.requires=[IS_EMAIL(), IS_NOT_IN_DB(db,
auth_table.email)]
auth_table.preference.requires=IS_IN_DB(vul,'object_vendors.id','object_vendors.name')
auth_table.second_preference=IS_IN_DB(vul,'object_products.id','object_products.name')
auth.settings.table_user=auth_table
auth.define_tables()

and this is my declaration for the second databases(previusly
created):

vul=DAL('mysql://root:r...@localhost/sbdv',pool_size=20)

vul.define_table('object_vendors', migrate=False)
vul.define_table('object_products', migrate=False)
vul.define_table('object_versions', migrate=False)
vul.define_table('object_correlations', migrate=False)
vul.define_table('object_affect_types', migrate=False)
vul.define_table('object_links', migrate=False)
vul.define_table('vulnerabilities', migrate=False)
vul.define_table('credits', migrate=False)
vul.define_table('authors', migrate=False)
vul.define_table('ext_reference_types', migrate=False)
vul.define_table('ext_references', migrate=False)
vul.define_table('classification_types', migrate=False)
vul.define_table('classification_items', migrate=False)
vul.define_table('classifications', migrate=False)

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] problem to use database

2010-03-20 Thread kike
I have two databases, the first was created by auth, and the second is
a database with 14 tables, created previusly.

Traceback (most recent call last):
  File "/home/kike/sbdv/web2py/gluon/restricted.py", line 173, in
restricted
  File "/home/kike/Desktop/web2py/applications/SBDV/models/db.py",
line 58, in 
Field('second_preference', vul.object_products, label='Preferencia
Secundaria'))
  File "/home/kike/sbdv/web2py/gluon/sql.py", line 1270, in
define_table
  File "/home/kike/sbdv/web2py/gluon/sql.py", line 1540, in
_create_references
SyntaxError: Table: table "object_vendors" does not exist

this is my code:

db = DAL('mysql://root:r...@localhost/usbdv',pool_size=20)

from gluon.tools import *
auth=Auth(globals(),db)
auth.settings.hmac_key='sha512:582aedbf-4d01-4f41-81ad-ffb7eed2ada4'
auth_table=db.define_table(
auth.settings.table_user_name,
Field('first_name', length=128, label='Nombre(s)'),
Field('last_name', length=128, label='Apellidos'),
Field('email', length=128, unique=True, label='Correo'),
Field('password', 'password', length=256, readable=False,
label='Contraseña'),
Field('registration_key', length=128, writable=False,
readable=False),
Field('preference', vul.object_vendors, label='Preferencia
Principal'),
Field('second_preference', vul.object_products, label='Preferencia
Secundaria'))
 # creates all needed tables

auth_table.first_name.requires=IS_NOT_EMPTY()
auth_table.last_name.requires=IS_NOT_EMPTY()
auth_table.password.requires=[CRYPT()]
auth_table.email.requires=[IS_EMAIL(), IS_NOT_IN_DB(db,
auth_table.email)]
auth_table.preference.requires=IS_IN_DB(vul,'object_vendors.id','object_vendors.name')
auth_table.second_preference=IS_IN_DB(vul,'object_products.id','object_products.name')
auth.settings.table_user=auth_table
auth.define_tables()

and this is my declaration for the second databases(previusly
created):

vul=DAL('mysql://root:r...@localhost/sbdv',pool_size=20)

vul.define_table('object_vendors', migrate=False)
vul.define_table('object_products', migrate=False)
vul.define_table('object_versions', migrate=False)
vul.define_table('object_correlations', migrate=False)
vul.define_table('object_affect_types', migrate=False)
vul.define_table('object_links', migrate=False)
vul.define_table('vulnerabilities', migrate=False)
vul.define_table('credits', migrate=False)
vul.define_table('authors', migrate=False)
vul.define_table('ext_reference_types', migrate=False)
vul.define_table('ext_references', migrate=False)
vul.define_table('classification_types', migrate=False)
vul.define_table('classification_items', migrate=False)
vul.define_table('classifications', migrate=False)

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: zengarden anybody?

2010-03-20 Thread mdipierro
Just for fun:

   http://web2py.com/zengarden

then click on the [zengarden] link under the menu, under the "index"
link. You can change the skin per user, per session.
This is a bare bone welcome app with the layout

   http://web2py.com/zengarden/static/layout.html

Problem: all zengarden layouts hardcode text in images for each skin.
This makes them not as general as we need them.
It makes it more of a proof of concept than a useful tool
unfortunately.

Other problem: some layouts are broken because assume a few divs that
we do not have.

Massimo


On Mar 20, 7:18 pm, Thadeus Burgess  wrote:
> Well... the quickest way to change layouts is to store the
> configuration in the database...
>
> So have a table for web2py meta information, that contains
> "current_layout" which is value is "layout.html" or "mynewlayout.html"
> etc etc.
>
> In all views instead of {{ extend "layout.html" }} it will be {{
> extend current_layout }}. Then do the same with the CSS as well.
>
> {{ response.files.append(my_current_css) }}
>
> Cache these variables in RAM to save from un-necessary dbio
>
> -Thadeus
>
> On Sat, Mar 20, 2010 at 5:11 PM, Yarko Tymciurak
>
>  wrote:
> > Having said this, the zengarden shows how to accomplish some standard
> > naming, and now to switch css to affect things
>
> > That by itself is quite useful - and worth (for me at least) more
> > closely...
>
> > On Mar 20, 1:53 pm, Thadeus Burgess  wrote:
> >> I envision having an app create wizard, you select a layout (based on
> >> ez-css), and then select a skin for the layout. :)
>
> >> -Thadeus
>
> >> On Sat, Mar 20, 2010 at 1:50 PM, mr.freeze  wrote:
> >> > I think the ability to select a skin when creating an app would be a
> >> > major plus and help kick-start development for the design-impaired
> >> > such as myself.
>
> >> > On Mar 20, 1:32 pm, mdipierro  wrote:
> >> >> I just came across this:
>
> >> >>    http://www.csszengarden.com/
>
> >> >> It is one simple html layout (only divs) with 210 PURE CSS skins:
>
> >> >>    http://www.mezzoblue.com/zengarden/alldesigns/
>
> >> >> This could be an option for the welcome app. If we use their html, it
> >> >> would be trivial to add a small admin option that downloads a team to
> >> >> zengarden and applies to skin. Options that require overriding the
> >> >> HTML are more complex to handle.
>
> >> >> What do you think?
>
> >> >> Massimo
>
> >> > --
> >> > You received this message because you are subscribed to the Google 
> >> > Groups "web2py-users" group.
> >> > To post to this group, send email to web...@googlegroups.com.
> >> > To unsubscribe from this group, send email to 
> >> > web2py+unsubscr...@googlegroups.com.
> >> > For more options, visit this group 
> >> > athttp://groups.google.com/group/web2py?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "web2py-users" group.
> > To post to this group, send email to web...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > web2py+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/web2py?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: benchmarking: rocket vs pound with four rockets

2010-03-20 Thread mdipierro
oops. Sorry. It would be interesting to know how much overhead does
web2py add.

On Mar 20, 7:44 pm, Kuba Kucharski  wrote:
> > I am assuming that in all your tests you did not use web2py. I
>
> wrong assumption. I even published my model&controller at the
> beginning of this thread.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: benchmarking: rocket vs pound with four rockets

2010-03-20 Thread Kuba Kucharski
> I am assuming that in all your tests you did not use web2py. I

wrong assumption. I even published my model&controller at the
beginning of this thread.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: benchmarking: rocket vs pound with four rockets

2010-03-20 Thread mdipierro
I am assuming that in all your tests you did not use web2py. I am
assuming you just tested some "hello word" wsgi application. You can
find gluon/sneaky.py in the web2py source and there is a wsgi hello
world example in there.

Massimo

On Mar 20, 4:07 pm, Kuba Kucharski  wrote:
> ALL POWER I CAN GET FROM quad core Xeon @ 2.33GHz
>
> ONLY SOME STABLE RECORDS HERE:
>
> Request rate: 929.0 req/s (1.1 ms/req) QUAD CHERRYPY
> Request rate: 877.6 req/s (1.1 ms/req) QUAD ROCKET
>
> Request rate: 1478.0 req/s (0.7 ms/req) CHERRYPY SOLO
> Request rate: 1544.2 req/s (0.6 ms/req) ROCKET SOLO
>
> QUAD SLOWER? Yes. But when I enforce rate up as much as it can perform
> on my machine:
>
> Request rate: 3096.9 req/s (0.3 ms/req) QUAD CHERRYPY (--rate=310)
> Request rate: 2566.4 req/s (0.4 ms/req) QUAD ROCKET (--rate=260)
>
> This is probably the limit of my hardware.
> Rather unrealistic scenario. So, conclusions:
>
> - we should not use "ab"
> - use only one instance
> - rocket is ok
>
> Massimo, how to switch to Sneaky?
>
> --
> Kuba

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: PyPy 1.2 released!

2010-03-20 Thread mdipierro


On Mar 20, 2:58 pm, Joe  Barnhart  wrote:
> OK -- more info.
>
> I discovered that sqlite3 was not being loaded by sql.py in gluon.
> The library must be structured oddly because it wants something like:
>
> from sqlite3 import dbapi2 as sqlite3

Can you send me the patch?

> After hacking sql.py in this fashion, pypy ran perfectly!   ...for
> about 30 seconds!
>
> After that time, I got a "too many open files" error for every
> request.  It seems that PyPy isn't very aggressive about GC'ing closed
> files, so I need to research that aspect.

This is bad. I think we explicitly close any file we open but we may
be wrong. If you find out the source of the problem, please let me
know.

> It may be a moot question, because from my brief tests I believe the
> JIT will not speed up code loaded and run via "exec".  I noticed my
> worst page load takes about 6-7 seconds under OSX Python 2.5.2 but
> takes about 12 seconds under PyPy.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: Bug in DocTests?

2010-03-20 Thread Joschua
thank you too ( for web2py :)

On 14 Mrz., 21:14, mdipierro  wrote:
> fantastic. I am uploading the solution to trunk. Thank you.
>
> On Mar 14, 11:44 am, Joschua  wrote:
>
> > I looked into the python documentation and find DocTestFinder:
>
> >http://pygments.org/demo/3361/?style=fruity
>
> > My script will print:
>
> > Finding tests in sample
> > 0
> > Finding tests in with_doctests
> > 3
>
> > Maybie this could be used..
>
> > On 13 Mrz., 17:18, mdipierro  wrote:
>
> > > I looked into this. It is a python issue. ThedoctestAPI return '' if
> > > no test or passed test and return !='' if test fails. web2py cannot
> > > easily discriminate if a test is there and passes or there isn't any.
> > > If you can find something more about this let me know.
>
> > > Massimo
>
> > > On Mar 13, 5:23 am, Joschua  wrote:
>
> > > > yeah, that would be great, because it twist the facts.. ^^
>
> > > > On 11 Mrz., 23:15, mdipierro  wrote:
>
> > > > > I think that'sdoctestdoing. If there is no actual test but there is
> > > > > a docstring, it is assumed "pass".
> > > > > It may be web2py's too. I need to check.
>
> > > > > On Mar 11, 4:05 pm, Joschua  wrote:
>
> > > > > > As example, when you look in the examples app in simple_examples.py
> > > > > > and you execute thedoctest, the docstrings in the controller hello4,
> > > > > > hello5 and hello6 are recognized as doctests and passed. I think 
> > > > > > this
> > > > > > is a bug (or is thedoctest/ web2py not able to check that, >>>?)

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] web2py book trivia

2010-03-20 Thread Joschua
the web2py-book registration mail was sorted in the spam folder,
because "the mail was not send from the real mailserver of the
sender." (real: web2py.com, sendfrom: ..depaul.edu)

at http://web2py.com/book/default/section/3/10 the category must be
called "versioning" and not "mercurial", because that is the name
inside of web2py.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: zengarden anybody?

2010-03-20 Thread Thadeus Burgess
Well... the quickest way to change layouts is to store the
configuration in the database...

So have a table for web2py meta information, that contains
"current_layout" which is value is "layout.html" or "mynewlayout.html"
etc etc.

In all views instead of {{ extend "layout.html" }} it will be {{
extend current_layout }}. Then do the same with the CSS as well.

{{ response.files.append(my_current_css) }}

Cache these variables in RAM to save from un-necessary dbio

-Thadeus





On Sat, Mar 20, 2010 at 5:11 PM, Yarko Tymciurak
 wrote:
> Having said this, the zengarden shows how to accomplish some standard
> naming, and now to switch css to affect things
>
> That by itself is quite useful - and worth (for me at least) more
> closely...
>
>
> On Mar 20, 1:53 pm, Thadeus Burgess  wrote:
>> I envision having an app create wizard, you select a layout (based on
>> ez-css), and then select a skin for the layout. :)
>>
>> -Thadeus
>>
>> On Sat, Mar 20, 2010 at 1:50 PM, mr.freeze  wrote:
>> > I think the ability to select a skin when creating an app would be a
>> > major plus and help kick-start development for the design-impaired
>> > such as myself.
>>
>> > On Mar 20, 1:32 pm, mdipierro  wrote:
>> >> I just came across this:
>>
>> >>    http://www.csszengarden.com/
>>
>> >> It is one simple html layout (only divs) with 210 PURE CSS skins:
>>
>> >>    http://www.mezzoblue.com/zengarden/alldesigns/
>>
>> >> This could be an option for the welcome app. If we use their html, it
>> >> would be trivial to add a small admin option that downloads a team to
>> >> zengarden and applies to skin. Options that require overriding the
>> >> HTML are more complex to handle.
>>
>> >> What do you think?
>>
>> >> Massimo
>>
>> > --
>> > You received this message because you are subscribed to the Google Groups 
>> > "web2py-users" group.
>> > To post to this group, send email to web...@googlegroups.com.
>> > To unsubscribe from this group, send email to 
>> > web2py+unsubscr...@googlegroups.com.
>> > For more options, visit this group 
>> > athttp://groups.google.com/group/web2py?hl=en.
>>
>>
>
> --
> You received this message because you are subscribed to the Google Groups 
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to 
> web2py+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/web2py?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: web2py beautification

2010-03-20 Thread Thadeus Burgess
easy negative margin ??

easy 50 % width ??

I agree, I wish the class names were more "human", OTOH, with only a
handful of classes it is not much to learn.


-Thadeus





On Sat, Mar 20, 2010 at 6:57 PM, Pepe  wrote:
>
> i'm designer and before of that a human being, so i wonder: why make
> web2py less human readable?

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: problema con la BD

2010-03-20 Thread Alex Fanjul

Gracias Mariano, no conocía la existencia del grupo en español...
alex

El 20/03/2010 19:19, Mariano Reingart escribió:

kike:

Antes que nada, hay un grupo de usuarios en español:
http://groups.google.com/group/web2py-usuarios
(web2py-users es para consultas en inglés)

Respecto a tu problema, ¿donde estas definiendo la tabla object_vendors?

En el grupo en español se trato algo similar sobre como usar varias
bases distintas:
http://groups.google.com/group/web2py-usuarios/browse_thread/thread/6cb57d99806b5ba0

Sds

Mariano Reingart
http://reingart.blogspot.com



On Sat, Mar 20, 2010 at 3:01 PM, kike  wrote:
   

disculpenme en donde dice:
  auth_table.preference.requires=IS_NOT_EMPTY()
  auth_table.second_preference=IS_NOT_EMPTY()

realmente dice:

auth_table.preference.requires=IS_IN_DB(vul,'object_vendors.id','object_vendors.name')
auth_table.second_preference=IS_IN_DB(vul,'object_products.id','object_products.name')

On 20 mar, 12:55, kike  wrote:
 

tengo dos bases de datos distintas, la primera es la que se basa mi
aplicacion, y la segunda es la que crea auth, el problema es que
cuando le digo a auth que coja la informacion de un campo de la
primera base de datos, me dice que no conoce el nombre, aqui les pongo
el codigo y el error:

vul=DAL('mysql://root:r...@localhost/sbdv',pool_size=20)
db = DAL('mysql://root:r...@localhost/usbdv',pool_size=20)

from gluon.tools import *
auth=Auth(globals(),db)
auth.settings.hmac_key='sha512:582aedbf-4d01-4f41-81ad-ffb7eed2ada4'
auth_table=db.define_table(
 auth.settings.table_user_name,
 Field('first_name', length=128, label='Nombre(s)'),
 Field('last_name', length=128, label='Apellidos'),
 Field('email', length=128, unique=True, label='Correo'),
 Field('password', 'password', length=256, readable=False,
label='Contraseña'),
 Field('registration_key', length=128, writable=False,
readable=False),
 Field('preference', vul.object_vendors.name, label='Preferencia
Principal'),
 Field('second_preference', vul.object_products.name,
label='Preferencia Secundaria'))

auth_table.first_name.requires=IS_NOT_EMPTY()
auth_table.last_name.requires=IS_NOT_EMPTY()
auth_table.password.requires=[CRYPT()]
auth_table.email.requires=[IS_EMAIL(), IS_NOT_IN_DB(db,
auth_table.email)]
auth_table.preference.requires=IS_NOT_EMPTY()
auth_table.second_preference=IS_NOT_EMPTY()
auth.settings.table_user=auth_table
auth.define_tables()

Traceback (most recent call last):
   File "/home/kike/sbdv/web2py/gluon/restricted.py", line 173, in
restricted
   File "/home/kike/Desktop/web2py/applications/SBDV/models/db.py",
line 40, in
 Field('preference', vul.object_vendors.name, label='Preferencia
Principal'),
   File "/home/kike/tesis/sbdv/web2py/gluon/sql.py", line 1295, in
__getattr__
KeyError: 'object_vendors'
   

--
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.


 
   


--
Alejandro Fanjul Fdez.
alex.fan...@gmail.com
www.mhproject.org

--
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: web2py on Kodingen?

2010-03-20 Thread Alex Fanjul
Massimo, for what I could figure out it's an IDE on the Cloud, where you 
can also Install open source web applications/solutions with the 
easiness of one click... I tend to be very skeptic with this things, but 
anyway it's impressive!!

alex


El 20/03/2010 18:39, mdipierro escribió:

I am trying to figure out what it is? Is it a hosting provider with a
web based IDE? Is it a web based IDE can download and use?

On Mar 20, 12:01 pm, Alex Fanjul  wrote:
   

Incredible!! i didnt know kodingen...

El 20/03/2010 7:19, mr.freeze escribi :

 

It appears that Kodingen can run Django and Ruby apps. Someone with
strong Apache-fu should try to get web2py working :)
   
 

http://kodingen.com/?2010/01/27/get-ruby-working/
http://kodingen.com/?groups/django-on-kodingen
   

--
Alejandro Fanjul Fdez.
alex.fan...@gmail.comwww.mhproject.org
 
   


--
Alejandro Fanjul Fdez.
alex.fan...@gmail.com
www.mhproject.org

--
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: web2py beautification

2010-03-20 Thread Pepe
Hello,

i'm designer and before of that a human being, so i wonder: why make
web2py less human readable?

what's "ez-negmr" "ez-50"??

the semantic of the most css framework is a problem, because they
haven't.

...On the other hand:
To have fewer elements is simpler to understand when you start to
learn and use something new.
To have a simple layout, without images, without a heavy css ... etc.
I think it's better, perhaps more ugly, but faster to learn.
Less elements = less uncertainty. This encourages the learning
process.

well, it's just what I think.

Greetings!

Pepe.

On Mar 20, 1:25 pm, mdipierro  wrote:
> Yarko did it! The new welcome with ez.css is in trunk. We still need
> do add something to allow skinning and rearrange the css (right now we
> have:
>
> applications/welcome/static/base.css
> applications/welcome/static/calendar.css
> applications/welcome/static/ez-plug-min.css
> applications/welcome/static/ez-plug.css
>
> massimo
>
> On Mar 19, 6:05 pm, Yarko Tymciurak 
> wrote:
>
>
>
> > On Mar 19, 2:24 am, mdipierro  wrote:
>
> > > I played with ez-css (which I like) but yet it reminded why I used
> > > tables.
>
> > Yeah - the presence of tables in the layout really causes troubles!
>
> > > Here is my problem and I am sure it is just me being dumb. Say
> > > I want a header, a footer and two columns in between. I want the left
> > > column of fixed with (a menu, 200px) and a right column to foll the
> > > rest of the space (content). Because of the way it works (and most of
> > > these frameworks work the same way), the columns float to right
> > > therefore I must specifycontent before the menu. Hence I cannot find a
> > > way to make the menu fixed width and the content fill the rest of the
> > > space without messing up the alignment of the boxes. Can you do it?
>
> > If I understand you, I think this is pretty easy w/ ez-css.   I have
> > now done a few layouts w/ it in web2py (as of last night), and have
> > sent you an ez-css layout.html for "welcome" app (it uses the css
> > classes from base.css, but a few settings that were assigned to table
> > elements, I had to update / put elsewhere - base.css has minor
> > changes;  ez-plug.css remains stock).
>
> > There are probably other things that could be cleaned up in base.css,
> > but this was pretty easy (once I realized how to go about it).
>
> > - Yarko
>
> > > Massimo
>
> > > On Mar 18, 11:46 pm, Yarko Tymciurak 
> > > wrote:
>
> > > > On Mar 18, 10:31 pm, mdipierro  wrote:
>
> > > > > The problem I see is that it is too simple.
> > > > > sizeXofY does not seem to guarantee that all columns have the same
> > > > > lenght (ez-css does it).
> > > > > I like to have the menu column fixed width and the main column elastic
> > > > > and it does not do that (not sure if ez-css does).
>
> > > > I have installed ez-css to try out / play with...  it does do fixed
> > > > width + variable width columns:
>
> > > > In multiple ways, actually (depending on how you nest it);   
> > > > seehttp://www.ez-css.org/layouts
>
> > > > See module 2A, 2B, layout 2, layout 3, etc
>
> > > > Each of these use "ez-50", a 50% width element, or "ez-33", a 33%
> > > > width element.
>
> > > > ez-css encourages you to create your own width element if the pre-
> > > > defined ones don't "do it" for you - so, create a
> > > > ez-500px, and you'd have what you want.
>
> > > > This seems like a really clean, easily modifiable and "combinable"
> > > > package...  I'm going to play with it in the next few days to see how
> > > > my opinion holds up in use.
>
> > > > - Yarko
>
> > > > > On Mar 18, 8:59 pm, villas  wrote:
>
> > > > > > Ez-css seems like a good enough option,  but before making your mind
> > > > > > up, have a look at the simplicity of oocss.org/grids_docs.html (with
> > > > > > Firebug).  Oocss might give more possibilities,  but admittedly, is
> > > > > > heavier.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: benchmarking: rocket vs pound with four rockets

2010-03-20 Thread Kuba Kucharski
> ach!  I meant to say:  web2py.com

nice one.

yes. stability and funcionality over speed. I just wanted to learn
where are the borders(and how to benchmark properly).

-- 
Kuba

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: zengarden anybody?

2010-03-20 Thread Yarko Tymciurak
Having said this, the zengarden shows how to accomplish some standard
naming, and now to switch css to affect things

That by itself is quite useful - and worth (for me at least) more
closely...


On Mar 20, 1:53 pm, Thadeus Burgess  wrote:
> I envision having an app create wizard, you select a layout (based on
> ez-css), and then select a skin for the layout. :)
>
> -Thadeus
>
> On Sat, Mar 20, 2010 at 1:50 PM, mr.freeze  wrote:
> > I think the ability to select a skin when creating an app would be a
> > major plus and help kick-start development for the design-impaired
> > such as myself.
>
> > On Mar 20, 1:32 pm, mdipierro  wrote:
> >> I just came across this:
>
> >>    http://www.csszengarden.com/
>
> >> It is one simple html layout (only divs) with 210 PURE CSS skins:
>
> >>    http://www.mezzoblue.com/zengarden/alldesigns/
>
> >> This could be an option for the welcome app. If we use their html, it
> >> would be trivial to add a small admin option that downloads a team to
> >> zengarden and applies to skin. Options that require overriding the
> >> HTML are more complex to handle.
>
> >> What do you think?
>
> >> Massimo
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "web2py-users" group.
> > To post to this group, send email to web...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > web2py+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/web2py?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: zengarden anybody?

2010-03-20 Thread Yarko Tymciurak
On Mar 20, 1:53 pm, Thadeus Burgess  wrote:
> I envision having an app create wizard, you select a layout (based on
> ez-css), and then select a skin for the layout. :)

Well - aside from ez-css using classes, and the things I've looked at
@ zengarden seem to use id's (so javascript can refer to them), the
few I looked at are not free for non-commercial use - so licensing is
a potential issue.

The other is:  how would you apply one layout over another?   That (I
think) is a non-trivial task.

But - this all beats table layouts by a country-mile! ;-)

- Yarko

>
> -Thadeus
>
> On Sat, Mar 20, 2010 at 1:50 PM, mr.freeze  wrote:
> > I think the ability to select a skin when creating an app would be a
> > major plus and help kick-start development for the design-impaired
> > such as myself.
>
> > On Mar 20, 1:32 pm, mdipierro  wrote:
> >> I just came across this:
>
> >>    http://www.csszengarden.com/
>
> >> It is one simple html layout (only divs) with 210 PURE CSS skins:
>
> >>    http://www.mezzoblue.com/zengarden/alldesigns/
>
> >> This could be an option for the welcome app. If we use their html, it
> >> would be trivial to add a small admin option that downloads a team to
> >> zengarden and applies to skin. Options that require overriding the
> >> HTML are more complex to handle.
>
> >> What do you think?
>
> >> Massimo
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "web2py-users" group.
> > To post to this group, send email to web...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > web2py+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/web2py?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: benchmarking: rocket vs pound with four rockets

2010-03-20 Thread Yarko Tymciurak

On Mar 20, 4:50 pm, Yarko Tymciurak 
wrote:
> On Mar 20, 12:36 pm, mdipierro  wrote:
>
>
>
> > Thanks this is clear. I should clarify my position on this.
>
> > I always liked cherrypy because it is known to be fast and because
> > many use it to it has been tested. The problem with cherrypy is that
> > the code is not as clean as Rocket's.
>
> > I also like Rocket because its code is very clean and readable and
> > because the developer (you) is a member of this community.
>
> > Some time ago I tried to rewrite Cherrypy in sneaky but I did not have
> > time to bring it to production quality. Rocket reminds me of sneaky
> > both as goals and as design and makes me feel I do not need work on
> > sneaky any more and I can remove it from web2py.
>
> > Speed is an important issue but not the only issue.
>
> > Another important issue is long term support. Are you Tim committed to
> > supporting Rocket long term?
>
> I would chime in with 2 obersvations / agreements:
>
> * Performance is NOT only about speed;
>   -- remember when web2py.py used only cherrypy,

ach!  I meant to say:  web2py.com

> and people had
> truncated files (web2py-distro.zip) - because cherrypy would get into
> situation of dropping connections?   It varied with client, and I
> would expect (as HTML5 takes root, and browser engines update) this
> will rear its head again.
>
> Yeah, sure - I want to be able to have a web2py webstore or game
> serving thousands of connections... maybe... BUT I also want to be
> able to have a community website - church, social service agency,
> perhaps governemt - and I want to be sure that their streaming
> sermons, or huge podcast uploads, or those governemt drafts of huge
> bills up for a vote ("How many pages did you say that was???") - that
> those WILL work... or live video feeds... or live development /
> collaborative / realtime interaction
>
> So there are number of connections, size of transfer (reliable large
> item transaction), and real-time response ability.  And security...
> and...
>
> Well - for deployed solutions, we have "compiled" solutions.  So maybe
> this is a mute point.  But broader variety of testing is at point.   I
> think - even as you decide to support one (and I am _all_ for "from
> our community" solutions!) - having a plugable architecture will HELP
> maintenance, i.e. make it _really_ easy to continue performance
> testing, and meaningful comparison tests:  I am all for this!  (but
> still choose to support one).
>
> As for "long term support":  1] with plugable testing, this is less
> critical (accidents happen, people go away, and sooner or later you
> _have_ to make changes / adapt);   [2] for volunteer work, all best
> intentions, all commitments change
>
> Summary:  test different things;   don't worry about decision (and
> make pluggable part of both the maintenance/testing and "insurance"
> part of this).
>
> - Yarko
>
>
>
> > With the numbers I have seen I still lean towards rockets, but I would
> > like to see more benchmakrs with pound (and/or haproxy).
>
> > I would also like to hear more opinions from other users on this
> > matter.
>
> > Even if we default to one of the two, we could setup web2py to give
> > users a choice (at least for a while). There may be problems with
> > openssl vs ssl, but I think they can be resolved. Eventually I think
> > we better make a choice and pack only one of the two.
>
> > Massimo
>
> > P.S. Binary web servers are not an option.
>
> > On Mar 20, 11:58 am, "Timothy Farrell"  wrote:
>
> > > Summary:
>
> > > First, I'll speak in the context of a single instance of Rocket.  I'll 
> > > talk about pound in a bit.
>
> > > ApacheBench, which I used to test Rocket, unfairly accentuates the 
> > > benefits of Rocket.  httperf allows for a much fairer test.  The httperf 
> > > configuration that Kuba used tested a non-standard situation (while 
> > > applicable to a project he's working on) that accentuates a known 
> > > weakness of Rocket over Cherrypy.  Even though the single-instance test 
> > > was inconclusive the multi-instance test implied that Rocket would be 
> > > slower in the single instance.
>
> > > Because my tests and Kuba's tests focused on polar opposite situations, 
> > > the numbers were different.
>
> > > Nicholas Piel tested version 1.0.1 which did not include epoll support so 
> > > his initial conclusions, while correct for the time, are no longer 
> > > accurate.
>
> > > The difference in situations revolves around how many HTTP requests are 
> > > pipelined over a single connection.  ApacheBench puts them all in a few 
> > > connections, httperf allows for configuring this.  Kuba's benchmark 
> > > settings put one request per connection.  A real-world setting is 
> > > something around 10, which Nicholas Piel uses.
>
> > > Kuba released another round of tests that follow Nicholas Piel's HTTP/1.1 
> > > tests (10 requests per connection).  The results showed Rocket as 
> > > performing slightly 

[web2py] Re: benchmarking: rocket vs pound with four rockets

2010-03-20 Thread Yarko Tymciurak
On Mar 20, 12:36 pm, mdipierro  wrote:
> Thanks this is clear. I should clarify my position on this.
>
> I always liked cherrypy because it is known to be fast and because
> many use it to it has been tested. The problem with cherrypy is that
> the code is not as clean as Rocket's.
>
> I also like Rocket because its code is very clean and readable and
> because the developer (you) is a member of this community.
>
> Some time ago I tried to rewrite Cherrypy in sneaky but I did not have
> time to bring it to production quality. Rocket reminds me of sneaky
> both as goals and as design and makes me feel I do not need work on
> sneaky any more and I can remove it from web2py.
>
> Speed is an important issue but not the only issue.
>
> Another important issue is long term support. Are you Tim committed to
> supporting Rocket long term?

I would chime in with 2 obersvations / agreements:

* Performance is NOT only about speed;
  -- remember when web2py.py used only cherrypy, and people had
truncated files (web2py-distro.zip) - because cherrypy would get into
situation of dropping connections?   It varied with client, and I
would expect (as HTML5 takes root, and browser engines update) this
will rear its head again.

Yeah, sure - I want to be able to have a web2py webstore or game
serving thousands of connections... maybe... BUT I also want to be
able to have a community website - church, social service agency,
perhaps governemt - and I want to be sure that their streaming
sermons, or huge podcast uploads, or those governemt drafts of huge
bills up for a vote ("How many pages did you say that was???") - that
those WILL work... or live video feeds... or live development /
collaborative / realtime interaction

So there are number of connections, size of transfer (reliable large
item transaction), and real-time response ability.  And security...
and...

Well - for deployed solutions, we have "compiled" solutions.  So maybe
this is a mute point.  But broader variety of testing is at point.   I
think - even as you decide to support one (and I am _all_ for "from
our community" solutions!) - having a plugable architecture will HELP
maintenance, i.e. make it _really_ easy to continue performance
testing, and meaningful comparison tests:  I am all for this!  (but
still choose to support one).

As for "long term support":  1] with plugable testing, this is less
critical (accidents happen, people go away, and sooner or later you
_have_ to make changes / adapt);   [2] for volunteer work, all best
intentions, all commitments change

Summary:  test different things;   don't worry about decision (and
make pluggable part of both the maintenance/testing and "insurance"
part of this).

- Yarko
>
> With the numbers I have seen I still lean towards rockets, but I would
> like to see more benchmakrs with pound (and/or haproxy).
>
> I would also like to hear more opinions from other users on this
> matter.
>
> Even if we default to one of the two, we could setup web2py to give
> users a choice (at least for a while). There may be problems with
> openssl vs ssl, but I think they can be resolved. Eventually I think
> we better make a choice and pack only one of the two.
>
> Massimo
>
> P.S. Binary web servers are not an option.
>
> On Mar 20, 11:58 am, "Timothy Farrell"  wrote:
>
> > Summary:
>
> > First, I'll speak in the context of a single instance of Rocket.  I'll talk 
> > about pound in a bit.
>
> > ApacheBench, which I used to test Rocket, unfairly accentuates the benefits 
> > of Rocket.  httperf allows for a much fairer test.  The httperf 
> > configuration that Kuba used tested a non-standard situation (while 
> > applicable to a project he's working on) that accentuates a known weakness 
> > of Rocket over Cherrypy.  Even though the single-instance test was 
> > inconclusive the multi-instance test implied that Rocket would be slower in 
> > the single instance.
>
> > Because my tests and Kuba's tests focused on polar opposite situations, the 
> > numbers were different.
>
> > Nicholas Piel tested version 1.0.1 which did not include epoll support so 
> > his initial conclusions, while correct for the time, are no longer accurate.
>
> > The difference in situations revolves around how many HTTP requests are 
> > pipelined over a single connection.  ApacheBench puts them all in a few 
> > connections, httperf allows for configuring this.  Kuba's benchmark 
> > settings put one request per connection.  A real-world setting is something 
> > around 10, which Nicholas Piel uses.
>
> > Kuba released another round of tests that follow Nicholas Piel's HTTP/1.1 
> > tests (10 requests per connection).  The results showed Rocket as 
> > performing slightly faster.
>
> > Now, let's talk about pound.  I've not used pound for any tests before so 
> > this was all new information to me.  The first test showed 4 instances of 
> > Rocket behind pound to be slower than 4 instances of Cherrypy behind pound 
> > on a Quad-core machine. 

Re: [web2py] Re: benchmarking: rocket vs pound with four rockets

2010-03-20 Thread Kuba Kucharski
ALL POWER I CAN GET FROM quad core Xeon @ 2.33GHz

ONLY SOME STABLE RECORDS HERE:

Request rate: 929.0 req/s (1.1 ms/req) QUAD CHERRYPY
Request rate: 877.6 req/s (1.1 ms/req) QUAD ROCKET

Request rate: 1478.0 req/s (0.7 ms/req) CHERRYPY SOLO
Request rate: 1544.2 req/s (0.6 ms/req) ROCKET SOLO

QUAD SLOWER? Yes. But when I enforce rate up as much as it can perform
on my machine:

Request rate: 3096.9 req/s (0.3 ms/req) QUAD CHERRYPY (--rate=310)
Request rate: 2566.4 req/s (0.4 ms/req) QUAD ROCKET (--rate=260)

This is probably the limit of my hardware.
Rather unrealistic scenario. So, conclusions:

- we should not use "ab"
- use only one instance
- rocket is ok

Massimo, how to switch to Sneaky?

-- 
Kuba

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: web2py beautification

2010-03-20 Thread Yarko Tymciurak
On Mar 20, 12:25 pm, mdipierro  wrote:
> Yarko did it! The new welcome with ez.css is in trunk. We still need
> do add something to allow skinning and rearrange the css (right now we
> have:
>
> applications/welcome/static/base.css
> applications/welcome/static/calendar.css
> applications/welcome/static/ez-plug-min.css
> applications/welcome/static/ez-plug.css
>

FYI - ez-plug.css is for readability / development;  you want to use
the minified version.

It turns out that there is at least one more change to be made (see
below).

We could (perhaps I could) do a short writeup - the key was to use css
classes already used in the table layout version, and add them
(accumulate them, literally) to the divs.

The ez-css pattern is fairly simple:  pick a wrapper, add a layout
group inside of it, repeat...
Putting "what you want" for the ez-css div just means adding your css
class to the div, along with the ez-css one: either from base.css, or
from your own.   It couldn't be simpler.   You do need to be aware of
the order of defining / redefining behaviors, so inheriting, or NOT
setting for as long as you can stand it is a good method, and then
being judicious about where you put a setting.

I have done another site, replicating a layout that Massimo was
basically asking about, that is (top to bottom):

  header: 2 part  (66 / 33)
  Status bar
  3 part body pane:  fixed size (side menu);  expandable body;  fixed
size pane
  footer (spanning)

There are also selective, and not full-length borders / separators
between panes (replicating, essentially, their original site).

Try it - once you get used to it, I think you'll find it easier to
update / modify layouts than with tables.

You can imagine adding layers at any level, in any combination - just
by enclosing "chunks" in wrappers (I almost said "rows", but it
doesn't need to be), and putting an ez-css layout set inside the
wrapper, and a box element around each pane.

That, I think, is pretty much it.  I kept these 2 pages open while
doing this:

http://www.ez-css.org/how-to
http://www.ez-css.org/layouts

It's so easy, that in fact I didn't read thru the how-to's all the way
- I just noticed the outermost ez-wr should probably be renamed to ez-
mr (for main wrapper), as the 'how-to' says.

I'm sure people will think of ways to use this, but after a few
layouts, I don't know if I'd need a layout tool / helper... it's
faster to just "do it".

We could have some CSS naming conventions, and write-up some
"standard" web2py css class descriptors and use guidelines in the
manual.   A good convention might be to "leave ez-plug-min.css and
base.css" alone; do any additional extensions with a "myapp.css" file.

Have a look.  It will be interesting to hear other's experience with
this.


Regards,
Yarko
> massimo
>
> On Mar 19, 6:05 pm, Yarko Tymciurak 
> wrote:
>
> > On Mar 19, 2:24 am, mdipierro  wrote:
>
> > > I played with ez-css (which I like) but yet it reminded why I used
> > > tables.
>
> > Yeah - the presence of tables in the layout really causes troubles!
>
> > > Here is my problem and I am sure it is just me being dumb. Say
> > > I want a header, a footer and two columns in between. I want the left
> > > column of fixed with (a menu, 200px) and a right column to foll the
> > > rest of the space (content). Because of the way it works (and most of
> > > these frameworks work the same way), the columns float to right
> > > therefore I must specifycontent before the menu. Hence I cannot find a
> > > way to make the menu fixed width and the content fill the rest of the
> > > space without messing up the alignment of the boxes. Can you do it?
>
> > If I understand you, I think this is pretty easy w/ ez-css.   I have
> > now done a few layouts w/ it in web2py (as of last night), and have
> > sent you an ez-css layout.html for "welcome" app (it uses the css
> > classes from base.css, but a few settings that were assigned to table
> > elements, I had to update / put elsewhere - base.css has minor
> > changes;  ez-plug.css remains stock).
>
> > There are probably other things that could be cleaned up in base.css,
> > but this was pretty easy (once I realized how to go about it).
>
> > - Yarko
>
> > > Massimo
>
> > > On Mar 18, 11:46 pm, Yarko Tymciurak 
> > > wrote:
>
> > > > On Mar 18, 10:31 pm, mdipierro  wrote:
>
> > > > > The problem I see is that it is too simple.
> > > > > sizeXofY does not seem to guarantee that all columns have the same
> > > > > lenght (ez-css does it).
> > > > > I like to have the menu column fixed width and the main column elastic
> > > > > and it does not do that (not sure if ez-css does).
>
> > > > I have installed ez-css to try out / play with...  it does do fixed
> > > > width + variable width columns:
>
> > > > In multiple ways, actually (depending on how you nest it);   
> > > > seehttp://www.ez-css.org/layouts
>
> > > > See module 2A, 2B, layout 2, layout 3, etc
>
> > > > Each of these use "ez-50", a 50% width element, or "ez-33

[web2py] Re: substring comparison in GAE query

2010-03-20 Thread mr.freeze
Are you thinking about this post?:
http://groups.google.com/group/web2py/browse_frm/thread/4aaa3846a2e5e68a/

Does GAE support 'substring'? A bug in Field.__getslice__ was recently
fixed so you may want to try the latest from mercurial.

I think you want:
query = db(db.table.string_field[-4:] == ".com")

On Mar 19, 5:06 pm, howesc  wrote:
> Thadeus,
>
> i'm not mixing frameworks right now - web2py has been my exclusive
> home for over a year now. :)  It also looks like there is some sort of
> substring tools with some (all?) of the relational 
> db'shttp://groups.google.com/group/web2py/browse_thread/thread/eb8ce28b34...
> but i'm not using one of them today to test it out.  it's not in GAE.
>
> thanks for the tips guys!  i'm just going to bite the bullet and make
> the database upgrade that is the correct answer anyway.  fun with
> updating code and testing!
>
> cfh
>
> On Mar 19, 1:33 pm, Thadeus Burgess  wrote:
>
> > You must be thinking of another framework and mixing the two?
>
> > I read every post and have not seen that.
>
> > Perhaps you mean db(db.table.string.like("%.com")).select()
>
> > -Thadeus
>
> > On Fri, Mar 19, 2010 at 2:49 PM, howesc  wrote:
> > > Hello,
>
> > > I swear i saw a post in the last week about creating database queries
> > > with substring syntax for filtering like:
> > >  query = db(db.table.string_field[:4] == ".com")
>
> > > but i can't find the post about that.  am i dreaming?  and does
> > > something like this work on the Google App Engine?  I was trying it
> > > but got an error:
>
> > >  File "/home/cfhowes/clients/rockriver/source/web2py/gluon/sql.py",
> > > line 2703, in __getslice__
> > >    s = self._db._translator['substring'] % d
> > > KeyError: 'substring'
>
> > > Thanks,
>
> > > Christian
>
> > > --
> > > You received this message because you are subscribed to the Google Groups 
> > > "web2py-users" group.
> > > To post to this group, send email to web...@googlegroups.com.
> > > To unsubscribe from this group, send email to 
> > > web2py+unsubscr...@googlegroups.com.
> > > For more options, visit this group 
> > > athttp://groups.google.com/group/web2py?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] The quest for fastest WSGI...

2010-03-20 Thread Joe Barnhart
Has anyone here heard of or used gevent?  It is a co-routine based
Python network library that exposes a lean interface to the libevent
library.  Based on the small amount of reading I have done so far, it
kicks major @ss on other WSGI implementations.

Blog for gevent:
http://blog.gevent.org/

Benchmark of WSGI implementations:
http://nichol.as/benchmark-of-python-web-servers

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: PyPy 1.2 released!

2010-03-20 Thread Joe Barnhart
OK -- more info.

I discovered that sqlite3 was not being loaded by sql.py in gluon.
The library must be structured oddly because it wants something like:

from sqlite3 import dbapi2 as sqlite3

After hacking sql.py in this fashion, pypy ran perfectly!   ...for
about 30 seconds!

After that time, I got a "too many open files" error for every
request.  It seems that PyPy isn't very aggressive about GC'ing closed
files, so I need to research that aspect.

It may be a moot question, because from my brief tests I believe the
JIT will not speed up code loaded and run via "exec".  I noticed my
worst page load takes about 6-7 seconds under OSX Python 2.5.2 but
takes about 12 seconds under PyPy.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: web2py on Kodingen?

2010-03-20 Thread Tito Garrido
Very interesting! but my apache skills are weak too :(

On Sat, Mar 20, 2010 at 3:52 PM, Thadeus Burgess wrote:

> Its based off of bespin
>
> -Thadeus
>
>
>
>
>
> On Sat, Mar 20, 2010 at 1:39 PM, mr.freeze  wrote:
> > It's the former.  Once you get an account, you can create and edit
> > projects and manage your web servers/databases/domains/etc. It looks
> > like it is mainly centered around php but there are options to enable
> > python.  I tried using fastcgi but my Apache skills are weak.
> >
> > On Mar 20, 12:39 pm, mdipierro  wrote:
> >> I am trying to figure out what it is? Is it a hosting provider with a
> >> web based IDE? Is it a web based IDE can download and use?
> >>
> >> On Mar 20, 12:01 pm, Alex Fanjul  wrote:
> >>
> >> > Incredible!! i didnt know kodingen...
> >>
> >> > El 20/03/2010 7:19, mr.freeze escribi :
> >>
> >> > > It appears that Kodingen can run Django and Ruby apps. Someone with
> >> > > strong Apache-fu should try to get web2py working :)
> >>
> >> > >http://kodingen.com/?2010/01/27/get-ruby-working/
> >> > >http://kodingen.com/?groups/django-on-kodingen
> >>
> >> > --
> >> > Alejandro Fanjul Fdez.
> >> > alex.fan...@gmail.comwww.mhproject.org
> >>
> >>
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> > To post to this group, send email to web...@googlegroups.com.
> > To unsubscribe from this group, send email to
> web2py+unsubscr...@googlegroups.com
> .
> > For more options, visit this group at
> http://groups.google.com/group/web2py?hl=en.
> >
> >
>
> --
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to
> web2py+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/web2py?hl=en.
>
>


-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: zengarden anybody?

2010-03-20 Thread Thadeus Burgess
I envision having an app create wizard, you select a layout (based on
ez-css), and then select a skin for the layout. :)

-Thadeus





On Sat, Mar 20, 2010 at 1:50 PM, mr.freeze  wrote:
> I think the ability to select a skin when creating an app would be a
> major plus and help kick-start development for the design-impaired
> such as myself.
>
> On Mar 20, 1:32 pm, mdipierro  wrote:
>> I just came across this:
>>
>>    http://www.csszengarden.com/
>>
>> It is one simple html layout (only divs) with 210 PURE CSS skins:
>>
>>    http://www.mezzoblue.com/zengarden/alldesigns/
>>
>> This could be an option for the welcome app. If we use their html, it
>> would be trivial to add a small admin option that downloads a team to
>> zengarden and applies to skin. Options that require overriding the
>> HTML are more complex to handle.
>>
>> What do you think?
>>
>> Massimo
>
> --
> You received this message because you are subscribed to the Google Groups 
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to 
> web2py+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/web2py?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: web2py on Kodingen?

2010-03-20 Thread Thadeus Burgess
Its based off of bespin

-Thadeus





On Sat, Mar 20, 2010 at 1:39 PM, mr.freeze  wrote:
> It's the former.  Once you get an account, you can create and edit
> projects and manage your web servers/databases/domains/etc. It looks
> like it is mainly centered around php but there are options to enable
> python.  I tried using fastcgi but my Apache skills are weak.
>
> On Mar 20, 12:39 pm, mdipierro  wrote:
>> I am trying to figure out what it is? Is it a hosting provider with a
>> web based IDE? Is it a web based IDE can download and use?
>>
>> On Mar 20, 12:01 pm, Alex Fanjul  wrote:
>>
>> > Incredible!! i didnt know kodingen...
>>
>> > El 20/03/2010 7:19, mr.freeze escribi :
>>
>> > > It appears that Kodingen can run Django and Ruby apps. Someone with
>> > > strong Apache-fu should try to get web2py working :)
>>
>> > >http://kodingen.com/?2010/01/27/get-ruby-working/
>> > >http://kodingen.com/?groups/django-on-kodingen
>>
>> > --
>> > Alejandro Fanjul Fdez.
>> > alex.fan...@gmail.comwww.mhproject.org
>>
>>
>
> --
> You received this message because you are subscribed to the Google Groups 
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to 
> web2py+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/web2py?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: widgets in db.py

2010-03-20 Thread Thadeus Burgess
I typically use the following naming convention

A_widgets.py
B_settings.py
C_web2py.py
D_db.py

-Thadeus





On Sat, Mar 20, 2010 at 1:17 PM, mdipierro  wrote:
> models are executed alphabetically. You have two options:
> 1) rename one of the files:
> 2) move the widgets to a module and import the module from db.py
>
>
> On Mar 20, 12:56 pm, Avik Basu  wrote:
>> Hi,
>>
>> I have a several widgets in a file called widgets.py and would like to
>> use those widgets in db.py.  Both db.py and widgets.py exist in the
>> models directory.  However, when I use the widgets in defining table
>> fields in db.py, it does not recognize the widgets.  How can I include
>> the widgets.py in db.py?
>>
>> Note that some of the the widgets reference the db object and so I
>> decided not to put widgets.py in the modules folder since I could not
>> reference db and the other globals from web2py.
>>
>> Thanks for your help.
>>
>> Avik
>
> --
> You received this message because you are subscribed to the Google Groups 
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to 
> web2py+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/web2py?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: zengarden anybody?

2010-03-20 Thread mr.freeze
I think the ability to select a skin when creating an app would be a
major plus and help kick-start development for the design-impaired
such as myself.

On Mar 20, 1:32 pm, mdipierro  wrote:
> I just came across this:
>
>    http://www.csszengarden.com/
>
> It is one simple html layout (only divs) with 210 PURE CSS skins:
>
>    http://www.mezzoblue.com/zengarden/alldesigns/
>
> This could be an option for the welcome app. If we use their html, it
> would be trivial to add a small admin option that downloads a team to
> zengarden and applies to skin. Options that require overriding the
> HTML are more complex to handle.
>
> What do you think?
>
> Massimo

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: zengarden anybody?

2010-03-20 Thread mdipierro
Here they have a longer list of >1000 designs:
http://www.mezzoblue.com/zengarden/alldesigns/others/

massimo

On Mar 20, 1:32 pm, mdipierro  wrote:
> I just came across this:
>
>    http://www.csszengarden.com/
>
> It is one simple html layout (only divs) with 210 PURE CSS skins:
>
>    http://www.mezzoblue.com/zengarden/alldesigns/
>
> This could be an option for the welcome app. If we use their html, it
> would be trivial to add a small admin option that downloads a team to
> zengarden and applies to skin. Options that require overriding the
> HTML are more complex to handle.
>
> What do you think?
>
> Massimo

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: web2py on Kodingen?

2010-03-20 Thread mr.freeze
It's the former.  Once you get an account, you can create and edit
projects and manage your web servers/databases/domains/etc. It looks
like it is mainly centered around php but there are options to enable
python.  I tried using fastcgi but my Apache skills are weak.

On Mar 20, 12:39 pm, mdipierro  wrote:
> I am trying to figure out what it is? Is it a hosting provider with a
> web based IDE? Is it a web based IDE can download and use?
>
> On Mar 20, 12:01 pm, Alex Fanjul  wrote:
>
> > Incredible!! i didnt know kodingen...
>
> > El 20/03/2010 7:19, mr.freeze escribi :
>
> > > It appears that Kodingen can run Django and Ruby apps. Someone with
> > > strong Apache-fu should try to get web2py working :)
>
> > >http://kodingen.com/?2010/01/27/get-ruby-working/
> > >http://kodingen.com/?groups/django-on-kodingen
>
> > --
> > Alejandro Fanjul Fdez.
> > alex.fan...@gmail.comwww.mhproject.org
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: ajax

2010-03-20 Thread Tito Garrido
I could add the form on the modal window but the date widget and time widget
is appearing out of the modal window... it's under the window. Is there a
way to put it to appear on the modal window?

Regards,

Tito

On Sun, Feb 21, 2010 at 11:29 AM, DenesL  wrote:

>
> Adding person with ajax_create active works for me  on 1.75.1
>
> On 20 feb, 19:16, mdipierro  wrote:
> > Now I am very puzzled. Can you email me the entire app?
> >
> > Massimo
> >
> > On Feb 20, 12:52 pm, Jose  wrote:
> >
> > > On 20 feb, 18:45, mdipierro  wrote:> I see. I
> do not think this has anything to do with the ajax_create
> > > > function.
> > > > we need to isolate the problem.
> >
> > > > comment everything related to the ajax_create function. Can you
> insert
> > > > records?
> >
> > > I commented:
> >
> > > #def ajax_create
> >
> > > and
> >
> > > #db.person.organization.comment = ajax_create(db.person.organization,
> > > title='Add an Org.')
> >
> > > and now I could add the record.
> >
> > > Jose
>
> --
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to
> web2py+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/web2py?hl=en.
>
>


-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: problema con la BD

2010-03-20 Thread kike
gracias nuevamente por la sugerencia, espero hacerlo bien esta vez,
sobre el problema con la BD, la BD sbdv "vul=DAL('mysql://
root:r...@localhost/sbdv',pool_size=20)", es una base de datos que ya
existe con anterioridad y la cual tiene 14 tablas, una de ellas es
object_vendors

On 20 mar, 13:19, Mariano Reingart  wrote:
> kike:
>
> Antes que nada, hay un grupo de usuarios en 
> español:http://groups.google.com/group/web2py-usuarios
> (web2py-users es para consultas en inglés)
>
> Respecto a tu problema, ¿donde estas definiendo la tabla object_vendors?
>
> En el grupo en español se trato algo similar sobre como usar varias
> bases 
> distintas:http://groups.google.com/group/web2py-usuarios/browse_thread/thread/6...
>
> Sds
>
> Mariano Reingarthttp://reingart.blogspot.com
>
> On Sat, Mar 20, 2010 at 3:01 PM, kike  wrote:
> > disculpenme en donde dice:
> >  auth_table.preference.requires=IS_NOT_EMPTY()
> >  auth_table.second_preference=IS_NOT_EMPTY()
>
> > realmente dice:
>
> > auth_table.preference.requires=IS_IN_DB(vul,'object_vendors.id','object_vendors.name')
> > auth_table.second_preference=IS_IN_DB(vul,'object_products.id','object_products.name')
>
> > On 20 mar, 12:55, kike  wrote:
> >> tengo dos bases de datos distintas, la primera es la que se basa mi
> >> aplicacion, y la segunda es la que crea auth, el problema es que
> >> cuando le digo a auth que coja la informacion de un campo de la
> >> primera base de datos, me dice que no conoce el nombre, aqui les pongo
> >> el codigo y el error:
>
> >> vul=DAL('mysql://root:r...@localhost/sbdv',pool_size=20)
> >> db = DAL('mysql://root:r...@localhost/usbdv',pool_size=20)
>
> >> from gluon.tools import *
> >> auth=Auth(globals(),db)
> >> auth.settings.hmac_key='sha512:582aedbf-4d01-4f41-81ad-ffb7eed2ada4'
> >> auth_table=db.define_table(
> >>     auth.settings.table_user_name,
> >>     Field('first_name', length=128, label='Nombre(s)'),
> >>     Field('last_name', length=128, label='Apellidos'),
> >>     Field('email', length=128, unique=True, label='Correo'),
> >>     Field('password', 'password', length=256, readable=False,
> >> label='Contraseña'),
> >>     Field('registration_key', length=128, writable=False,
> >> readable=False),
> >>     Field('preference', vul.object_vendors.name, label='Preferencia
> >> Principal'),
> >>     Field('second_preference', vul.object_products.name,
> >> label='Preferencia Secundaria'))
>
> >> auth_table.first_name.requires=IS_NOT_EMPTY()
> >> auth_table.last_name.requires=IS_NOT_EMPTY()
> >> auth_table.password.requires=[CRYPT()]
> >> auth_table.email.requires=[IS_EMAIL(), IS_NOT_IN_DB(db,
> >> auth_table.email)]
> >> auth_table.preference.requires=IS_NOT_EMPTY()
> >> auth_table.second_preference=IS_NOT_EMPTY()
> >> auth.settings.table_user=auth_table
> >> auth.define_tables()
>
> >> Traceback (most recent call last):
> >>   File "/home/kike/sbdv/web2py/gluon/restricted.py", line 173, in
> >> restricted
> >>   File "/home/kike/Desktop/web2py/applications/SBDV/models/db.py",
> >> line 40, in 
> >>     Field('preference', vul.object_vendors.name, label='Preferencia
> >> Principal'),
> >>   File "/home/kike/tesis/sbdv/web2py/gluon/sql.py", line 1295, in
> >> __getattr__
> >> KeyError: 'object_vendors'
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "web2py-users" group.
> > To post to this group, send email to web...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > web2py+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/web2py?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] zengarden anybody?

2010-03-20 Thread mdipierro
I just came across this:

http://www.csszengarden.com/

It is one simple html layout (only divs) with 210 PURE CSS skins:

http://www.mezzoblue.com/zengarden/alldesigns/

This could be an option for the welcome app. If we use their html, it
would be trivial to add a small admin option that downloads a team to
zengarden and applies to skin. Options that require overriding the
HTML are more complex to handle.

What do you think?

Massimo

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: problema con la BD

2010-03-20 Thread Mariano Reingart
kike:

Antes que nada, hay un grupo de usuarios en español:
http://groups.google.com/group/web2py-usuarios
(web2py-users es para consultas en inglés)

Respecto a tu problema, ¿donde estas definiendo la tabla object_vendors?

En el grupo en español se trato algo similar sobre como usar varias
bases distintas:
http://groups.google.com/group/web2py-usuarios/browse_thread/thread/6cb57d99806b5ba0

Sds

Mariano Reingart
http://reingart.blogspot.com



On Sat, Mar 20, 2010 at 3:01 PM, kike  wrote:
> disculpenme en donde dice:
>  auth_table.preference.requires=IS_NOT_EMPTY()
>  auth_table.second_preference=IS_NOT_EMPTY()
>
> realmente dice:
>
> auth_table.preference.requires=IS_IN_DB(vul,'object_vendors.id','object_vendors.name')
> auth_table.second_preference=IS_IN_DB(vul,'object_products.id','object_products.name')
>
> On 20 mar, 12:55, kike  wrote:
>> tengo dos bases de datos distintas, la primera es la que se basa mi
>> aplicacion, y la segunda es la que crea auth, el problema es que
>> cuando le digo a auth que coja la informacion de un campo de la
>> primera base de datos, me dice que no conoce el nombre, aqui les pongo
>> el codigo y el error:
>>
>> vul=DAL('mysql://root:r...@localhost/sbdv',pool_size=20)
>> db = DAL('mysql://root:r...@localhost/usbdv',pool_size=20)
>>
>> from gluon.tools import *
>> auth=Auth(globals(),db)
>> auth.settings.hmac_key='sha512:582aedbf-4d01-4f41-81ad-ffb7eed2ada4'
>> auth_table=db.define_table(
>>     auth.settings.table_user_name,
>>     Field('first_name', length=128, label='Nombre(s)'),
>>     Field('last_name', length=128, label='Apellidos'),
>>     Field('email', length=128, unique=True, label='Correo'),
>>     Field('password', 'password', length=256, readable=False,
>> label='Contraseña'),
>>     Field('registration_key', length=128, writable=False,
>> readable=False),
>>     Field('preference', vul.object_vendors.name, label='Preferencia
>> Principal'),
>>     Field('second_preference', vul.object_products.name,
>> label='Preferencia Secundaria'))
>>
>> auth_table.first_name.requires=IS_NOT_EMPTY()
>> auth_table.last_name.requires=IS_NOT_EMPTY()
>> auth_table.password.requires=[CRYPT()]
>> auth_table.email.requires=[IS_EMAIL(), IS_NOT_IN_DB(db,
>> auth_table.email)]
>> auth_table.preference.requires=IS_NOT_EMPTY()
>> auth_table.second_preference=IS_NOT_EMPTY()
>> auth.settings.table_user=auth_table
>> auth.define_tables()
>>
>> Traceback (most recent call last):
>>   File "/home/kike/sbdv/web2py/gluon/restricted.py", line 173, in
>> restricted
>>   File "/home/kike/Desktop/web2py/applications/SBDV/models/db.py",
>> line 40, in 
>>     Field('preference', vul.object_vendors.name, label='Preferencia
>> Principal'),
>>   File "/home/kike/tesis/sbdv/web2py/gluon/sql.py", line 1295, in
>> __getattr__
>> KeyError: 'object_vendors'
>
> --
> You received this message because you are subscribed to the Google Groups 
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to 
> web2py+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/web2py?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: widgets in db.py

2010-03-20 Thread mdipierro
models are executed alphabetically. You have two options:
1) rename one of the files:
2) move the widgets to a module and import the module from db.py


On Mar 20, 12:56 pm, Avik Basu  wrote:
> Hi,
>
> I have a several widgets in a file called widgets.py and would like to
> use those widgets in db.py.  Both db.py and widgets.py exist in the
> models directory.  However, when I use the widgets in defining table
> fields in db.py, it does not recognize the widgets.  How can I include
> the widgets.py in db.py?
>
> Note that some of the the widgets reference the db object and so I
> decided not to put widgets.py in the modules folder since I could not
> reference db and the other globals from web2py.
>
> Thanks for your help.
>
> Avik

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: problema con la BD

2010-03-20 Thread kike
disculpenme en donde dice:
 auth_table.preference.requires=IS_NOT_EMPTY()
 auth_table.second_preference=IS_NOT_EMPTY()

realmente dice:

auth_table.preference.requires=IS_IN_DB(vul,'object_vendors.id','object_vendors.name')
auth_table.second_preference=IS_IN_DB(vul,'object_products.id','object_products.name')

On 20 mar, 12:55, kike  wrote:
> tengo dos bases de datos distintas, la primera es la que se basa mi
> aplicacion, y la segunda es la que crea auth, el problema es que
> cuando le digo a auth que coja la informacion de un campo de la
> primera base de datos, me dice que no conoce el nombre, aqui les pongo
> el codigo y el error:
>
> vul=DAL('mysql://root:r...@localhost/sbdv',pool_size=20)
> db = DAL('mysql://root:r...@localhost/usbdv',pool_size=20)
>
> from gluon.tools import *
> auth=Auth(globals(),db)
> auth.settings.hmac_key='sha512:582aedbf-4d01-4f41-81ad-ffb7eed2ada4'
> auth_table=db.define_table(
>     auth.settings.table_user_name,
>     Field('first_name', length=128, label='Nombre(s)'),
>     Field('last_name', length=128, label='Apellidos'),
>     Field('email', length=128, unique=True, label='Correo'),
>     Field('password', 'password', length=256, readable=False,
> label='Contraseña'),
>     Field('registration_key', length=128, writable=False,
> readable=False),
>     Field('preference', vul.object_vendors.name, label='Preferencia
> Principal'),
>     Field('second_preference', vul.object_products.name,
> label='Preferencia Secundaria'))
>
> auth_table.first_name.requires=IS_NOT_EMPTY()
> auth_table.last_name.requires=IS_NOT_EMPTY()
> auth_table.password.requires=[CRYPT()]
> auth_table.email.requires=[IS_EMAIL(), IS_NOT_IN_DB(db,
> auth_table.email)]
> auth_table.preference.requires=IS_NOT_EMPTY()
> auth_table.second_preference=IS_NOT_EMPTY()
> auth.settings.table_user=auth_table
> auth.define_tables()
>
> Traceback (most recent call last):
>   File "/home/kike/sbdv/web2py/gluon/restricted.py", line 173, in
> restricted
>   File "/home/kike/Desktop/web2py/applications/SBDV/models/db.py",
> line 40, in 
>     Field('preference', vul.object_vendors.name, label='Preferencia
> Principal'),
>   File "/home/kike/tesis/sbdv/web2py/gluon/sql.py", line 1295, in
> __getattr__
> KeyError: 'object_vendors'

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] widgets in db.py

2010-03-20 Thread Avik Basu
Hi,

I have a several widgets in a file called widgets.py and would like to
use those widgets in db.py.  Both db.py and widgets.py exist in the
models directory.  However, when I use the widgets in defining table
fields in db.py, it does not recognize the widgets.  How can I include
the widgets.py in db.py?

Note that some of the the widgets reference the db object and so I
decided not to put widgets.py in the modules folder since I could not
reference db and the other globals from web2py.

Thanks for your help.

Avik

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] problema con la BD

2010-03-20 Thread kike
tengo dos bases de datos distintas, la primera es la que se basa mi
aplicacion, y la segunda es la que crea auth, el problema es que
cuando le digo a auth que coja la informacion de un campo de la
primera base de datos, me dice que no conoce el nombre, aqui les pongo
el codigo y el error:


vul=DAL('mysql://root:r...@localhost/sbdv',pool_size=20)
db = DAL('mysql://root:r...@localhost/usbdv',pool_size=20)

from gluon.tools import *
auth=Auth(globals(),db)
auth.settings.hmac_key='sha512:582aedbf-4d01-4f41-81ad-ffb7eed2ada4'
auth_table=db.define_table(
auth.settings.table_user_name,
Field('first_name', length=128, label='Nombre(s)'),
Field('last_name', length=128, label='Apellidos'),
Field('email', length=128, unique=True, label='Correo'),
Field('password', 'password', length=256, readable=False,
label='Contraseña'),
Field('registration_key', length=128, writable=False,
readable=False),
Field('preference', vul.object_vendors.name, label='Preferencia
Principal'),
Field('second_preference', vul.object_products.name,
label='Preferencia Secundaria'))


auth_table.first_name.requires=IS_NOT_EMPTY()
auth_table.last_name.requires=IS_NOT_EMPTY()
auth_table.password.requires=[CRYPT()]
auth_table.email.requires=[IS_EMAIL(), IS_NOT_IN_DB(db,
auth_table.email)]
auth_table.preference.requires=IS_NOT_EMPTY()
auth_table.second_preference=IS_NOT_EMPTY()
auth.settings.table_user=auth_table
auth.define_tables()





Traceback (most recent call last):
  File "/home/kike/sbdv/web2py/gluon/restricted.py", line 173, in
restricted
  File "/home/kike/Desktop/web2py/applications/SBDV/models/db.py",
line 40, in 
Field('preference', vul.object_vendors.name, label='Preferencia
Principal'),
  File "/home/kike/tesis/sbdv/web2py/gluon/sql.py", line 1295, in
__getattr__
KeyError: 'object_vendors'

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: User Authorization + Download management

2010-03-20 Thread mdipierro
You can put them in db.py after auth=..., or in a registration
controller or simply in the user() action. As long as they are
executed before the registration form runs.

Massimo

On Mar 20, 12:30 pm, Matthew McNaughton 
wrote:
> DO the commands in 1) go into the db.py after auth=Auth(globals(),db) or
> in a new controller that is created for user registration?
>
> On Sat, 2010-03-20 at 08:03 -0700, mdipierro wrote:
> > Good questions:
>
> > 1)
>
> > if not db(db.auth_group.role=='users').count():
> >      db.auth_group.insert(role='users')
> > auth.settings.register_onaccept=lambda form:
> > auth.add_membership(auth.id_group('users'),form.vars.id)
>
> > 2)
> > Not sure what you mean by file renaming. Can you explain more?
> > To keep track of downloads create your own download function
>
> > def download():
> >     ### log the download, filename is in request.args(0) and user in
> > auth.user_id
> >     return response.download(request,db)
>
> > On Mar 20, 2:11 am, Matthew McNaughton  wrote:
> > > Greetings all,
> > > I've read the access control section in book a couple times over, and I
> > > still can't completely figure out authorization. I want to do the
> > > following:
> > > I want to add all newly registered users to a specific group called
> > > "users", which I have already created in auth_groups
>
> > > I have another group called "admin" which can add records to the various
> > > databases. The only way to begin this user is use the web2py
> > > administrator login. Where do I put the access privileges for this
> > > group?
>
> > > A related question. If I have certain files that the user can upload and
> > > download. How do i manage the file renaming in the mysql db? Also, how
> > > do I keep track of the files that a user download from the server.
>
> > > I apologize for the newb questions. Thank you again for all the help so
> > > far.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: web2py on Kodingen?

2010-03-20 Thread mdipierro
I am trying to figure out what it is? Is it a hosting provider with a
web based IDE? Is it a web based IDE can download and use?

On Mar 20, 12:01 pm, Alex Fanjul  wrote:
> Incredible!! i didnt know kodingen...
>
> El 20/03/2010 7:19, mr.freeze escribi :
>
> > It appears that Kodingen can run Django and Ruby apps. Someone with
> > strong Apache-fu should try to get web2py working :)
>
> >http://kodingen.com/?2010/01/27/get-ruby-working/
> >http://kodingen.com/?groups/django-on-kodingen
>
> --
> Alejandro Fanjul Fdez.
> alex.fan...@gmail.comwww.mhproject.org

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: benchmarking: rocket vs pound with four rockets

2010-03-20 Thread Jonathan Lundell
On Mar 20, 2010, at 9:58 AM, Timothy Farrell wrote:

> Vasile Ermicioi, put in a vote for Rocket to be included in web2py because 
> I'm in the web2py community and there is still plenty of room for Rocket to 
> be optimized (which I noted).

I like the idea of built-in servers as plugins (not formally, but the general 
idea of supporting more than one in a simply configured way). The downside is 
that we won't have as focused testing of any one server, but it's compensated 
for by how much easier it would be to include a new server in the release 
without running the risk of breaking existing installations.

As I've said, I don't think that ultimate performance need be a high priority 
for the built-in server; rather, ease of use and rock-solid stability are the 
priorities. And I think I like relying on the SSL package.

My inclination: enable easy server switching. Keep CherryPy the default for at 
least one more release, but make Rocket and sneaky easy to ask for from at 
startup. That'll give those of us who are interested easy access to Rocket in a 
low-risk way. And then at some point, possibly very soon, switch the default to 
Rocket, retaining an easy option for the others as a fallback.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: Debian / Ubuntu packager needed!

2010-03-20 Thread mdipierro
I think this is an excellent idea. Can you take the lead on this? Do
you know any debian developer?

On Mar 20, 12:01 pm, Mark Breedveld  wrote:
> The web2py community is searching help on debian / ubuntu packaging.
> The are concrete plans to deploy web2py as Turnkey Appliance.
>
> http://groups.google.com/group/web2py/browse_thread/thread/7a90b25eef...
>
> But in order to do this in a structural way,
> we need to have web2py packaged.
>
> The first suggestions from our side are as follows.
> - web2py-core.deb //Just web2py // automated process ???
>           - web2py-example.deb //The example apps in web2py
>           - web2py-.deb //automated process ???
>
> mod-apache-web2py-wsgi.deb //configurated web2py with apache trough
> mod_wsgi (now done by a shell script)
>
> The packages above or something like it, are needed for the Turnkey
> Appliance.
>
> Optionaly, could there be made a package for proxy or other webservers
> like the example below.
> mod-apache-web2py-proxy.deb //configurated web2py with apache trough
> mod_proxy
> and so on...
>
> If you have advice or a contribution, please react.
>
> Greetings,
>
> Mark Breedveld,

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: benchmarking: rocket vs pound with four rockets

2010-03-20 Thread mdipierro
Thanks this is clear. I should clarify my position on this.

I always liked cherrypy because it is known to be fast and because
many use it to it has been tested. The problem with cherrypy is that
the code is not as clean as Rocket's.

I also like Rocket because its code is very clean and readable and
because the developer (you) is a member of this community.

Some time ago I tried to rewrite Cherrypy in sneaky but I did not have
time to bring it to production quality. Rocket reminds me of sneaky
both as goals and as design and makes me feel I do not need work on
sneaky any more and I can remove it from web2py.

Speed is an important issue but not the only issue.

Another important issue is long term support. Are you Tim committed to
supporting Rocket long term?

With the numbers I have seen I still lean towards rockets, but I would
like to see more benchmakrs with pound (and/or haproxy).

I would also like to hear more opinions from other users on this
matter.

Even if we default to one of the two, we could setup web2py to give
users a choice (at least for a while). There may be problems with
openssl vs ssl, but I think they can be resolved. Eventually I think
we better make a choice and pack only one of the two.

Massimo

P.S. Binary web servers are not an option.

On Mar 20, 11:58 am, "Timothy Farrell"  wrote:
> Summary:
>
> First, I'll speak in the context of a single instance of Rocket.  I'll talk 
> about pound in a bit.
>
> ApacheBench, which I used to test Rocket, unfairly accentuates the benefits 
> of Rocket.  httperf allows for a much fairer test.  The httperf configuration 
> that Kuba used tested a non-standard situation (while applicable to a project 
> he's working on) that accentuates a known weakness of Rocket over Cherrypy.  
> Even though the single-instance test was inconclusive the multi-instance test 
> implied that Rocket would be slower in the single instance.
>
> Because my tests and Kuba's tests focused on polar opposite situations, the 
> numbers were different.
>
> Nicholas Piel tested version 1.0.1 which did not include epoll support so his 
> initial conclusions, while correct for the time, are no longer accurate.
>
> The difference in situations revolves around how many HTTP requests are 
> pipelined over a single connection.  ApacheBench puts them all in a few 
> connections, httperf allows for configuring this.  Kuba's benchmark settings 
> put one request per connection.  A real-world setting is something around 10, 
> which Nicholas Piel uses.
>
> Kuba released another round of tests that follow Nicholas Piel's HTTP/1.1 
> tests (10 requests per connection).  The results showed Rocket as performing 
> slightly faster.
>
> Now, let's talk about pound.  I've not used pound for any tests before so 
> this was all new information to me.  The first test showed 4 instances of 
> Rocket behind pound to be slower than 4 instances of Cherrypy behind pound on 
> a Quad-core machine.  There are several possible explanations for this.  All 
> of the explanations require more development on Rocket to work around.  The 
> difference in performance would not be a show-stopper for me, but others may 
> disagree.
>
> I've asked Kuba to retest 4xRocket vs. 4xCherrypy with the second test 
> configuration.
>
> Vasile Ermicioi, put in a vote for Rocket to be included in web2py because 
> I'm in the web2py community and there is still plenty of room for Rocket to 
> be optimized (which I noted).
>
> Now you're up-to-date.
>
> -tim
>
> -Original Message-
> From: "mdipierro" 
> Sent: Friday, March 19, 2010 9:01pm
> To: "web2py-users" 
> Subject: [web2py] Re: benchmarking: rocket vs pound with four rockets
>
> had a long day, can somebody provide an execute summary of all the
> tests?
>
> On Mar 19, 3:33 pm, Timothy Farrell  wrote:
> > Thank you Kuba.  Would you mind re-running the 4x pound test like this also?
>
> > On 3/19/2010 3:09 PM, Kuba Kucharski wrote:
>
> > > One instance of each, with 10 calls in a connection as it is closer to
> > > reallife scenario:
> > > (numbers speak for themselves)
>
> > > CHERRYPY:
>
> > > r...@kubatron:/home/kuba/httperf-0.9.0/src# ./httperf --hog --server
> > > 192.168.0.1 --port=8000 ==uri=/vae/default/benchmark2
> > > --num-conns=1 --num-calls=10
> > > httperf --hog --client=0/1 --server=192.168.0.1 --port=8000 --uri=/
> > > --send-buffer=4096 --recv-buffer=16384 --num-conns=1
> > > --num-calls=10
>
> > > Maximum connect burst length: 1
>
> > > Total: connections 1 requests 10 replies 10 test-duration 
> > > 67.659 s
>
> > > Connection rate: 147.8 conn/s (6.8 ms/conn,<=1 concurrent connections)
> > > Connection time [ms]: min 6.2 avg 6.8 max 10.5 median 6.5 stddev 0.2
> > > Connection time [ms]: connect 0.1
> > > Connection length [replies/conn]: 10.000
>
> > > Request rate: 1478.0 req/s (0.7 ms/req)
> > > Request size [B]: 64.0
>
> > > Reply rate [replies/s]: min 1474.7 avg 1478.0 max 1480.3 stddev 2.0 (13 
> > > samples)
> > > 

Re: [web2py] Re: User Authorization + Download management

2010-03-20 Thread Matthew McNaughton
DO the commands in 1) go into the db.py after auth=Auth(globals(),db) or
in a new controller that is created for user registration?

On Sat, 2010-03-20 at 08:03 -0700, mdipierro wrote:
> Good questions:
> 
> 1)
> 
> if not db(db.auth_group.role=='users').count():
>  db.auth_group.insert(role='users')
> auth.settings.register_onaccept=lambda form:
> auth.add_membership(auth.id_group('users'),form.vars.id)
> 
> 2)
> Not sure what you mean by file renaming. Can you explain more?
> To keep track of downloads create your own download function
> 
> def download():
> ### log the download, filename is in request.args(0) and user in
> auth.user_id
> return response.download(request,db)
> 
> 
> On Mar 20, 2:11 am, Matthew McNaughton  wrote:
> > Greetings all,
> > I've read the access control section in book a couple times over, and I
> > still can't completely figure out authorization. I want to do the
> > following:
> > I want to add all newly registered users to a specific group called
> > "users", which I have already created in auth_groups
> >
> > I have another group called "admin" which can add records to the various
> > databases. The only way to begin this user is use the web2py
> > administrator login. Where do I put the access privileges for this
> > group?
> >
> > A related question. If I have certain files that the user can upload and
> > download. How do i manage the file renaming in the mysql db? Also, how
> > do I keep track of the files that a user download from the server.
> >
> > I apologize for the newb questions. Thank you again for all the help so
> > far.
> 


-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: web2py beautification

2010-03-20 Thread mdipierro
Yarko did it! The new welcome with ez.css is in trunk. We still need
do add something to allow skinning and rearrange the css (right now we
have:

applications/welcome/static/base.css
applications/welcome/static/calendar.css
applications/welcome/static/ez-plug-min.css
applications/welcome/static/ez-plug.css

massimo



On Mar 19, 6:05 pm, Yarko Tymciurak 
wrote:
> On Mar 19, 2:24 am, mdipierro  wrote:
>
> > I played with ez-css (which I like) but yet it reminded why I used
> > tables.
>
> Yeah - the presence of tables in the layout really causes troubles!
>
> > Here is my problem and I am sure it is just me being dumb. Say
> > I want a header, a footer and two columns in between. I want the left
> > column of fixed with (a menu, 200px) and a right column to foll the
> > rest of the space (content). Because of the way it works (and most of
> > these frameworks work the same way), the columns float to right
> > therefore I must specifycontent before the menu. Hence I cannot find a
> > way to make the menu fixed width and the content fill the rest of the
> > space without messing up the alignment of the boxes. Can you do it?
>
> If I understand you, I think this is pretty easy w/ ez-css.   I have
> now done a few layouts w/ it in web2py (as of last night), and have
> sent you an ez-css layout.html for "welcome" app (it uses the css
> classes from base.css, but a few settings that were assigned to table
> elements, I had to update / put elsewhere - base.css has minor
> changes;  ez-plug.css remains stock).
>
> There are probably other things that could be cleaned up in base.css,
> but this was pretty easy (once I realized how to go about it).
>
> - Yarko
>
>
>
> > Massimo
>
> > On Mar 18, 11:46 pm, Yarko Tymciurak 
> > wrote:
>
> > > On Mar 18, 10:31 pm, mdipierro  wrote:
>
> > > > The problem I see is that it is too simple.
> > > > sizeXofY does not seem to guarantee that all columns have the same
> > > > lenght (ez-css does it).
> > > > I like to have the menu column fixed width and the main column elastic
> > > > and it does not do that (not sure if ez-css does).
>
> > > I have installed ez-css to try out / play with...  it does do fixed
> > > width + variable width columns:
>
> > > In multiple ways, actually (depending on how you nest it);   
> > > seehttp://www.ez-css.org/layouts
>
> > > See module 2A, 2B, layout 2, layout 3, etc
>
> > > Each of these use "ez-50", a 50% width element, or "ez-33", a 33%
> > > width element.
>
> > > ez-css encourages you to create your own width element if the pre-
> > > defined ones don't "do it" for you - so, create a
> > > ez-500px, and you'd have what you want.
>
> > > This seems like a really clean, easily modifiable and "combinable"
> > > package...  I'm going to play with it in the next few days to see how
> > > my opinion holds up in use.
>
> > > - Yarko
>
> > > > On Mar 18, 8:59 pm, villas  wrote:
>
> > > > > Ez-css seems like a good enough option,  but before making your mind
> > > > > up, have a look at the simplicity of oocss.org/grids_docs.html (with
> > > > > Firebug).  Oocss might give more possibilities,  but admittedly, is
> > > > > heavier.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Mailing list.

2010-03-20 Thread annet
In my application I have a table npa which contains non-physical
addresses, i.e. telephone numbers, fax numbers, e-mail addresses etc.
that are displayed on business cards. This table has a field company
which references a table company. Initially I inserted addresses into
these tables which I got from the Chamber of Commerce. Now I would
like to send a first e-mail to these companies, based on the e-mail
addresses in the npa table. In this first mail the recipient gets the
opportunity to register himself as contact person for a company. The
table contact_person contains a field e-mail_address, which I would
like to use for future promotional e-mails, instead of the e-mail
address in the npa table. However, if the recipient doesn't register
as a contact person, I have to be able to use the e-mail address from
the npa table.

Furthermore, I need a table which keeps track of the unsubscribe
request.

Did one of you face a similar problem? How did you solve it?

Kind regards,

Annet.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: Using the Template System to Generate Emails

2010-03-20 Thread Thadeus Burgess
cache the mail and only access it if its no longer cached?

Or have a table that stores all sent mailings

sent_mail
  -> bedrijf
  -> message

You still query the database, but you have to store the info somewhere
at some point in time if it is to be accessed later.

-Thadeus





On Sat, Mar 20, 2010 at 6:06 AM, annet  wrote:
> I have another question:
>
> In case the user would like to view the html mail in his browser, I
> have got the following line of code:
>
> 
>    {{if not request.function=='browser_version':}}
>   Having trouble viewing this email?  href="{{=URL(r=request,c='clublocatormail',f='browser_version',args=[nfa.bedrijf])}}">View
> it in your browser
>    {{pass}}
> 
>
>
> I would like to use the same view, however, that view contains the
> variable nfa.bedrijf, which, in case of the mail, is available from
> the context. The link to the browser_version function contains
> args=[nfa.bedrijf], so nfa.bedrijf is available as request.args[0] in
> the browser_version function, but I don't now to pass it on to the
> view in a suitable way.
>
> I could do:
>
> def browser_version():
>    response.view='send_mail.html'
>
> nfa=db((db.nfa.nfatype==4)&(db.nfa.bedrijf==request.args[0])).select(db.nfa.ALL)
>    return dict(nfa=nfa)
>
> ..., but that would unnecessarily query the database. Is there another
> way to solve this problem?
>
>
> Kind regards,
>
> Annet.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to 
> web2py+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/web2py?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] web2py on Kodingen?

2010-03-20 Thread Alex Fanjul

Incredible!! i didnt know kodingen...

El 20/03/2010 7:19, mr.freeze escribió:

It appears that Kodingen can run Django and Ruby apps. Someone with
strong Apache-fu should try to get web2py working :)

http://kodingen.com/?2010/01/27/get-ruby-working/
http://kodingen.com/?groups/django-on-kodingen

   


--
Alejandro Fanjul Fdez.
alex.fan...@gmail.com
www.mhproject.org

--
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Debian / Ubuntu packager needed!

2010-03-20 Thread Mark Breedveld
The web2py community is searching help on debian / ubuntu packaging.
The are concrete plans to deploy web2py as Turnkey Appliance.

http://groups.google.com/group/web2py/browse_thread/thread/7a90b25eef35660e/215e9080c73c8049?hl=en&lnk=gst&q=turnkey#215e9080c73c8049

But in order to do this in a structural way,
we need to have web2py packaged.

The first suggestions from our side are as follows.
- web2py-core.deb //Just web2py // automated process ???
  - web2py-example.deb //The example apps in web2py
  - web2py-.deb //automated process ???

mod-apache-web2py-wsgi.deb //configurated web2py with apache trough
mod_wsgi (now done by a shell script)

The packages above or something like it, are needed for the Turnkey
Appliance.

Optionaly, could there be made a package for proxy or other webservers
like the example below.
mod-apache-web2py-proxy.deb //configurated web2py with apache trough
mod_proxy
and so on...

If you have advice or a contribution, please react.

Greetings,

Mark Breedveld,

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



RE: [web2py] Re: benchmarking: rocket vs pound with four rockets

2010-03-20 Thread Timothy Farrell
Summary:

First, I'll speak in the context of a single instance of Rocket.  I'll talk 
about pound in a bit.

ApacheBench, which I used to test Rocket, unfairly accentuates the benefits of 
Rocket.  httperf allows for a much fairer test.  The httperf configuration that 
Kuba used tested a non-standard situation (while applicable to a project he's 
working on) that accentuates a known weakness of Rocket over Cherrypy.  Even 
though the single-instance test was inconclusive the multi-instance test 
implied that Rocket would be slower in the single instance.

Because my tests and Kuba's tests focused on polar opposite situations, the 
numbers were different.

Nicholas Piel tested version 1.0.1 which did not include epoll support so his 
initial conclusions, while correct for the time, are no longer accurate.

The difference in situations revolves around how many HTTP requests are 
pipelined over a single connection.  ApacheBench puts them all in a few 
connections, httperf allows for configuring this.  Kuba's benchmark settings 
put one request per connection.  A real-world setting is something around 10, 
which Nicholas Piel uses.

Kuba released another round of tests that follow Nicholas Piel's HTTP/1.1 tests 
(10 requests per connection).  The results showed Rocket as performing slightly 
faster.

Now, let's talk about pound.  I've not used pound for any tests before so this 
was all new information to me.  The first test showed 4 instances of Rocket 
behind pound to be slower than 4 instances of Cherrypy behind pound on a 
Quad-core machine.  There are several possible explanations for this.  All of 
the explanations require more development on Rocket to work around.  The 
difference in performance would not be a show-stopper for me, but others may 
disagree.

I've asked Kuba to retest 4xRocket vs. 4xCherrypy with the second test 
configuration.

Vasile Ermicioi, put in a vote for Rocket to be included in web2py because I'm 
in the web2py community and there is still plenty of room for Rocket to be 
optimized (which I noted).

Now you're up-to-date.

-tim

-Original Message-
From: "mdipierro" 
Sent: Friday, March 19, 2010 9:01pm
To: "web2py-users" 
Subject: [web2py] Re: benchmarking: rocket vs pound with four rockets

had a long day, can somebody provide an execute summary of all the
tests?

On Mar 19, 3:33 pm, Timothy Farrell  wrote:
> Thank you Kuba.  Would you mind re-running the 4x pound test like this also?
>
> On 3/19/2010 3:09 PM, Kuba Kucharski wrote:
>
> > One instance of each, with 10 calls in a connection as it is closer to
> > reallife scenario:
> > (numbers speak for themselves)
>
> > CHERRYPY:
>
> > r...@kubatron:/home/kuba/httperf-0.9.0/src# ./httperf --hog --server
> > 192.168.0.1 --port=8000 ==uri=/vae/default/benchmark2
> > --num-conns=1 --num-calls=10
> > httperf --hog --client=0/1 --server=192.168.0.1 --port=8000 --uri=/
> > --send-buffer=4096 --recv-buffer=16384 --num-conns=1
> > --num-calls=10
>
> > Maximum connect burst length: 1
>
> > Total: connections 1 requests 10 replies 10 test-duration 
> > 67.659 s
>
> > Connection rate: 147.8 conn/s (6.8 ms/conn,<=1 concurrent connections)
> > Connection time [ms]: min 6.2 avg 6.8 max 10.5 median 6.5 stddev 0.2
> > Connection time [ms]: connect 0.1
> > Connection length [replies/conn]: 10.000
>
> > Request rate: 1478.0 req/s (0.7 ms/req)
> > Request size [B]: 64.0
>
> > Reply rate [replies/s]: min 1474.7 avg 1478.0 max 1480.3 stddev 2.0 (13 
> > samples)
> > Reply time [ms]: response 0.6 transfer 0.0
> > Reply size [B]: header 205.0 content 66.0 footer 2.0 (total 273.0)
> > Reply status: 1xx=0 2xx=0 3xx=10 4xx=0 5xx=0
>
> > CPU time [s]: user 25.67 system 41.99 (user 37.9% system 62.1% total 100.0%)
> > Net I/O: 483.5 KB/s (4.0*10^6 bps)
>
> > Errors: total 0 client-timo 0 socket-timo 0 connrefused 0 connreset 0
> > Errors: fd-unavail 0 addrunavail 0 ftab-full 0 other 0
>
> > ROCKET:
>
> > r...@kubatron:/home/kuba/httperf-0.9.0/src# ./httperf --hog --server
> > 192.168.0.1 --port=8000 ==uri=/vae/default/benchmark2
> > --num-conns=1 --num-calls=10
> > httperf --hog --client=0/1 --server=192.168.0.1 --port=8000 --uri=/
> > --send-buffer=4096 --recv-buffer=16384 --num-conns=1
> > --num-calls=10
> > Maximum connect burst length: 1
>
> > Total: connections 1 requests 10 replies 10 test-duration 
> > 64.760 s
>
> > Connection rate: 154.4 conn/s (6.5 ms/conn,<=1 concurrent connections)
> > Connection time [ms]: min 5.9 avg 6.5 max 72.7 median 6.5 stddev 1.0
> > Connection time [ms]: connect 0.1
> > Connection length [replies/conn]: 10.000
>
> > Request rate: 1544.2 req/s (0.6 ms/req)
> > Request size [B]: 64.0
>
> > Reply rate [replies/s]: min 1526.9 avg 1544.2 max 1555.9 stddev 8.6 (12 
> > samples)
> > Reply time [ms]: response 0.6 transfer 0.0
> > Reply size [B]: header 216.0 content 66.0 footer 0.0 (total 282.0)
> > Reply status: 1xx=0 2xx=0 3xx=10 4xx=0 5xx=0
>
> > CPU time [s]: user 24.

[web2py] Re: trunkeylinux help

2010-03-20 Thread Mark Breedveld
No, but it's well documented.
So if we may not find any help, then i'll could try it on my own.

My first search results...
https://wiki.ubuntu.com/PackagingGuide
https://wiki.ubuntu.com/UbuntuDevelopment#Packaging

I'm also trying to launch it as a project on my school.
But it's a slow proces which will take a while.

We could launch a new post.
Maybe there is one in the web2py community.

greetings Mark Breedveld,

On Mar 20, 5:31 pm, mdipierro  wrote:
> I think this is a great idea. Do you know any debian developer?
>
> On Mar 20, 10:21 am, Mark Breedveld  wrote:
>
> > I also have an other suggestion.
> > Is it nog possible to search a community member to make a debian
> > package of web2py.
>
> > My suggestions are to make the following package structure.
> > - web2py_core.deb //Just web2py
> > - web2py_.deb // A web2py app package example
> > (web2py_cookbook.deb)
> > - mod_apache_wsgi_web2py.deb // Configurates web2py as wsgi server
> > - mod_apache_proxy_web2py.deb // Configurates web2py as proxy server
>
> > This will make web2py much easier to install, maintain and
> > distrubute.
>
> > I'm not an debian packager, but i'll wil dive into it.
> > In the mean while you could find a debian packager.
> > And publish improved patches.
>
> > I would like to hear your opinion on this topic.
>
> > greetings Mark Breedveld,
>
> > On Mar 3, 2:38 pm, Mark Breedveld  wrote:
>
> > > I've done some research onturnkey.
> > > And its much better than the thing a made.
>
> > > I will test it in the coming week.
> > > and the results will come as soon as possible.
>
> > > regards,
>
> > > Mark Breedveld,
>
> > > On 17 feb, 07:41, Massimo Di Pierro  wrote:
>
> > > > I am trying to make a web2py appliance forturnkeylinux. Once done  
> > > > this will run on xen, vmware and ec2.
>
> > > > I could use some help. Try this.
>
> > > > RUN THIS IN A VIRTUAL MACHINE BECAUSE I AM NOT SURE HOW tkpatch  
> > > > THEREFORE I DO NOT KNOW IF THIS MAY MESS UP YOUR SYSTEM. although  
> > > > probably not.
>
> > > >  From a linux box, possibly a virtual machine, as root type
>
> > > > mkdir tkl
> > > > cd tkl
> > > > apt-get install squashfs-tools genisoimage tar gzip git
> > > > git clone git://github.com/turnkeylinux/tklpatch.git
> > > > cd tklpatch
> > > > make install
> > > > cd ..
> > > > rm -r tkpatch
> > > > wgethttp://downloads.sourceforge.net/project/turnkeylinux/turnkey-lapp/20...
> > > > unzip web2py_patch.zip  < the attached file
> > > > tklpatchturnkey-lapp-2009.10-hardy-x86.iso web2py_patch
>
> > > > This should make a new ISO image that starts up with web2py,  
> > > > phppgadmin, webmin, web based os shell, etc.
>
> > > > Let me know if you manage to try.
>
> > > > More detailed explanations are 
> > > > here:http://www.turnkeylinux.org/docs/tklpatch
>
> > > > Massimo

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: trunkeylinux help

2010-03-20 Thread mdipierro
I think this is a great idea. Do you know any debian developer?

On Mar 20, 10:21 am, Mark Breedveld  wrote:
> I also have an other suggestion.
> Is it nog possible to search a community member to make a debian
> package of web2py.
>
> My suggestions are to make the following package structure.
> - web2py_core.deb //Just web2py
> - web2py_.deb // A web2py app package example
> (web2py_cookbook.deb)
> - mod_apache_wsgi_web2py.deb // Configurates web2py as wsgi server
> - mod_apache_proxy_web2py.deb // Configurates web2py as proxy server
>
> This will make web2py much easier to install, maintain and
> distrubute.
>
> I'm not an debian packager, but i'll wil dive into it.
> In the mean while you could find a debian packager.
> And publish improved patches.
>
> I would like to hear your opinion on this topic.
>
> greetings Mark Breedveld,
>
> On Mar 3, 2:38 pm, Mark Breedveld  wrote:
>
> > I've done some research onturnkey.
> > And its much better than the thing a made.
>
> > I will test it in the coming week.
> > and the results will come as soon as possible.
>
> > regards,
>
> > Mark Breedveld,
>
> > On 17 feb, 07:41, Massimo Di Pierro  wrote:
>
> > > I am trying to make a web2py appliance forturnkeylinux. Once done  
> > > this will run on xen, vmware and ec2.
>
> > > I could use some help. Try this.
>
> > > RUN THIS IN A VIRTUAL MACHINE BECAUSE I AM NOT SURE HOW tkpatch  
> > > THEREFORE I DO NOT KNOW IF THIS MAY MESS UP YOUR SYSTEM. although  
> > > probably not.
>
> > >  From a linux box, possibly a virtual machine, as root type
>
> > > mkdir tkl
> > > cd tkl
> > > apt-get install squashfs-tools genisoimage tar gzip git
> > > git clone git://github.com/turnkeylinux/tklpatch.git
> > > cd tklpatch
> > > make install
> > > cd ..
> > > rm -r tkpatch
> > > wgethttp://downloads.sourceforge.net/project/turnkeylinux/turnkey-lapp/20...
> > > unzip web2py_patch.zip  < the attached file
> > > tklpatchturnkey-lapp-2009.10-hardy-x86.iso web2py_patch
>
> > > This should make a new ISO image that starts up with web2py,  
> > > phppgadmin, webmin, web based os shell, etc.
>
> > > Let me know if you manage to try.
>
> > > More detailed explanations are 
> > > here:http://www.turnkeylinux.org/docs/tklpatch
>
> > > Massimo

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: trunkeylinux help

2010-03-20 Thread Mark Breedveld
I also have an other suggestion.
Is it nog possible to search a community member to make a debian
package of web2py.

My suggestions are to make the following package structure.
- web2py_core.deb //Just web2py
- web2py_.deb // A web2py app package example
(web2py_cookbook.deb)
- mod_apache_wsgi_web2py.deb // Configurates web2py as wsgi server
- mod_apache_proxy_web2py.deb // Configurates web2py as proxy server

This will make web2py much easier to install, maintain and
distrubute.

I'm not an debian packager, but i'll wil dive into it.
In the mean while you could find a debian packager.
And publish improved patches.

I would like to hear your opinion on this topic.

greetings Mark Breedveld,

On Mar 3, 2:38 pm, Mark Breedveld  wrote:
> I've done some research onturnkey.
> And its much better than the thing a made.
>
> I will test it in the coming week.
> and the results will come as soon as possible.
>
> regards,
>
> Mark Breedveld,
>
> On 17 feb, 07:41, Massimo Di Pierro  wrote:
>
> > I am trying to make a web2py appliance forturnkeylinux. Once done  
> > this will run on xen, vmware and ec2.
>
> > I could use some help. Try this.
>
> > RUN THIS IN A VIRTUAL MACHINE BECAUSE I AM NOT SURE HOW tkpatch  
> > THEREFORE I DO NOT KNOW IF THIS MAY MESS UP YOUR SYSTEM. although  
> > probably not.
>
> >  From a linux box, possibly a virtual machine, as root type
>
> > mkdir tkl
> > cd tkl
> > apt-get install squashfs-tools genisoimage tar gzip git
> > git clone git://github.com/turnkeylinux/tklpatch.git
> > cd tklpatch
> > make install
> > cd ..
> > rm -r tkpatch
> > wgethttp://downloads.sourceforge.net/project/turnkeylinux/turnkey-lapp/20...
> > unzip web2py_patch.zip  < the attached file
> > tklpatchturnkey-lapp-2009.10-hardy-x86.iso web2py_patch
>
> > This should make a new ISO image that starts up with web2py,  
> > phppgadmin, webmin, web based os shell, etc.
>
> > Let me know if you manage to try.
>
> > More detailed explanations are 
> > here:http://www.turnkeylinux.org/docs/tklpatch
>
> > Massimo

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: joins, geraldo and possible alias

2010-03-20 Thread mdipierro

created_by=db.Users.with_alias('created_by')
handled_by=db.Users.with_alias('handled_by')
rows =
db(db.Calls.id>0).select(db.Calls.ALL,db.created_by.name,db.handled_by.name,
   left=[created_by.on(created_by.id==db.Calls.CreatedBy),
   handled_by.on(handled_by.id==db.Calls.HandledBy)])


On Mar 20, 6:58 am, jonatron  wrote:
> Hi,
>
> I am hoping someone can help with this:
>
> I have tables setup something like this (this is a simplified
> representation):
>
> db.define_table('Users',
> Field('Name'))
>
> db.define_table('Calls',
> Field('CallerName'),
> Field('CreatedBy', db.Users),
> Field('HandledBy', db.Users))
>
> I need to produce a query set to send to geraldo reports that joins
> both the createdby and handledby fields to db.users.id so that I can
> display the users name in the report not the id.  I can do one inner
> join no problem and use Users.Name to get the name.  To do both joins
> and get useful data I think I need to do something analogue SQL AS on
> the joins and then access the data using an alias.  I have played with
> with_alias but don't seem to get what I need.  Can anyone point me in
> the right direction?

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: trunkeylinux help

2010-03-20 Thread Mark Breedveld
Hello,

I'll have tried it again on a turnkey machine on a ESXi 3.5 machine.
But it returns the same error.

rm cannot remove  'web2py_src.zip*

This ain't strange, because you want to remove a file in an folder you
just created.

My suggestions are as following.
place the rm web2py_src.zip after unzip web2py_src.zip.

I haven't test the above statement.
But i will once you have released an new patch.

greetings Mark Breedveld,




On Mar 12, 1:42 pm, Christopher Steel  wrote:
> I will check this out for you later today as well.
>
> Chris
>
> On Feb 17, 1:41 am, Massimo Di Pierro  wrote:
>
> > I am trying to make a web2py appliance forturnkeylinux. Once done  
> > this will run on xen, vmware and ec2.
>
> > I could use some help. Try this.
>
> > RUN THIS IN A VIRTUAL MACHINE BECAUSE I AM NOT SURE HOW tkpatch  
> > THEREFORE I DO NOT KNOW IF THIS MAY MESS UP YOUR SYSTEM. although  
> > probably not.
>
> >  From a linux box, possibly a virtual machine, as root type
>
> > mkdir tkl
> > cd tkl
> > apt-get install squashfs-tools genisoimage tar gzip git
> > git clone git://github.com/turnkeylinux/tklpatch.git
> > cd tklpatch
> > make install
> > cd ..
> > rm -r tkpatch
> > wgethttp://downloads.sourceforge.net/project/turnkeylinux/turnkey-lapp/20...
> > unzip web2py_patch.zip  < the attached file
> > tklpatchturnkey-lapp-2009.10-hardy-x86.iso web2py_patch
>
> > This should make a new ISO image that starts up with web2py,  
> > phppgadmin, webmin, web based os shell, etc.
>
> > Let me know if you manage to try.
>
> > More detailed explanations are 
> > here:http://www.turnkeylinux.org/docs/tklpatch
>
> > Massimo

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: User Authorization + Download management

2010-03-20 Thread mdipierro
Good questions:

1)

if not db(db.auth_group.role=='users').count():
 db.auth_group.insert(role='users')
auth.settings.register_onaccept=lambda form:
auth.add_membership(auth.id_group('users'),form.vars.id)

2)
Not sure what you mean by file renaming. Can you explain more?
To keep track of downloads create your own download function

def download():
### log the download, filename is in request.args(0) and user in
auth.user_id
return response.download(request,db)


On Mar 20, 2:11 am, Matthew McNaughton  wrote:
> Greetings all,
> I've read the access control section in book a couple times over, and I
> still can't completely figure out authorization. I want to do the
> following:
> I want to add all newly registered users to a specific group called
> "users", which I have already created in auth_groups
>
> I have another group called "admin" which can add records to the various
> databases. The only way to begin this user is use the web2py
> administrator login. Where do I put the access privileges for this
> group?
>
> A related question. If I have certain files that the user can upload and
> download. How do i manage the file renaming in the mysql db? Also, how
> do I keep track of the files that a user download from the server.
>
> I apologize for the newb questions. Thank you again for all the help so
> far.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] joins, geraldo and possible alias

2010-03-20 Thread jonatron
Hi,

I am hoping someone can help with this:

I have tables setup something like this (this is a simplified
representation):

db.define_table('Users',
Field('Name'))

db.define_table('Calls',
Field('CallerName'),
Field('CreatedBy', db.Users),
Field('HandledBy', db.Users))

I need to produce a query set to send to geraldo reports that joins
both the createdby and handledby fields to db.users.id so that I can
display the users name in the report not the id.  I can do one inner
join no problem and use Users.Name to get the name.  To do both joins
and get useful data I think I need to do something analogue SQL AS on
the joins and then access the data using an alias.  I have played with
with_alias but don't seem to get what I need.  Can anyone point me in
the right direction?

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: Using the Template System to Generate Emails

2010-03-20 Thread annet
I have another question:

In case the user would like to view the html mail in his browser, I
have got the following line of code:


{{if not request.function=='browser_version':}}
   Having trouble viewing this email? View
it in your browser
{{pass}}



I would like to use the same view, however, that view contains the
variable nfa.bedrijf, which, in case of the mail, is available from
the context. The link to the browser_version function contains
args=[nfa.bedrijf], so nfa.bedrijf is available as request.args[0] in
the browser_version function, but I don't now to pass it on to the
view in a suitable way.

I could do:

def browser_version():
response.view='send_mail.html'
 
nfa=db((db.nfa.nfatype==4)&(db.nfa.bedrijf==request.args[0])).select(db.nfa.ALL)
return dict(nfa=nfa)

..., but that would unnecessarily query the database. Is there another
way to solve this problem?


Kind regards,

Annet.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: Using the Template System to Generate Emails

2010-03-20 Thread annet
Denes and Alexandre,

Your replies were very helpful and helped me understand and solve the
problem, thanks.


Thadeus,

> Use the following class lined out in the wiki, works like a charm.

I will, in one of the next iterations. At the moment I am not yet
proficient enough in Python to completely understand the class
outlined in the wiki, and consequently unable to use it properly.


Kind regards,

Annet.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: PyPy 1.2 released!

2010-03-20 Thread Joe Barnhart
I installed PyPy on a Mac.  I discovered it needs openssl to run, so I
used MacPorts to install openssl and everything ran as expected.  I
was able to run web2py.py under PyPy and the management interface
works perfectly!  BUT...

I'm gettng a Sqlite3 error whenever I try to run a site:

Traceback (most recent call last):
  File "/Users/xxx/Work/web2py/gluon/restricted.py", line 173, in
restricted
exec ccode in environment
  File "/Users/xxx/Work/web2py/applications/yyy/models/db.py", line 9,
in 
db=SQLDB('sqlite://swim.db')# if not, use SQLite or
other DB
  File "/Users/xxx/Work/web2py/gluon/sql.py", line 889, in __init__
self._pool_connection(lambda : sqlite3.Connection(dbpath,
  File "/Users/xxx/Work/web2py/gluon/sql.py", line 829, in
_pool_connection
self._connection = f()
  File "/Users/xxx/Work/web2py/gluon/sql.py", line 889, in 
self._pool_connection(lambda : sqlite3.Connection(dbpath,
AttributeError: 'module' object has no attribute 'Connection'


On Mar 19, 7:06 pm, mdipierro  wrote:
> Keep us posted. this is important!

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] User Authorization + Download management

2010-03-20 Thread Matthew McNaughton
Greetings all,
I've read the access control section in book a couple times over, and I
still can't completely figure out authorization. I want to do the
following:
I want to add all newly registered users to a specific group called
"users", which I have already created in auth_groups

I have another group called "admin" which can add records to the various
databases. The only way to begin this user is use the web2py
administrator login. Where do I put the access privileges for this
group?

A related question. If I have certain files that the user can upload and
download. How do i manage the file renaming in the mysql db? Also, how
do I keep track of the files that a user download from the server.

I apologize for the newb questions. Thank you again for all the help so
far.


-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.