[web2py] Re: .update_or_insert not optimized!!

2012-05-03 Thread puercoespin



> You're manual version updates only two fields, whereas update_or_insert 
> updates six fields -- maybe that's the difference.
>
> Anthony 
>

Yes, but I want to insert a new record with six fields, but update only two 
if the record exists. How to do that with .update_or_insert?

 


[web2py] Re: web2py resources

2012-05-03 Thread puercoespin
Maybe it can include  blogs about web2py from the users of web2py-users 
group, exemple Omi Chiba, Bruno or Martin Mulone, (to cite a few).



El lunes, 30 de abril de 2012 21:49:41 UTC+2, Anthony escribió:
>
> Most web2py resources can be found on web2py.com, but here are some 
> Google Groups topics identifying additional resources:
>
> web2py help & 
> resources
> Plugins
> Signature 
> apps
> Featured web2py 
> apps
> web2py 
> hosting
>


[web2py] Anyone having experience creating FaceBook apps using web2py and GAE?

2012-05-03 Thread David Marko
Anyone havng experience creating FaceBook apps using web2py and GAE? GAE 
can be used for this, just want to know whether expect any technical 
obstacles/dificulties when using web2py for this?

Thank you,
David


[web2py] An insult to web2py ?

2012-05-03 Thread António Ramos
a person just wrote this about web2py in a portuguese forum
Anyone care to coment?


Viva,

Eu conheci primeiro o web2py e só uns meses depois o Django.
Ao início achei bastante interessante (a ferramenta de admin, tutorial
fácil de seguir, etc.). O que me fez saltar do web2py para o django e nunca
voltar para trás foi, entre outros, o seguinte:

- web2py não tem um ORM, tem uma api OO mas que segue o mesmo paradigma de
SQL, No fundo, ao fazer .select() / .union() estamos a escrever SQL
disfarçado. Um bom ORM permite não ter de escrever SQL em 90% dos casos,
poupando trabalho.

- Os objectos retornados pela camada de persistência do web2py não têm
classes que façam sentido no domínio (Books, Persons, whatever seja o
domínio), aquilo retorna umas instâncias de Record (ou lá o que é) que não
são mais do que dicts. O mapeamento disso para instâncias de classes do
domínio tem de ser feito à mão.

- A ideia de poder meter python arbitrário no template parece gira mas
facilmente descamba para ficheiros com python+html+javascript tudo
entrelaçado e impossível de manter.

- A magia da framework. Se bem me lembro os dados do request actual são
postos em variáveis globais sem qualquer necessidade (podiam ser passados
para a view, como no django).

- Os models são executados ( exec() ) a cada pedido. Não há necessidade
para este overhead.

- Com tantos editores excelentes (emacs,vim,eclipse,vstudio,..),porquê usar
um editor inferior no browser? Se gastarem tempo a trazer esse editor ao
nível dos outros, perderam tempo que podia ter sido usado para melhorar
outras partes da framework.

- A qualidade do código é incomparável. Pequeno exemplo: Lembro-me que o
núcleo da persistência do web2py na altura era um sql.py com algumas 3000
linhas, todo martelado com ifs para emitir SQL cozido ou assado consoante a
BD e, de ver o Massimo* argumentar na mailing list que não era crítico
melhorar aquela parte.

Para mim, o web2py é bom como uma ferramenta de aprendizagem, nada mais.

Cumprimentos.


[web2py] Re: Noob Question. How do I make an external link?

2012-05-03 Thread zounds
LoL! Just realized that you answered my question on stackoverflow as well.  
Thanks again for your help!


[web2py] Re: An insult to web2py ?

2012-05-03 Thread Anthony
Well, I had to use Google Translate, so not sure I got everything, but here 
are a few thoughts:

   - Sounds like he used web2py quite a long time ago, before the DAL was 
   re-written, and before countless other improvements, so this is not really 
   a criticism of the current web2py.
   - web2py does not have an ORM, it has a DAL. He seems to be thinking the 
   DAL was intended to be an ORM and somehow failed, hence his disappointment. 
   It's true that the DAL is closer to SQL, but it is not "SQL in disguise" 
   (you don't have to know any SQL), and in particular, it uses a single 
   universal syntax/API across all supported backends (just like an ORM). This 
   design actually makes the DAL more flexible than an ORM in terms of what it 
   can model. The DAL also tends to be faster than ORMs. It would be 
   interesting to ask what he thinks he can do with the Django ORM that could 
   not easily be done with the DAL. Anyway, this is somewhat a matter of 
   preference, though many web2py users consider the DAL to be one of web2py's 
   great strengths.
   - I don't understand what he's saying about objects returned by the DAL 
   (perhaps a translation issue). I'm not sure what mapping he thinks needs to 
   be done by hand.
   - The complaint about views being difficult to maintain because they 
   include Python + HTML + Javascript doesn't make any sense -- that's exactly 
   what Django does as well (though Django uses a specialized template 
   language rather than straight Python, but effectively no different in terms 
   of inter-mixing of code and ease of maintenance). Perhaps he simply saw 
   some bad examples.
   - Regarding "magic" and the existence of a few global API objects, such 
   as "request", so what? He seems to prefer the Django method of importing 
   and instantiating everything but doesn't explain the benefit of that. Why 
   does he like repeating the same boilerplate code everywhere for objects as 
   common as "request" and "response"? I refer him to the following quotes 
   from Zed Shaw: https://twitter.com/#!/zedshaw/status/80415443558477825, 
   https://twitter.com/#!/zedshaw/status/80418794526351360.
   - Regarding executing models, I'm not sure exactly what he means about 
   overhead, but we now have conditional models, and you can always import 
   your models from modules, just like in Django.
   - Regarding the admin editor, it is not intended to replace Vim, Emacs, 
   etc. It is just a convenience for minor editing and to help beginners get 
   started. Using it is completely optional, so it's an odd reason to give for 
   leaving web2py -- just don't use it. Also, it's a third-party editor that 
   was simply plugged in, so including it did not take away precious 
   development time from the framework as he suggests (the current web2py also 
   has a much better editor than the one he would have been using back then).

Some further reading: 
http://www.quora.com/What-are-the-advantages-of-web2py-over-Django

Anthony

On Thursday, May 3, 2012 7:40:45 AM UTC-4, Ramos wrote:
>
> a person just wrote this about web2py in a portuguese forum
> Anyone care to coment?
>
>
> Viva,
>
> Eu conheci primeiro o web2py e só uns meses depois o Django.
> Ao início achei bastante interessante (a ferramenta de admin, tutorial 
> fácil de seguir, etc.). O que me fez saltar do web2py para o django e nunca 
> voltar para trás foi, entre outros, o seguinte:
>
> - web2py não tem um ORM, tem uma api OO mas que segue o mesmo paradigma de 
> SQL, No fundo, ao fazer .select() / .union() estamos a escrever SQL 
> disfarçado. Um bom ORM permite não ter de escrever SQL em 90% dos casos, 
> poupando trabalho.
>
> - Os objectos retornados pela camada de persistência do web2py não têm 
> classes que façam sentido no domínio (Books, Persons, whatever seja o 
> domínio), aquilo retorna umas instâncias de Record (ou lá o que é) que não 
> são mais do que dicts. O mapeamento disso para instâncias de classes do 
> domínio tem de ser feito à mão.
>
> - A ideia de poder meter python arbitrário no template parece gira mas 
> facilmente descamba para ficheiros com python+html+javascript tudo 
> entrelaçado e impossível de manter.
>
> - A magia da framework. Se bem me lembro os dados do request actual são 
> postos em variáveis globais sem qualquer necessidade (podiam ser passados 
> para a view, como no django).
>
> - Os models são executados ( exec() ) a cada pedido. Não há necessidade 
> para este overhead.
>
> - Com tantos editores excelentes (emacs,vim,eclipse,vstudio,..),porquê 
> usar um editor inferior no browser? Se gastarem tempo a trazer esse editor 
> ao nível dos outros, perderam tempo que podia ter sido usado para melhorar 
> outras partes da framework.
>
> - A qualidade do código é incomparável. Pequeno exemplo: Lembro-me que o 
> núcleo da persistência do web2py na altura era um sql.py com algumas 3000 
> linhas, todo martelado com ifs para emitir SQL cozido ou assado consoante a 
>

[web2py] Re: An insult to web2py ?

2012-05-03 Thread Stefan Scholl
António Ramos  wrote:
> a person just wrote this about web2py in a portuguese forum
> Anyone care to coment?

I recognize the language from about 1/4 of the spam I receive.




[web2py] A helper callback

2012-05-03 Thread Fülöp Gergely
Hello,

I would like to use the callback parameter to call my client-side js
instead of replacing the content of an element.
In the web2py.js I've found that the ajax() function makes it possible in
the else part:
jQuery.ajax({type: "POST", url: u, data: query, success: function(msg) { if(
t) { if(t==':eval') eval(msg); else if(typeof t=='string') jQuery("#"+t).
html(msg); else t(msg);} } });

So if the type of the target is not string thhen I'm OK.
But I've found this in the A helper:
self['_onclick']="ajax('%s',[],'%s');%sreturn false;" % \
(self['callback'],self['target'] or '',d)

The single quotes are there regardless the type of target.

So how can I specify any target of type other than string?

Yes I know if I use ':eval' and I return "myFunction('param')" then it will
evaluate it, but the question is not that :)
How can I get into the "else" section of the quoted js code?

Many thanks,
Gergely


[web2py] Re: CMS question

2012-05-03 Thread Aurelijus Useckas
First of all it looks very promissing. I would just consider including some 
more options into the editing toolbar. *Underline* for instance, or perhaps 
even some additional fonts? Or do we want the style to be in line with the 
CSS only? That's a reasonable idea too. 

What about if I want to edit different ? Is there an option to 
choose which part of a page I want to edit at the certain moment or if I 
press EDIT, all zones become active for input at once? 

But overall it trully looks "The only CMS you need". Can't wait to put my 
hands on the beta :)

Thnx

On Tuesday, May 1, 2012 11:35:28 PM UTC+3, Massimo Di Pierro wrote:
>
> This is what I have so far... 
>
> http://dl.dropbox.com/u/18065445/Tmp/w2cms.pdf
>
> you can try some of it here but you cannot login. You can edit the content 
> of the white box.
>
> http://tests.web2py.com/w2cms/default/index
>
>
> - can clone any existing web site (copies, html, css, js, images and fixes 
> all links)
> - comes with may layouts (supports all joomla, drupal, worldpress layouts)
> - can edit pages in place using html5 contentEditable (true wysiwyg) but 
> can also edit raw html
> - users can limit which page areas are editable
> - injects scripts into pages which display 3 drawers on every page and are 
> content dependent
> - pages have tags and read-write attributes. You can find tags and groups 
> using autocomplete.
> - @{page.menu} inserts a menu, @{page.title} inserts title etc, 
> @{widget.whatever.you.define}
> - If you cut and paste in the page a link to a youtube page, it embeds the 
> video on the page. Same with vimeo and other oembed services. I use my own 
> library for this which is similar to django-oembed and micawber (in fact it 
> supports more services than them and I have submitted a patch to micawber).
> - supports latex via mathjax
>
> It still needs some work before I can release it.
>
> What else would you like to see in a CMS?
>
> massimo
>
>

[web2py] Re: A helper callback

2012-05-03 Thread Anthony

>
> But I've found this in the A helper:
>   self['_onclick']="ajax('%s',[],'%s');%sreturn false;" % \
> (self['callback'],self['target'] or '',d)
>
> The single quotes are there regardless the type of target.
>
> So how can I specify any target of type other than string?
>
> Yes I know if I use ':eval' and I return "myFunction('param')" then it 
> will evaluate it, but the question is not that :)
> How can I get into the "else" section of the quoted js code?
>

It appears you cannot when using the A() helper to generate the call to 
ajax(). I think you'll have to manually construct the "onclick" attribute 
rather than rely on passing the "callback" and "target" arguments to A().

Anthony 


[web2py] Re: .update_or_insert not optimized!!

2012-05-03 Thread Anthony

>
> You're manual version updates only two fields, whereas update_or_insert 
>> updates six fields -- maybe that's the difference.
>>
>> Anthony 
>>
>
> Yes, but I want to insert a new record with six fields, but update only 
> two if the record exists. How to do that with .update_or_insert?
>

Looks like you can't. Might be a nice enhancement, though. Maybe it could 
take "_insert_fields" and "_update_fields" arguments, which could be lists 
of field names to insert and update, respectively.

Anthony 


Re: [web2py] list:reference question about order and unordered reference id list

2012-05-03 Thread Richard Vézina
I use IS_IN_DB with a set not the table directly...

analyst_set = db((db.auth_group.role=='analyst') &
(db.auth_user.id==db.auth_membership.user_id)
& (db.auth_membership.group_id==db.auth_group.id))

requires=IS_IN_DB(analyst_set,'auth_user.id','%(initials)s',\
multiple=True,cache=(cache.ram, 3600)),

So, maybe it is the IS_IN_DB validator that order the list at the end of
the process before returning the list to the DAL.

Richard

On Wed, May 2, 2012 at 11:12 PM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> Are you talking about the IS_IN_SET() validator? I need to see some code.
> There is nothing in DAL that cases this. It must be a validator. So it
> depends on what you are using.
>
>
> On Wednesday, 2 May 2012 17:29:35 UTC-5, Richard wrote:
>>
>> Ok DAL do will return [1,2,3] in case of the user has select the first 3
>> element of the referenced table.
>>
>> What Choosen plugin return (and what I would to be stored in database
>> field) could be [1,3,2] or [3,1,2] or what ever other order in which the
>> user had pick those referenced elements. Choosen allow that when use
>> multiple option.
>>
>> So I would like that the DAL return at the database level the order in
>> which the element have been entered in the field in case of use of plugin
>> like choosen. Off course it is not applying if someone is not using a
>> plugin because you can't know in which order the element have been selected.
>>
>> Now, I think that what prevent the DAL to return a unordered list to the
>> database is the use of dict...
>>
>> I think I found a work around... But I didn't have time to implement
>> it... It consist of creating an other field to store the content of the
>> form.vars.field (list:reference field). So having 2 fields instead of 1...
>>
>> Hope it more clear.
>>
>> Richard
>>
>> On Wed, May 2, 2012 at 4:52 PM, Massimo Di Pierro <
>> massimo.dipie...@gmail.com> wrote:
>>
>>> Richard, I am at a loss about this. the dal does not sort, nor does the
>>> validator. Can you show me and example to reproduce this sorting?
>>>
>>>
>>> On Thursday, 19 April 2012 16:14:50 UTC-5, Richard wrote:

   Issue 768 : Allow
 insert of unsorted or unordered list:reference type field values
 On Thu, Apr 19, 2012 at 5:08 PM, Richard Vézina <
 ml.richard.vez...@gmail.com> wrote:

> Found this http://stackoverflow.com/questions/1867861/python-**
> dicti**onary-keep-keys-values-**in-**same-order-as-declared
>  on
> stackoverflow where the most rated post redirect here :
> http://dev.pocoo.org/hg/**sandbo**x/raw-file/tip/odict.py
>
> Notice, it will download odict.py into your computer that contain a
> class supposing to allow preservation of initial order in a python dict...
>
> I think, it could be nice to have this class added to web2py in order
> to allow insert into database of unordered list:reference field input...
>
> Since this could be slow (not in case of few value I think), it could
> be a choice offer to the user like : list:reference sorted or
> list:reference unsorted...
>
> What do you think??
>
> Richard
>
>
> On Thu, Apr 19, 2012 at 4:59 PM, Richard Vézina <
> ml.richard.vez...@gmail.com> wrote:
>
>> Some progress...
>>
>> I just make a check and chosen plugin multiple select option return a
>> unordered list of the picked element by the user...
>>
>> So, now, I think that it could be nice if web2py allow some way to
>> determine in case of use of chosen kind of plugin to store a unordered 
>> list
>> in list:reference field...
>>
>> I think that it is near line 207 (web2py 1.99.4) gluon/sqlhtml that
>> we have to make change :
>>
>> class OptionsWidget(FormWidget):
>>
>> @staticmethod
>> def has_options(field):
>> """
>> checks if the field has selectable options
>>
>> :param field: the field needing checking
>> :returns: True if the field has options
>> """
>>
>> return hasattr(field.requires, 'options')
>>
>> @classmethod
>> def widget(cls, field, value, **attributes):
>> """
>> generates a SELECT tag, including OPTIONs (only 1 option
>> allowed)
>>
>> see also: :meth:`FormWidget.widget`
>> """
>> default = dict(value=value) # HERE
>>
>> I am not pretty sure actually... And I don't really know, what could
>> be done to keep submit multiple list order in case of plugin use...
>>
>> I try naively to replace
>>
>> default = dict(value=value)
>>
>> By
>>
>> defautl = va

Re: [web2py] list:reference question about order and unordered reference id list

2012-05-03 Thread Richard Vézina
Ok, I remove the IS_IN_DB validator and now I get unordered list... So,
look like it the problem...

I will try to change it...

Richard

On Thu, May 3, 2012 at 9:53 AM, Richard Vézina
wrote:

> I use IS_IN_DB with a set not the table directly...
>
> analyst_set = db((db.auth_group.role=='analyst') & 
> (db.auth_user.id==db.auth_membership.user_id)
> & (db.auth_membership.group_id==db.auth_group.id))
>
> requires=IS_IN_DB(analyst_set,'auth_user.id','%(initials)s',\
> multiple=True,cache=(cache.ram, 3600)),
>
> So, maybe it is the IS_IN_DB validator that order the list at the end of
> the process before returning the list to the DAL.
>
> Richard
>
> On Wed, May 2, 2012 at 11:12 PM, Massimo Di Pierro <
> massimo.dipie...@gmail.com> wrote:
>
>> Are you talking about the IS_IN_SET() validator? I need to see some code.
>> There is nothing in DAL that cases this. It must be a validator. So it
>> depends on what you are using.
>>
>>
>> On Wednesday, 2 May 2012 17:29:35 UTC-5, Richard wrote:
>>>
>>> Ok DAL do will return [1,2,3] in case of the user has select the first 3
>>> element of the referenced table.
>>>
>>> What Choosen plugin return (and what I would to be stored in database
>>> field) could be [1,3,2] or [3,1,2] or what ever other order in which the
>>> user had pick those referenced elements. Choosen allow that when use
>>> multiple option.
>>>
>>> So I would like that the DAL return at the database level the order in
>>> which the element have been entered in the field in case of use of plugin
>>> like choosen. Off course it is not applying if someone is not using a
>>> plugin because you can't know in which order the element have been selected.
>>>
>>> Now, I think that what prevent the DAL to return a unordered list to the
>>> database is the use of dict...
>>>
>>> I think I found a work around... But I didn't have time to implement
>>> it... It consist of creating an other field to store the content of the
>>> form.vars.field (list:reference field). So having 2 fields instead of 1...
>>>
>>> Hope it more clear.
>>>
>>> Richard
>>>
>>> On Wed, May 2, 2012 at 4:52 PM, Massimo Di Pierro <
>>> massimo.dipie...@gmail.com> wrote:
>>>
 Richard, I am at a loss about this. the dal does not sort, nor does the
 validator. Can you show me and example to reproduce this sorting?


 On Thursday, 19 April 2012 16:14:50 UTC-5, Richard wrote:
>
>   Issue 768 : Allow
> insert of unsorted or unordered list:reference type field values
> On Thu, Apr 19, 2012 at 5:08 PM, Richard Vézina <
> ml.richard.vez...@gmail.com> wrote:
>
>> Found this http://stackoverflow.com/questions/1867861/python-**
>> dicti**onary-keep-keys-values-**in-**same-order-as-declared
>>  on
>> stackoverflow where the most rated post redirect here :
>> http://dev.pocoo.org/hg/**sandbo**x/raw-file/tip/odict.py
>>
>> Notice, it will download odict.py into your computer that contain a
>> class supposing to allow preservation of initial order in a python 
>> dict...
>>
>> I think, it could be nice to have this class added to web2py in order
>> to allow insert into database of unordered list:reference field input...
>>
>> Since this could be slow (not in case of few value I think), it could
>> be a choice offer to the user like : list:reference sorted or
>> list:reference unsorted...
>>
>> What do you think??
>>
>> Richard
>>
>>
>> On Thu, Apr 19, 2012 at 4:59 PM, Richard Vézina <
>> ml.richard.vez...@gmail.com> wrote:
>>
>>> Some progress...
>>>
>>> I just make a check and chosen plugin multiple select option return
>>> a unordered list of the picked element by the user...
>>>
>>> So, now, I think that it could be nice if web2py allow some way to
>>> determine in case of use of chosen kind of plugin to store a unordered 
>>> list
>>> in list:reference field...
>>>
>>> I think that it is near line 207 (web2py 1.99.4) gluon/sqlhtml that
>>> we have to make change :
>>>
>>> class OptionsWidget(FormWidget):
>>>
>>> @staticmethod
>>> def has_options(field):
>>> """
>>> checks if the field has selectable options
>>>
>>> :param field: the field needing checking
>>> :returns: True if the field has options
>>> """
>>>
>>> return hasattr(field.requires, 'options')
>>>
>>> @classmethod
>>> def widget(cls, field, value, **attributes):
>>> """
>>> generates a SELECT tag, including OPTIONs (only 1 option
>>> allowed)
>>>
>>> see also: :meth:`FormWidget.widget`
>>> """
>>>

Re: [web2py] list:reference question about order and unordered reference id list

2012-05-03 Thread Richard Vézina
Think that "sort=False" does the trick!!

Thanks for help, I think you can close the issue... Do you want I leave the
solution with the issue?

Richard

On Thu, May 3, 2012 at 10:02 AM, Richard Vézina  wrote:

> Ok, I remove the IS_IN_DB validator and now I get unordered list... So,
> look like it the problem...
>
> I will try to change it...
>
> Richard
>
>
> On Thu, May 3, 2012 at 9:53 AM, Richard Vézina <
> ml.richard.vez...@gmail.com> wrote:
>
>> I use IS_IN_DB with a set not the table directly...
>>
>> analyst_set = db((db.auth_group.role=='analyst') & 
>> (db.auth_user.id==db.auth_membership.user_id)
>> & (db.auth_membership.group_id==db.auth_group.id))
>>
>> requires=IS_IN_DB(analyst_set,'auth_user.id','%(initials)s',\
>> multiple=True,cache=(cache.ram, 3600)),
>>
>> So, maybe it is the IS_IN_DB validator that order the list at the end of
>> the process before returning the list to the DAL.
>>
>> Richard
>>
>> On Wed, May 2, 2012 at 11:12 PM, Massimo Di Pierro <
>> massimo.dipie...@gmail.com> wrote:
>>
>>> Are you talking about the IS_IN_SET() validator? I need to see some
>>> code. There is nothing in DAL that cases this. It must be a validator. So
>>> it depends on what you are using.
>>>
>>>
>>> On Wednesday, 2 May 2012 17:29:35 UTC-5, Richard wrote:

 Ok DAL do will return [1,2,3] in case of the user has select the first
 3 element of the referenced table.

 What Choosen plugin return (and what I would to be stored in database
 field) could be [1,3,2] or [3,1,2] or what ever other order in which the
 user had pick those referenced elements. Choosen allow that when use
 multiple option.

 So I would like that the DAL return at the database level the order in
 which the element have been entered in the field in case of use of plugin
 like choosen. Off course it is not applying if someone is not using a
 plugin because you can't know in which order the element have been 
 selected.

 Now, I think that what prevent the DAL to return a unordered list to
 the database is the use of dict...

 I think I found a work around... But I didn't have time to implement
 it... It consist of creating an other field to store the content of the
 form.vars.field (list:reference field). So having 2 fields instead of 1...

 Hope it more clear.

 Richard

 On Wed, May 2, 2012 at 4:52 PM, Massimo Di Pierro <
 massimo.dipie...@gmail.com> wrote:

> Richard, I am at a loss about this. the dal does not sort, nor does
> the validator. Can you show me and example to reproduce this sorting?
>
>
> On Thursday, 19 April 2012 16:14:50 UTC-5, Richard wrote:
>>
>>   Issue 768 : Allow
>> insert of unsorted or unordered list:reference type field values
>> On Thu, Apr 19, 2012 at 5:08 PM, Richard Vézina <
>> ml.richard.vez...@gmail.com> wrote:
>>
>>> Found this http://stackoverflow.com/questions/1867861/python-**
>>> dicti**onary-keep-keys-values-**in-**same-order-as-declared
>>>  on
>>> stackoverflow where the most rated post redirect here :
>>> http://dev.pocoo.org/hg/**sandbo**x/raw-file/tip/odict.py
>>>
>>> Notice, it will download odict.py into your computer that contain a
>>> class supposing to allow preservation of initial order in a python 
>>> dict...
>>>
>>> I think, it could be nice to have this class added to web2py in
>>> order to allow insert into database of unordered list:reference field
>>> input...
>>>
>>> Since this could be slow (not in case of few value I think), it
>>> could be a choice offer to the user like : list:reference sorted or
>>> list:reference unsorted...
>>>
>>> What do you think??
>>>
>>> Richard
>>>
>>>
>>> On Thu, Apr 19, 2012 at 4:59 PM, Richard Vézina <
>>> ml.richard.vez...@gmail.com> wrote:
>>>
 Some progress...

 I just make a check and chosen plugin multiple select option return
 a unordered list of the picked element by the user...

 So, now, I think that it could be nice if web2py allow some way to
 determine in case of use of chosen kind of plugin to store a unordered 
 list
 in list:reference field...

 I think that it is near line 207 (web2py 1.99.4) gluon/sqlhtml that
 we have to make change :

 class OptionsWidget(FormWidget):

 @staticmethod
 def has_options(field):
 """
 checks if the field has selectable options

 :param field: the field needing checking
 :returns: True if the field has

[web2py] Re: An insult to web2py ?

2012-05-03 Thread villas
> Some further reading: 
http://www.quora.com/What-are-the-advantages-of-web2py-over-Django

Really good summary!


Re: [web2py] list:reference question about order and unordered reference id list

2012-05-03 Thread Richard Vézina
Wait I think it return the element base on the orderby...

I test further.

Richard

On Thu, May 3, 2012 at 10:05 AM, Richard Vézina  wrote:

> Think that "sort=False" does the trick!!
>
> Thanks for help, I think you can close the issue... Do you want I leave
> the solution with the issue?
>
> Richard
>
>
> On Thu, May 3, 2012 at 10:02 AM, Richard Vézina <
> ml.richard.vez...@gmail.com> wrote:
>
>> Ok, I remove the IS_IN_DB validator and now I get unordered list... So,
>> look like it the problem...
>>
>> I will try to change it...
>>
>> Richard
>>
>>
>> On Thu, May 3, 2012 at 9:53 AM, Richard Vézina <
>> ml.richard.vez...@gmail.com> wrote:
>>
>>> I use IS_IN_DB with a set not the table directly...
>>>
>>> analyst_set = db((db.auth_group.role=='analyst') & 
>>> (db.auth_user.id==db.auth_membership.user_id)
>>> & (db.auth_membership.group_id==db.auth_group.id))
>>>
>>> requires=IS_IN_DB(analyst_set,'auth_user.id','%(initials)s',\
>>> multiple=True,cache=(cache.ram, 3600)),
>>>
>>> So, maybe it is the IS_IN_DB validator that order the list at the end of
>>> the process before returning the list to the DAL.
>>>
>>> Richard
>>>
>>> On Wed, May 2, 2012 at 11:12 PM, Massimo Di Pierro <
>>> massimo.dipie...@gmail.com> wrote:
>>>
 Are you talking about the IS_IN_SET() validator? I need to see some
 code. There is nothing in DAL that cases this. It must be a validator. So
 it depends on what you are using.


 On Wednesday, 2 May 2012 17:29:35 UTC-5, Richard wrote:
>
> Ok DAL do will return [1,2,3] in case of the user has select the first
> 3 element of the referenced table.
>
> What Choosen plugin return (and what I would to be stored in database
> field) could be [1,3,2] or [3,1,2] or what ever other order in which the
> user had pick those referenced elements. Choosen allow that when use
> multiple option.
>
> So I would like that the DAL return at the database level the order in
> which the element have been entered in the field in case of use of plugin
> like choosen. Off course it is not applying if someone is not using a
> plugin because you can't know in which order the element have been 
> selected.
>
> Now, I think that what prevent the DAL to return a unordered list to
> the database is the use of dict...
>
> I think I found a work around... But I didn't have time to implement
> it... It consist of creating an other field to store the content of the
> form.vars.field (list:reference field). So having 2 fields instead of 1...
>
> Hope it more clear.
>
> Richard
>
> On Wed, May 2, 2012 at 4:52 PM, Massimo Di Pierro <
> massimo.dipie...@gmail.com> wrote:
>
>> Richard, I am at a loss about this. the dal does not sort, nor does
>> the validator. Can you show me and example to reproduce this sorting?
>>
>>
>> On Thursday, 19 April 2012 16:14:50 UTC-5, Richard wrote:
>>>
>>>   Issue 768 : 
>>> Allow
>>> insert of unsorted or unordered list:reference type field values
>>> On Thu, Apr 19, 2012 at 5:08 PM, Richard Vézina <
>>> ml.richard.vez...@gmail.com> wrote:
>>>
 Found this http://stackoverflow.com/questions/1867861/python-**
 dicti**onary-keep-keys-values-**in-**same-order-as-declared
  on
 stackoverflow where the most rated post redirect here :
 http://dev.pocoo.org/hg/**sandbo**x/raw-file/tip/odict.py

 Notice, it will download odict.py into your computer that contain a
 class supposing to allow preservation of initial order in a python 
 dict...

 I think, it could be nice to have this class added to web2py in
 order to allow insert into database of unordered list:reference field
 input...

 Since this could be slow (not in case of few value I think), it
 could be a choice offer to the user like : list:reference sorted or
 list:reference unsorted...

 What do you think??

 Richard


 On Thu, Apr 19, 2012 at 4:59 PM, Richard Vézina <
 ml.richard.vez...@gmail.com> wrote:

> Some progress...
>
> I just make a check and chosen plugin multiple select option
> return a unordered list of the picked element by the user...
>
> So, now, I think that it could be nice if web2py allow some way to
> determine in case of use of chosen kind of plugin to store a 
> unordered list
> in list:reference field...
>
> I think that it is near line 207 (web2py 1.99.4) gluon/sqlhtml
> that we have to make change :
>

[web2py] Re: CMS question

2012-05-03 Thread Massimo Di Pierro


On Thursday, 3 May 2012 07:45:40 UTC-5, Aurelijus Useckas wrote:
>
> First of all it looks very promissing. I would just consider including 
> some more options into the editing toolbar. *Underline* for instance, or 
> perhaps even some additional fonts? Or do we want the style to be in line 
> with the CSS only? That's a reasonable idea too. 


We cannot add more features to the toolbar. I included those features that 
all current browser support. Changing attributes like attribute 
text-decoration:underline is not supported by all browsers. This is a 
editeableContent issue. Anyway, I think the style should be handles by the 
CSS and the text-decoration is a CSS issue. Perhaps there should be a way 
to edit the CSS as well.
  

>
> What about if I want to edit different ? Is there an option to 
> choose which part of a page I want to edit at the certain moment or if I 
> press EDIT, all zones become active for input at once? 
>
> But overall it trully looks "The only CMS you need". Can't wait to put my 
> hands on the beta :)
>
> Thnx
>
> On Tuesday, May 1, 2012 11:35:28 PM UTC+3, Massimo Di Pierro wrote:
>>
>> This is what I have so far... 
>>
>> http://dl.dropbox.com/u/18065445/Tmp/w2cms.pdf
>>
>> you can try some of it here but you cannot login. You can edit the 
>> content of the white box.
>>
>> http://tests.web2py.com/w2cms/default/index
>>
>>
>> - can clone any existing web site (copies, html, css, js, images and 
>> fixes all links)
>> - comes with may layouts (supports all joomla, drupal, worldpress layouts)
>> - can edit pages in place using html5 contentEditable (true wysiwyg) but 
>> can also edit raw html
>> - users can limit which page areas are editable
>> - injects scripts into pages which display 3 drawers on every page and 
>> are content dependent
>> - pages have tags and read-write attributes. You can find tags and groups 
>> using autocomplete.
>> - @{page.menu} inserts a menu, @{page.title} inserts title etc, 
>> @{widget.whatever.you.define}
>> - If you cut and paste in the page a link to a youtube page, it embeds 
>> the video on the page. Same with vimeo and other oembed services. I use my 
>> own library for this which is similar to django-oembed and micawber (in 
>> fact it supports more services than them and I have submitted a patch to 
>> micawber).
>> - supports latex via mathjax
>>
>> It still needs some work before I can release it.
>>
>> What else would you like to see in a CMS?
>>
>> massimo
>>
>>

[web2py] Re: Moving web2py app to other server

2012-05-03 Thread Bill Thayer
What I did was to practice with the tutorial app from the book. I made the 
small app on my local machine using the rocket server and sqlite then 
practiced moving it to a server with MySQL and Apache. That successful 
exercise is what made me decide to go forward with web2py vs. django. 

Perhaps you might try a practice deployment yourself with a small app 
before you decide. If I remeber right, I just changed the db connection 
string after copying my app then from the application admin page, accessed 
the database admin page to create the new tables. You will have to 
reasearch the data migration but I bet you can handle it.

Good Luck,
Bill

On Wednesday, May 2, 2012 3:47:36 PM UTC-5, mmstud wrote:
>
> Hi,
>
> I need to move my 2-3 years old web2py app to other server. Its pretty 
> simple member and magazine subscriber database working over https. I'd like 
> to move it to the other server, either dedicated or cloud environment. 
> Whats should I do to get current sqlite database and application moved 
> without hassles? There is a user authentication by CAS or something too. 
> Are there good cheap or even free cloud services that could work well for a 
> small app?
>
> Regards,
> -Marko
>

On Wednesday, May 2, 2012 3:47:36 PM UTC-5, mmstud wrote:
>
> Hi,
>
> I need to move my 2-3 years old web2py app to other server. Its pretty 
> simple member and magazine subscriber database working over https. I'd like 
> to move it to the other server, either dedicated or cloud environment. 
> Whats should I do to get current sqlite database and application moved 
> without hassles? There is a user authentication by CAS or something too. 
> Are there good cheap or even free cloud services that could work well for a 
> small app?
>
> Regards,
> -Marko
>


[web2py] Re: Options for making a chat application with web2py

2012-05-03 Thread mrtn

Thanks!

I think I will try SockJS. My main concern with Socket.io is that it does 
not seem to be well maintained and the documentation is not very good. If 
there is any other alternative, please feel free to list here.

On Wednesday, May 2, 2012 10:28:29 PM UTC-4, Anthony wrote:
>
> Looks like you could also go with SockJS and sockjs-tornado (
> https://github.com/MrJoes/sockjs-tornado). There's also an initial 
> sockjs-gevent library (https://github.com/sdiehl/sockjs-gevent).
>
> Anthony
>
> On Wednesday, May 2, 2012 10:19:24 PM UTC-4, Anthony wrote:
>>
>> if I understand gevent-socketio (
>>> https://github.com/abourget/gevent-socketio) correctly, it is the same 
>>> idea as Tornadio except that it replaces Tornado with Gevent. Is there any 
>>> alternative that does not utilize Socket.io? If not, is there any working 
>>> code making Socket.io (ver. 0.7 or higher) works with web2py? So far, it 
>>> seems that no such working example exists for web2py, and the only attempt 
>>> (using Tornadio and Tornadio2) I've found failed.  
>>>
>>
>> Well, according to the docs, gevent-socketio works with Socket.IO 0.7. 
>> It's made to work with WSGI frameworks, so I assume could work with web2py. 
>> Note, gevent is one of the server options in web2py's anyserver.py file: 
>> http://code.google.com/p/web2py/source/browse/anyserver.py#86. I haven't 
>> seen any code examples specifically for web2py, so I suppose you'll have to 
>> figure it out based on the gevent-socketio docs and examples. If you get it 
>> working, report back (maybe post a slice: www.web2pyslices.com).
>>
>> Anthony 
>>
>

[web2py] Re: web2py resources

2012-05-03 Thread Massimo Di Pierro
Please append here.
>
>

[web2py] Re: CMS question

2012-05-03 Thread Anthony

>
> We cannot add more features to the toolbar. I included those features that 
> all current browser support. Changing attributes like attribute 
> text-decoration:underline is not supported by all browsers. This is a 
> editeableContent issue. Anyway, I think the style should be handles by the 
> CSS and the text-decoration is a CSS issue.
>

Yes, but you need a way to specify id's and classes so specific CSS rules 
can be applied to specific content. I guess you can edit the HTML directly, 
but that's not ideal for non-technical users.

Anthony 


[web2py] New style - Lazy Field

2012-05-03 Thread Marcello
Hello,

I need to implement a lazy field, that should have some lines of code, with 
some conditions...
The new style example in the book, just have simple calculation fields...

Can someone point me some example on it's syntax ??

I could make it with the old way, but would like to do with new style...


Thanks
Marcello


[web2py] Re: New style - Lazy Field

2012-05-03 Thread Anthony
I believe the argument to Field.Virtual and Field.Lazy just needs to be a 
callable object that takes a Row object as an argument, so you could write 
a function and then pass that function.

def myfield(row):
[code to generate field value from row object]
return value

db.mytable.myvirtualfield = Field.Lazy(myfield)

Anthony

On Thursday, May 3, 2012 11:32:34 AM UTC-4, Marcello wrote:
>
> Hello,
>
> I need to implement a lazy field, that should have some lines of code, 
> with some conditions...
> The new style example in the book, just have simple calculation fields...
>
> Can someone point me some example on it's syntax ??
>
> I could make it with the old way, but would like to do with new style...
>
>
> Thanks
> Marcello
>


[web2py] Re: CMS question

2012-05-03 Thread Massimo Di Pierro
Another piece of the puzzle is in trunk

gluon/contrib/autolinks.py

You can use it with other CMSes as well.

On Sunday, 22 April 2012 11:24:50 UTC-5, Massimo Di Pierro wrote:
>
> Let's say we want to build a new kick-ass CMS.
>
> My technical side tells me that the best way it to use markup language and 
> separate data from presentation (which allows swapping of themes).
>
> My practical side tells is is better to allow users to edit html.
>
> Everytime I has worked with end-users I had a hard time explaining this 
> concept of separation of data from presentation. They usually want a page 
> tat looks like "that page" but the ability to edit all text and images in 
> it.
>
> Most CMS's (like concrete CMS) solve the problem by a compromise. You can 
> only edit specific parts of  a page (and they must be clearly tag in the 
> HTML). This allows some separation because as long as two themes have the 
> same editable tags, the content it portable between the themes. Yet if they 
> use a wysiwyg the editable blocks are stored as HTML. Moreover creating 
> themes requires some programming skills and make the themes CMS specific. 
> In the case of Concrete5 or Joomla for example, this tagging is done in PHP.
>
> So what is better?
> 1) using a markup language with limited choice of themes (like wikipedia)
> 2) using wysiwyg to edit fixed sections in themes (like joomla and 
> concrete5)
> 3) using fully editable html with no limitation on themes (any existing 
> page would be a theme without need for tweaking) yet one would not be able 
> to swap a theme on a page without loss of content, any more you can swap 
> the theme on a msworld document.
>
>
> Massimo
>


[web2py] Re: CMS question

2012-05-03 Thread Massimo Di Pierro
Have you seen this?
http://bluepeneditor.com/
Ideally I would like something like that which injects a  in the 
page. Although it will not be in the first release.
Perhaps somebody here with good JS skills may want to try reproduce it or 
can help me find an open source version of their JS module.

On Thursday, 3 May 2012 09:43:41 UTC-5, Anthony wrote:
>
> We cannot add more features to the toolbar. I included those features that 
>> all current browser support. Changing attributes like attribute 
>> text-decoration:underline is not supported by all browsers. This is a 
>> editeableContent issue. Anyway, I think the style should be handles by the 
>> CSS and the text-decoration is a CSS issue.
>>
>
> Yes, but you need a way to specify id's and classes so specific CSS rules 
> can be applied to specific content. I guess you can edit the HTML directly, 
> but that's not ideal for non-technical users.
>
> Anthony 
>

On Thursday, 3 May 2012 09:43:41 UTC-5, Anthony wrote:
>
> We cannot add more features to the toolbar. I included those features that 
>> all current browser support. Changing attributes like attribute 
>> text-decoration:underline is not supported by all browsers. This is a 
>> editeableContent issue. Anyway, I think the style should be handles by the 
>> CSS and the text-decoration is a CSS issue.
>>
>
> Yes, but you need a way to specify id's and classes so specific CSS rules 
> can be applied to specific content. I guess you can edit the HTML directly, 
> but that's not ideal for non-technical users.
>
> Anthony 
>


[web2py] Re: New style - Lazy Field

2012-05-03 Thread Marcello
Anthony,


Worked fine...


Thanks very much...

Marcello


On Thursday, May 3, 2012 1:07:35 PM UTC-3, Anthony wrote:
>
> I believe the argument to Field.Virtual and Field.Lazy just needs to be a 
> callable object that takes a Row object as an argument, so you could write 
> a function and then pass that function.
>
> def myfield(row):
> [code to generate field value from row object]
> return value
>
> db.mytable.myvirtualfield = Field.Lazy(myfield)
>
> Anthony
>
> On Thursday, May 3, 2012 11:32:34 AM UTC-4, Marcello wrote:
>>
>> Hello,
>>
>> I need to implement a lazy field, that should have some lines of code, 
>> with some conditions...
>> The new style example in the book, just have simple calculation fields...
>>
>> Can someone point me some example on it's syntax ??
>>
>> I could make it with the old way, but would like to do with new style...
>>
>>
>> Thanks
>> Marcello
>>
>

[web2py] Re: CMS question

2012-05-03 Thread Ross Peoples
Looking at the "better" version of that you just added to trunk, this is 
pretty cool!

I also looked at bluePen editor. That is very cool and looks like something 
I did once using jQuery UI components. I can't seem to find the code I 
wrote for it. It was a proof-of-concept that didn't really go anywhere. But 
the way it worked was you would mark DIV tags with a 'editable' class (or 
whatever you want to call it) and when the DIV was double-clicked, it 
opened a CSS editing dialog that gave options to change colors, borders, 
and rounding.

When saved, it would send an AJAX request with the CSS that changed and the 
next time the DIV was rendered, the CSS was injected. This way you could 
still use a style.css to style the whole site, but use the CSS editor to 
override some of the attributes for the one DIV. I don't know if this is 
the behavior you are looking for, but it's totally possible.

On Thursday, May 3, 2012 12:16:57 PM UTC-4, Massimo Di Pierro wrote:
>
> Another piece of the puzzle is in trunk
>
> gluon/contrib/autolinks.py
>


Re: [web2py] Re: Moving web2py app to other server

2012-05-03 Thread Richard Vézina
Marko,

What you really wanna do?

If your db is squlite, you can just copy the whole app folder and
sub-folders and put it in the new server with the same version of web2py
and it should work... Just make sure you set properly the owner of the
files and folders, permissions should stay the same (not affected when
copy).

If you want to make something else, like upgrade web2py version or move to
a better DBMS like Postgres or MySQL/MariaDB, you will have more things and
tests to do, but it should not be that difficult depending of the size of
your database.

Also depending of your web2py version you have feature like export/import
the whole database :
http://web2py.com/books/default/chapter/29/6?search=csv#CSV-(all-tables-at-once)

If you have relation between you table, you have to take care to not
re-increment your records when import your backuped data...

Richard

On Thu, May 3, 2012 at 10:30 AM, Bill Thayer  wrote:

> What I did was to practice with the tutorial app from the book. I made the
> small app on my local machine using the rocket server and sqlite then
> practiced moving it to a server with MySQL and Apache. That successful
> exercise is what made me decide to go forward with web2py vs. django.
>
> Perhaps you might try a practice deployment yourself with a small app
> before you decide. If I remeber right, I just changed the db connection
> string after copying my app then from the application admin page, accessed
> the database admin page to create the new tables. You will have to
> reasearch the data migration but I bet you can handle it.
>
> Good Luck,
> Bill
>
>
> On Wednesday, May 2, 2012 3:47:36 PM UTC-5, mmstud wrote:
>>
>> Hi,
>>
>> I need to move my 2-3 years old web2py app to other server. Its pretty
>> simple member and magazine subscriber database working over https. I'd like
>> to move it to the other server, either dedicated or cloud environment.
>> Whats should I do to get current sqlite database and application moved
>> without hassles? There is a user authentication by CAS or something too.
>> Are there good cheap or even free cloud services that could work well for a
>> small app?
>>
>> Regards,
>> -Marko
>>
>
> On Wednesday, May 2, 2012 3:47:36 PM UTC-5, mmstud wrote:
>>
>> Hi,
>>
>> I need to move my 2-3 years old web2py app to other server. Its pretty
>> simple member and magazine subscriber database working over https. I'd like
>> to move it to the other server, either dedicated or cloud environment.
>> Whats should I do to get current sqlite database and application moved
>> without hassles? There is a user authentication by CAS or something too.
>> Are there good cheap or even free cloud services that could work well for a
>> small app?
>>
>> Regards,
>> -Marko
>>
>


[web2py] Re: CMS question

2012-05-03 Thread Massimo Di Pierro
If you can find it that is all we need. Would help a lot.

On Thursday, 3 May 2012 12:08:17 UTC-5, Ross Peoples wrote:
>
> Looking at the "better" version of that you just added to trunk, this is 
> pretty cool!
>
> I also looked at bluePen editor. That is very cool and looks like 
> something I did once using jQuery UI components. I can't seem to find the 
> code I wrote for it. It was a proof-of-concept that didn't really go 
> anywhere. But the way it worked was you would mark DIV tags with a 
> 'editable' class (or whatever you want to call it) and when the DIV was 
> double-clicked, it opened a CSS editing dialog that gave options to change 
> colors, borders, and rounding.
>
> When saved, it would send an AJAX request with the CSS that changed and 
> the next time the DIV was rendered, the CSS was injected. This way you 
> could still use a style.css to style the whole site, but use the CSS editor 
> to override some of the attributes for the one DIV. I don't know if this is 
> the behavior you are looking for, but it's totally possible.
>
> On Thursday, May 3, 2012 12:16:57 PM UTC-4, Massimo Di Pierro wrote:
>>
>> Another piece of the puzzle is in trunk
>>
>> gluon/contrib/autolinks.py
>>
>

Re: [web2py] Anyone having experience creating FaceBook apps using web2py and GAE?

2012-05-03 Thread Michele Comitini
Web2py + GAE  + Facebook  is a good fit.  Just be aware that using fb graph
API server side you have to take those connections into account, since GAE
will make you pay for those if they go over-quota.


mic


Il giorno 03/mag/2012 11:30, "David Marko"  ha scritto:

> Anyone havng experience creating FaceBook apps using web2py and GAE? GAE
> can be used for this, just want to know whether expect any technical
> obstacles/dificulties when using web2py for this?
>
> Thank you,
> David
>


[web2py] Installing scheduler on linux

2012-05-03 Thread Michael Toomim
Anyone have a recipe to make the scheduler run on boot? I'm using ubuntu. 
Web2py is run in apache (using the recipe in the book), so I can't just use 
the cron @reboot line.

This is the line that needs to be run when my system boots:
   python /home/web2py/web2py/web2py.py -K 

It seems ubuntu uses Upstart instead of sysvinit. And it might be possible 
to tell Upstart to launch the scheduler WITH apache, using a line like "start 
on started apache2" but I don't know how it works, and apache2 to use 
upstart.

It would be nice to have a recipe for the scheduler that we could add into 
the book, to synchronize it with apache.


[web2py] Re: Why Bottle and Web2py?

2012-05-03 Thread Michael Toomim
I think the best combination of web2py and bottle would be, as you 
suggested—importing the web2py DAL into bottle.

The DAL is the most important thing that bottle lacks, and the web2py DAL 
is great to plug into other projects. I use it a lot for that.

That said, in my experience, you will quickly want a templating language to 
use with bottle as well. Because you will be making HTML. And then you will 
want a way to connect views to controllers... and soon I imagine you will 
just want to be using web2py. Web2py is very simple. I suggest you spend 
just a little bit more time getting to know how web2py works, and then 
decide whether to use bottle+web2py or web2py.

On Wednesday, May 2, 2012 3:56:24 PM UTC-7, David Johnston wrote:
>
>
>  Can someone explain to me why someone would want to use web2py with 
> Bottle? I am considering the combination.
>
> Is it for when you want to keep the app very simple but need some of the 
> more advanced functionality of Web2py such as the DAL? I am trying to learn 
> web programming and wonder if this might be a good place to start. I find 
> the full-blown web2py a little intimidating especially since I can't find 
> what I am looking for in the documentation. I find Bottle the opposite. Too 
> sparse. For example, I don't mind making forms but don't really want to 
> write SQL queries. I am coming from a (short) background in Wordpress so I 
> am looking for something like that but in Python and better for web app 
> development. Bottle feels like building a webapp from the bottle up. Web2py 
> feels like building it from the top down, (i.e. take the example apps and 
> reverse engineer them to what you want).  I guess I would like something in 
> the middle. Wordpress wasn't THAT bad but I want easier CRUD and would 
> rather ditch PHP.
>
> Web2py is supposed to be easier than Django but Django has so much better 
> documentation, books etc that I might find this the opposite. Suggestions?
>
> Dave
>


[web2py] Re: An insult to web2py ?

2012-05-03 Thread Tiago Almeida
Hi,

Other than trying to start a flame war, I don't see reasons for bringing my 
comment from the portuguese python group to here.
Anyway, since Anthony cared to comment I'll also comment.

- I'm glad DAL was re-written. When I left web2py it was a mess and there 
were many objections to touching it.

- I know it does not have an orm. To me, that is a disadvantage. ORM's were 
invented the same reason higher level programming languages were. They hide 
details allowing people to produce more with the same effort.

-The manual mapping is a consequence of not having an orm. If you have a 
business model called Department for which there are a lot of 
domain-specific operations you want to perform (like, say, registering 
Teachers), you would probably declare a Python class with methods for these 
operations. When you go to the DAL and make a select for your Department, 
you get a Row (or whatever is called), not an instance of class Department. 
If magic is so great, why don't you like for the framework to magically 
transform the bytes from the DB into a Department?

- Allowing arbitrary python code on the template is a first step for having 
templates filled with business logic especially when you work with 
not-so-perfectionist programmers. Web templates are already a mess because 
you can intermingle css+javascript+html. If the framework prevents another 
language to that party, great! Even if it means having to type a few extra 
chars in another file.

- I agree that the magic regarding request execution is a matter of 
preference more than a technical one. 

- The editor is only useful if you're making your first steps in 
programming. For all other professional programmers it has no value. Even 
if it is a third party app, you still have to make sure that changes to 
web2py don't break anything. I think it would be much more useful, for 
instance, to build an orm on top of the dal.

Anyway, I come in peace :)

Regards,


Quinta-feira, 3 de Maio de 2012 14:02:55 UTC+1, Anthony escreveu:
>
> Well, I had to use Google Translate, so not sure I got everything, but 
> here are a few thoughts:
>
>- Sounds like he used web2py quite a long time ago, before the DAL was 
>re-written, and before countless other improvements, so this is not really 
>a criticism of the current web2py.
>- web2py does not have an ORM, it has a DAL. He seems to be thinking 
>the DAL was intended to be an ORM and somehow failed, hence his 
>disappointment. It's true that the DAL is closer to SQL, but it is not 
> "SQL 
>in disguise" (you don't have to know any SQL), and in particular, it uses 
> a 
>single universal syntax/API across all supported backends (just like an 
>ORM). This design actually makes the DAL more flexible than an ORM in 
> terms 
>of what it can model. The DAL also tends to be faster than ORMs. It would 
>be interesting to ask what he thinks he can do with the Django ORM that 
>could not easily be done with the DAL. Anyway, this is somewhat a matter 
> of 
>preference, though many web2py users consider the DAL to be one of 
> web2py's 
>great strengths.
>- I don't understand what he's saying about objects returned by the 
>DAL (perhaps a translation issue). I'm not sure what mapping he thinks 
>needs to be done by hand.
>- The complaint about views being difficult to maintain because they 
>include Python + HTML + Javascript doesn't make any sense -- that's 
> exactly 
>what Django does as well (though Django uses a specialized template 
>language rather than straight Python, but effectively no different in 
> terms 
>of inter-mixing of code and ease of maintenance). Perhaps he simply saw 
>some bad examples.
>- Regarding "magic" and the existence of a few global API objects, 
>such as "request", so what? He seems to prefer the Django method of 
>importing and instantiating everything but doesn't explain the benefit of 
>that. Why does he like repeating the same boilerplate code everywhere for 
>objects as common as "request" and "response"? I refer him to the 
> following 
>quotes from Zed Shaw: 
>https://twitter.com/#!/zedshaw/status/80415443558477825, 
>https://twitter.com/#!/zedshaw/status/80418794526351360.
>- Regarding executing models, I'm not sure exactly what he means about 
>overhead, but we now have conditional models, and you can always import 
>your models from modules, just like in Django.
>- Regarding the admin editor, it is not intended to replace Vim, 
>Emacs, etc. It is just a convenience for minor editing and to help 
>beginners get started. Using it is completely optional, so it's an odd 
>reason to give for leaving web2py -- just don't use it. Also, it's a 
>third-party editor that was simply plugged in, so including it did not 
> take 
>away precious development time from the framework as he suggests (the 
>current web2py also has 

[web2py] Trying to implement a full-page calendar

2012-05-03 Thread Cindy Michalowski
Hello all,

I am trying to implement a full page calendar as part of a web2py website,
and after many google/bing/etc. searches I'm finding very few results.
Basically, I want to make a calendar - month view only - that allows the
user to view a calendar in the current month by default, and then a
specified number of past and future months as well. The site administrators
should be able to easily add events to the calendar which can be clicked on
by any user for a detaiedl view of the event. Overall, the functionality
that I'm trying to achieve is pretty simple.

I found two apps - both of which have been mentioned in the web2py Google
groups before - that are pretty close to what I want to build:

1) http://arshaw.com/fullcalendar/
This is a j-query plugin. Aside from moving the .css files to the
static/css folder and the .js files to the static/js folder, I really don't
know how to integrate this into web2py.

2) http://www.agendadulibre.qc.ca/event/2011/9/
I believe this is written in Python.

As a third option, I considered writing the calendar in ActionScript 3 and
trying to link the interaction in the AIR app to the database in web2py,
but this is just an idea that I have and I'm only starting to research it.
I have no idea as to whether or not its feasible.

I am a fairly new web2py user, and I'm just looking for a nudge in the
right direction. Does anyone have any experience with integrating either of
these calendars, and if so, would you mind sharing a few tips just to help
me get started? Or does anyone know of a web2py slice or a web2py widget
that I may have overlooked while researching how to implement this?

Thanks in advance,
Cindy


[web2py] Re: web2py resources

2012-05-03 Thread newnomad
For those without any prior python knowledge, is it useful or essential to 
first exercise it, using the learnpythonthehardway 
book for 
example? Or would it confuse, and is the advise to dive directly into 
web2py?
>
>

[web2py] Re: RFC: web2py-based workflow engine

2012-05-03 Thread Cliff
Ross,
 
This comes at an opportune time, as I have been asked to do some workflow 
work.

Here's where you need authorization.  This scenario has two players, a 
department manager and the company accountant.  An invoice comes to the 
department manager, so at that point we might call its state received.  The 
department manager is the only one who knows whether the invoice is 
legitimate, so he is the only one who should be authorized to approve it, 
which would promote it to the next state.  At that point the accountant 
would pay the invoice and promote it to the finished state, which is 
posted.  Nobody else in the company should be able to do these things. 
 That's easily accomplished by having a relation between the steps table 
and auth_user.  Maybe groups need to be part of it, too.

Like this:
db.define_table('performers',
  Field('user_or_group', requires=IS_IN_SET(['auth_user', 'auth_group'])),
  Field('step_id', db.steps...)
  Field('entity_id', integer requires= # is in auth_user or auth_group.  I 
know there's a way to do this, but I can't think of it right now.

Also the point about concurrent tasks,  further down, is correct.  I think 
a table of dependencies, with links back to the steps table, would handle 
that.

I haven't debugged my data model completely, but this is my current state 
of thinking.

Cliff

On Wednesday, May 2, 2012 9:07:39 AM UTC-4, Ross Peoples wrote:
>
> Cliff,
>
> Thanks for the feedback. I added the ability to name / title steps. I also 
> added the ability to set priorities for workflows.
>
> It is assumed that when a step is complete, that step is already "done" 
> and the next step in workflow is "new". Each step has an order_id to show 
> which order the steps are in. The workflow table stores the "order_id" of 
> the active workflow step. So in this case if the workflow is on order_id 3, 
> then anything below 3 is considered done, while everything else is new. Is 
> this what you mean by states to account for?
>
> Active workflows can be modified on the fly as well. This has a limitation 
> that any step that has been completed cannot be modified. All future steps 
> can be modified. So if the workflow needs to have another step added to it 
> or if it has been determined that the next destination user_id / group_id 
> needs to be changed, that can be done (i.e. someone accidentally added the 
> Engineering group, but it should have been Quality instead).
>
> I will add another method to WorkflowEngine (I was going to do this 
> anyways, but forgot to include it in my original post:
> workflow = workflow_engine.get_workflow(workflow_id)
>
> # The contents of the workflow object would contain:
> #name: the name of the workflow
> #is_template: is this workflow a template
> #item_type, item_id: what object is the workflow attached to
> #order_id: the current position of the workflow
> #priority: the priority of the workflow
> #steps: list of step as Row objects
> #
> # There would be a few helper methods as well:
> #current_step(): returns the Row object of the current step or None
> #due_date(): returns the current step's due date or None
> #...
>
> I have not built in any security, as I figured that would be something 
> more application-specific. For example, a document management system might 
> want security on folders, just like a regular file system, and 
> not necessarily on a workflow-by-workflow basis.
>
> However, I am planning on adding auditing support. I almost used the new 
> record versioning feature, but decided I wanted to go with delta-based 
> changes instead of full copies of everything for better timeline support.
>
> Additional questions, comments, and improvements are welcome!
>
> On Tuesday, May 1, 2012 4:07:05 PM UTC-4, Cliff wrote:
>>
>> Ross,
>>
>> I like the on-the-fly ability.
>>
>> Each step in your template changes the state of the item.  Each one of 
>> those states should have a title.
>>
>> There are two other states to account for, new and done.
>>
>> Workflows sometimes have more than one path to completion.  
>>
>> I see an entity called a workflow_item that has the ability to determine 
>> its current state and all possible states to which it could transition.  It 
>> also knows who can cause it to transition to one of those states as well as 
>> which of its attributes should be hidden, visible or editable in any given 
>> state, and who should be able to see or edit those attributes while in that 
>> state.
>>
>>
>> On Tuesday, May 1, 2012 12:00:42 PM UTC-4, Ross Peoples wrote:
>>>
>>> In reference to: 
>>> https://groups.google.com/forum/#!searchin/web2py/workflow/web2py/osEmmtu9hlg/2MHi_ZCeMBMJ
>>>
>>> Has anyone done any work on this yet? I was thinking about making a 
>>> web2py-based workflow engine.
>>>
>>> I mentioned previously that I built one of these for an application I 
>>> wrote several years ago, but it was built specifically for that app. This 
>>> will be my first attemp

[web2py] My home made ide

2012-05-03 Thread Ricardo Pedroso
Hi,

Just to let you know that I uploaded to github my ugly home made web2py ide.
It was a big hack to let me do web2py development on my own way.

Basically is a thin "wrapper" around vim (my editor of choice).

I only have linux so I don't know if it works on Mac/Windows (In
theory it should work,
since it's done with wxPython).

Do not expect a polish and beautiful desktop app and probably it will
not work for you. :)

https://github.com/rpedroso/gweb2py

Regards,
Ricardo


[web2py] Re: An insult to web2py ?

2012-05-03 Thread Anthony
First, welcome, and thanks for taking the time to share your thoughts.
 

> Other than trying to start a flame war, I don't see reasons for bringing 
> my comment from the portuguese python group to here.
>

I don't think anyone was trying to start a flame war. I assume he was just 
seeking clarification and perhaps a different perspective. I think most 
folks here welcome discussion about technical issues.
 

> - I know it does not have an orm. 
>

Sorry, perhaps that was a mistranslation, or just my misunderstanding of 
the point you were making.
 

> To me, that is a disadvantage. ORM's were invented the same reason higher 
> level programming languages were. They hide details allowing people to 
> produce more with the same effort.
>

I'm not sure an ORM necessarily provides *more* abstraction than the DAL so 
much as a different *type* of abstraction (an ORM does hide join tables for 
simple many-to-many relations with no extra fields, but some people prefer 
to model and access those tables directly).

As for the nature of the abstraction, there are tradeoffs to consider. Here 
are some of Massimo's thoughts on the advantages of the DAL approach: 
https://groups.google.com/forum/#!msg/web2py/ro1CKfElZQI/4kQfmjrENt4J. He 
also notes that queries with aggregates, left joins, and nested selects are 
easier to do with the DAL. There are benefits to the ORM approach as well, 
so to a large extent this is probably a matter of preference.
 

> -The manual mapping is a consequence of not having an orm. If you have a 
> business model called Department for which there are a lot of 
> domain-specific operations you want to perform (like, say, registering 
> Teachers), you would probably declare a Python class with methods for these 
> operations. When you go to the DAL and make a select for your Department, 
> you get a Row (or whatever is called), not an instance of class Department.
>

This is a fair point, though I suspect in many cases what you would do with 
a model method in an ORM you could do with a computed 
fieldor virtual 
field  in the 
DAL (not sure if virtual fields were around back when you tried web2py). 
For an example of a more class-based approach to models in web2py, though, 
see https://github.com/rochacbruno/Movuca.
 

> - Allowing arbitrary python code on the template is a first step for 
> having templates filled with business logic especially when you work with 
> not-so-perfectionist programmers. Web templates are already a mess because 
> you can intermingle css+javascript+html. If the framework prevents another 
> language to that party, great! Even if it means having to type a few extra 
> chars in another file.
>

I have seen such hypothetical concerns articulated before, but in practice, 
I haven't seen actual web2y users complain about this. Keep in mind that 
all requests in web2py get routed to a controller function, so there isn't 
much motivation to load a template with business logic given that you have 
to create the controller function anyway.

Of course, Django templates allow plenty of logic as well -- the logic is 
simply implemented in a DSL rather than in Python. You can even create 
custom tags and filters (which of course is the first step to having 
templates filled with business logic ;-). Most of the logic you see in 
web2py templates is probably similar to the logic you see in Django 
templates. The advantage of web2py is that you don't have to learn a DSL, 
and you don't get stuck when the DSL happens to lack something you need to 
do.

- The editor is only useful if you're making your first steps in 
> programming. For all other professional programmers it has no value.
>

Well, I don't see anything wrong with catering to new programmers, but I 
disagree that the editor has no value to others -- it can be useful for 
minor edits (especially if you're not at your own machine and need to fix 
something ASAP) and to do some quick experimenting. It is also integrated 
with the debugger, enabling you to set breakpoints.

Even if it is a third party app, you still have to make sure that changes 
> to web2py don't break anything.
>

Since web2py maintains backward compatibility, changes to web2py shouldn't 
break anything, and we're really not spending any significant time 
maintaining the editor. In any case, its mere existence does not seem a 
good reason to avoid or leave the framework.

I think it would be much more useful, for instance, to build an orm on top 
> of the dal.
>

I recall some effort along those lines a while back, but apparently there 
wasn't much interest. I think most folks get along fairly well with the 
DAL, including many former ORM users. That's not to say you shouldn't use 
or even prefer an ORM -- that's why we have different frameworks, to 
satisfy different needs and preferences.
 

> Anyway, I come in peace :)
>

A

Re: [web2py] My home made ide

2012-05-03 Thread Bruno Rocha
Amazing!

I cloned and I am using it now, the console tabs is a killer feature! I
loved having tracebacks and webserver logs here.

Can you explain how the "eval shell" works?

Thank you for sharing this, I will try to contribute!

On Thu, May 3, 2012 at 10:30 PM, Ricardo Pedroso wrote:

> Hi,
>
> Just to let you know that I uploaded to github my ugly home made web2py
> ide.
> It was a big hack to let me do web2py development on my own way.
>
> Basically is a thin "wrapper" around vim (my editor of choice).
>
> I only have linux so I don't know if it works on Mac/Windows (In
> theory it should work,
> since it's done with wxPython).
>
> Do not expect a polish and beautiful desktop app and probably it will
> not work for you. :)
>
> https://github.com/rpedroso/gweb2py
>
> Regards,
> Ricardo
>



-- 

Bruno Rocha
[http://rochacbruno.com.br]


[web2py] Re: web2py resources

2012-05-03 Thread Anthony
On Thursday, May 3, 2012 8:20:28 PM UTC-4, newnomad wrote:
>
> For those without any prior python knowledge, is it useful or essential to 
> first exercise it, using the learnpythonthehardway 
> book for 
> example? Or would it confuse, and is the advise to dive directly into 
> web2py?


I think you can dive directly into web2py (especially if you go through the 
Python chapter in the book), but it's certainly a good idea to gain some 
expertise in Python more generally as well.

Anthony


Re: [web2py] My home made ide

2012-05-03 Thread Ricardo Pedroso
On Fri, May 4, 2012 at 2:41 AM, Bruno Rocha  wrote:
> Amazing!
>
> I cloned and I am using it now, the console tabs is a killer feature! I
> loved having tracebacks and webserver logs here.
>
> Can you explain how the "eval shell" works?

Wow, you were quick...

You must be in debug mode. Then you can evaluate variables, expressions
eval sheel is not very bullet prof if you put an expression with
spaces it will "break".
For example go to debug mode (F2) reload your browser (I think that
you need to reload two times, some
minor gotcha) then write request in eval shell


> Thank you for sharing this, I will try to contribute!

Be aware. The code is really a big mess :)

Ricardo


[web2py] web2py with Google Charts

2012-05-03 Thread weheh
In trying to get web2py to talk to Google charts, I need to be able to 
create a "DataTable" for Google charts that looks like this (taken from 
their doc):

{
  cols: [{id: 'A', label: 'NEW A', type: 'string'},
 {id: 'B', label: 'B-label', type: 'number'},
 {id: 'C', label: 'C-label', type: 'date'}
],
  rows: [{c:[{v: 'a'}, {v: 1.0, f: 'One'}, {v: new Date(2008, 1, 28, 0, 31, 
26), f: '2/28/08 12:31 AM'}]},
 {c:[{v: 'b'}, {v: 2.0, f: 'Two'}, {v: new Date(2008, 2, 30, 0, 31, 
26), f: '3/30/08 12:31 AM'}]},
 {c:[{v: 'c'}, {v: 3.0, f: 'Three'}, {v: new Date(2008, 3, 30, 0, 31
, 26), f: '4/30/08 12:31 AM'}]}
]
}

Problem is, when I create this and then send my view an 
XML(response.json(datatable)) I get everything inside of quotes. In 
particular, I need to get the "c" and "v" values and the "new Date(...)" 
out of quotes, while leaving legitimate strings in quotes. Does anyone know 
a straightforward way to do this?


Re: [web2py] My home made ide - Screenshots

2012-05-03 Thread Ricardo Pedroso
As requested by Massimo, I've upload some screenshots:

https://github.com/rpedroso/gweb2py/raw/master/screenshots/gweb2py00.png
https://github.com/rpedroso/gweb2py/raw/master/screenshots/gweb2py01.png
https://github.com/rpedroso/gweb2py/raw/master/screenshots/gweb2py02.png
https://github.com/rpedroso/gweb2py/raw/master/screenshots/gweb2py03.png


Massimo, in gweb2py00.png as you can see there is a HTTP 404 error
code regarding
a css/artwork.css missing when calling
http://localhost:8000/examples/default/download

Ricardo


[web2py] Very basic question about href and redirect

2012-05-03 Thread Madu
Sorry for this basic question but I don't why the hyperlink is not working:
New DB Insert

What I want is to redirect to this URL when the link is clicked, but when I 
load the page it automatically redirects. I have experienced this with 
other HTML tags too. 
Can somebody please explain why the Python code is executed before the user 
clicks the link? And the correct web2py way of doing it.

Thank you.


[web2py] Re: Very basic question about href and redirect

2012-05-03 Thread pbreit
I think all you want is this:
New DB Insert


[web2py] Re: An insult to web2py ?

2012-05-03 Thread Massimo Di Pierro
Dear Tiago,

No problem at all. All comments can help us improve and or give us an 
opportunity for clarification.

On Thursday, 3 May 2012 16:04:14 UTC-5, Tiago Almeida wrote:
>
> Hi,
>
> Other than trying to start a flame war, I don't see reasons for bringing 
> my comment from the portuguese python group to here.
> Anyway, since Anthony cared to comment I'll also comment.
>
> - I'm glad DAL was re-written. When I left web2py it was a mess and there 
> were many objections to touching it.
>

I do not remember objections. In fact it was rewritten two years ago. It 
just took some time.
 

> - I know it does not have an orm. To me, that is a disadvantage. ORM's 
> were invented the same reason higher level programming languages were. They 
> hide details allowing people to produce more with the same effort.
>

The only difference between a DAL and an ORM is that in the DAL tables are 
instances of one Table class, in an ORM each table is its own class and 
records are instances of that class. This distinction is mostly semantic. 
In our case it I believe it makes dealing with joins, aggregates, and 
combinations, more transparent. I do not believe we have any loss of 
functionality because it is a DAL and not an ORM.
 

> -The manual mapping is a consequence of not having an orm. If you have a 
> business model called Department for which there are a lot of 
> domain-specific operations you want to perform (like, say, registering 
> Teachers), you would probably declare a Python class with methods for these 
> operations. When you go to the DAL and make a select for your Department, 
> you get a Row (or whatever is called), not an instance of class Department. 
> If magic is so great, why don't you like for the framework to magically 
> transform the bytes from the DB into a Department?
>

Not sure I understand. We can do this:

Department = db.define_table('department',Field('name'))
Teacher = 
db.define_table('teacher',Field('name'),Field('department',Departement))
Teacher.insert(name="Max",department=Department.insert(name="CDM"))

for teacher in db(Teacher).select():
 print teacher.name, teacher.department.name

for department in db(Department).select():
 print department.name
 for teacher in department.teacher.select():
   print '-',teacher.name

for row in db(Department.id==Teacher.department).select():
 print row.teacher.name, row.department.name

 

> - Allowing arbitrary python code on the template is a first step for 
> having templates filled with business logic especially when you work with 
> not-so-perfectionist programmers. Web templates are already a mess because 
> you can intermingle css+javascript+html. If the framework prevents another 
> language to that party, great! Even if it means having to type a few extra 
> chars in another file.
>

We agree there should not be logic in templates but there are exceptions 
(for example generating HTML recursively). We allow those exceptions. 
 

> - I agree that the magic regarding request execution is a matter of 
> preference more than a technical one.  
>

> - The editor is only useful if you're making your first steps in 
> programming. For all other professional programmers it has no value. Even 
> if it is a third party app, you still have to make sure that changes to 
> web2py don't break anything. I think it would be much more useful, for 
> instance, to build an orm on top of the dal.
>

I agree about the editor. I use emacs. I still do not see what an ORM buys 
us that we do not already have. Can you provide an example.
 

> Anyway, I come in peace :)
>
>>

[web2py] Re: My home made ide

2012-05-03 Thread Massimo Di Pierro
very nice!

On Thursday, 3 May 2012 20:30:11 UTC-5, Ricardo Pedroso wrote:
>
> Hi, 
>
> Just to let you know that I uploaded to github my ugly home made web2py 
> ide. 
> It was a big hack to let me do web2py development on my own way. 
>
> Basically is a thin "wrapper" around vim (my editor of choice). 
>
> I only have linux so I don't know if it works on Mac/Windows (In 
> theory it should work, 
> since it's done with wxPython). 
>
> Do not expect a polish and beautiful desktop app and probably it will 
> not work for you. :) 
>
> https://github.com/rpedroso/gweb2py 
>
> Regards, 
> Ricardo 
>


[web2py] Re: Very basic question about href and redirect

2012-05-03 Thread Madu
Thanks pbreit!
That was it.
So whatever Python code inside {{}} will be executed, irrespective of the 
link is clicked or not.


On Friday, May 4, 2012 12:30:46 PM UTC+9, pbreit wrote:
>
> I think all you want is this:
> New DB Insert
>


[web2py] Re: Very basic question about href and redirect

2012-05-03 Thread Anthony
On Thursday, May 3, 2012 11:25:01 PM UTC-4, Madu wrote:
>
> Sorry for this basic question but I don't why the hyperlink is not working:
> New DB Insert
>

Note, redirect('some_url') is equivalent to raise HTTP(303, 
Location='some_url').  So, when redirect() is called, you are raising an 
exception, which immediately aborts the current request and proceeds to 
send a redirect response to the browser. Since you call redirect() in your 
view, when web2py renders the view, it will immediately issue the redirect 
response upon executing that line in the view. See 
http://web2py.com/books/default/chapter/29/4#HTTP-and-redirect.

In HTML, the anchor tag simply takes a plain URL as the href attribute. 
When the user clicks the link, they are not being "redirected" -- they are 
merely requesting a web page. A "redirect" is an instruction returned by 
the server to the browser (i.e., a 30x response) telling the browser to 
request a different URL instead of the URL originally requested. In this 
case, you just want:

New DB Insert

Anthony


[web2py] Re: CMS question

2012-05-03 Thread Massimo Di Pierro
This is what I have so far.

https://github.com/mdipierro/w2cms

requires beautifulsoup

still requires some work, specifically testing and usability. In order to 
edit-in-place you must click on the text then edit it. If you cut and part 
a link to you a youtube page, it will embed the video. If you cut and paste 
a link to an image, it will embed the image. Same for audio, video, flickr 
pages, etc.

The download of remote pages mostly works but if they use an old version of 
jQuery, it may break the page and the ability to edit it.

If you edit raw html for a page and add a class "editable" to one or more 
elements, only those elements will be editable, not the entire page.

It lack a way to create groups and join groups. It only creates a group per 
person (same name as username) and "virtual" group "everybody".

There are lots of small details which I have not explained because I am not 
sure myself this works as I want or that I know how I want it to work.



[web2py] Re: Very basic question about href and redirect

2012-05-03 Thread Anthony

>
> So whatever Python code inside {{}} will be executed, irrespective of the 
> link is clicked or not.
>

Note, the Python code is not sent to the browser. When a web2py URL is 
requested, before returning a response to the browser, web2py executes the 
template on the server. At that time, all the Python code in the template 
is executed with the purpose of generating the HTML to send to the browser. 
The purpose of the Python code in the template should be to generate the 
HTML for the page. If you happen to call redirect() within the template, 
you'll get an actual redirect right then -- the rest of the HTML will not 
be generated, and the request will be aborted.

Anthony


Re: [web2py] My home made ide - Screenshots

2012-05-03 Thread José Ricardo Borba
Very impressive. Very good job. I will be glad if you share with us.

José Ricardo Borba
Porto Alegre - RS

2012/5/3 Ricardo Pedroso 

> As requested by Massimo, I've upload some screenshots:
>
> https://github.com/rpedroso/gweb2py/raw/master/screenshots/gweb2py00.png
> https://github.com/rpedroso/gweb2py/raw/master/screenshots/gweb2py01.png
> https://github.com/rpedroso/gweb2py/raw/master/screenshots/gweb2py02.png
> https://github.com/rpedroso/gweb2py/raw/master/screenshots/gweb2py03.png
>
>
> Massimo, in gweb2py00.png as you can see there is a HTTP 404 error
> code regarding
> a css/artwork.css missing when calling
> http://localhost:8000/examples/default/download
>
> Ricardo
>



-- 
José Ricardo Borba

UFRGS - Instituto de Física
L3FNano - 43173 room 101
Lab:55-51-3308-6457 / Office: 55-51-3308-6530
Mobile:55-51-8184-7649 / Fax:   55-51-3308-7286


Re: [web2py] My home made ide - Screenshots

2012-05-03 Thread Kenny Chung
beautiful. looking great!

On Thu, May 3, 2012 at 9:12 PM, José Ricardo Borba wrote:

> Very impressive. Very good job. I will be glad if you share with us.
>
> José Ricardo Borba
> Porto Alegre - RS
>
>
> 2012/5/3 Ricardo Pedroso 
>
>> As requested by Massimo, I've upload some screenshots:
>>
>> https://github.com/rpedroso/gweb2py/raw/master/screenshots/gweb2py00.png
>> https://github.com/rpedroso/gweb2py/raw/master/screenshots/gweb2py01.png
>> https://github.com/rpedroso/gweb2py/raw/master/screenshots/gweb2py02.png
>> https://github.com/rpedroso/gweb2py/raw/master/screenshots/gweb2py03.png
>>
>>
>> Massimo, in gweb2py00.png as you can see there is a HTTP 404 error
>> code regarding
>> a css/artwork.css missing when calling
>> http://localhost:8000/examples/default/download
>>
>> Ricardo
>>
>
>
>
> --
> José Ricardo Borba
>
> UFRGS - Instituto de Física
> L3FNano - 43173 room 101
> Lab:55-51-3308-6457 / Office: 55-51-3308-6530
> Mobile:55-51-8184-7649 / Fax:   55-51-3308-7286
>
>


[web2py] default/user.html and custom form

2012-05-03 Thread Annet
I'd like to divide the default/user.html forms into a body and footer part, 
the body containing the fields the footer containing the cancel and submit 
button, something like this:


  
Login with your Leonexus ID
   
  
  Enter your username and password

  the form fields here

   
  

  the form controls here

   
  

Is there a way to split the form in these components?


Kind regards,

Annet


Re: [web2py] default/user.html and custom form

2012-05-03 Thread Bruno Rocha
http://web2py.com/books/default/chapter/29/7#Custom-forms

On Fri, May 4, 2012 at 3:30 AM, Annet  wrote:

> 
>   
> Login with your Leonexus ID
>
>   
>   Enter your username and password
>
>   {{=form.custom.begin}}
>
>   {{=form.custom.username.widget}}
>   {{=form.custom.password.widget}}
>

>
   
>   
>
>   {{=form.custom.end}}
>

>
>   
>



-- 

Bruno Rocha
[http://rochacbruno.com.br]