[web2py] Re: web2py Reference Manual -- a call to arms

2010-07-13 Thread mdipierro
It depends. If the docstrings are well written they can be useful to
both.

On 13 Lug, 21:52, weheh  wrote:
> Massimo, isn't epydocs more geared to the web2py developer than the
> user? I agree, embedding the user documentation into the code is
> desireable (write once, serve many). But, users and developers have
> differing needs and comprehension levels. If the output of epydocs can
> be optimized to also support reading by a web2py user through a
> combination of information filtering, document formatting conventions
> and templates, and user comments, then I'm all in favor of it as it
> will likely save time and effort.


[web2py] Re: T2, T3, Cube2py ...

2010-07-13 Thread mdipierro
LOL

what I meant is "give instructions to the computer" without having to
learn about "loops and conditionals"


On 13 Lug, 20:42, Thadeus Burgess  wrote:
> >> easier programming without coding.
>
> LOL =)
>
> Best un-intentional oxy-moron I have read in a while
>
> --
> Thadeus
>
> On Tue, Jul 13, 2010 at 4:53 PM, mdipierro  wrote:
> > This video is already obsolete:
>
> >    http://www.vimeo.com/13154869
>
> > The goal is to build an additional layer on top of web2py that would
> > allow:
> > - easier programming without coding
> > - integrate some content management functionality
> > - could potentially become a new welcome (scaffolding) app
>
> > T2,T3,Cube2py are all experiments. Cube2py is the latest. I still do
> > not promise backward compatibility because it is an app.
>
> > On 13 Lug, 14:49, Jeff S  wrote:
> >> Hi,
>
> >> I'm not sure I understand all of this T2 T3 and Cube2py stuff.  I have
> >> recently installed web2py(1.76.3) on my computer and I read somewhere
> >> that T2, T3 are deprecated and Cube2py would be the new stuff.  But
> >> what is T2 and T3 anyway?  Is it like project code names that were
> >> included in web2py as upgrades like CRUD got included some time ago?
>
> >> What is the direction of web2py with cube2py?  As far as I understand
> >> it, T3 is part of web2py, no?  Cube2py only looks like another
> >> application like anyone that can be installed on web2py, or is it more
> >> than that?  Actually Cube2py does not seem to work with my 1.76.3.  I
> >> guess I'll have to upgrade to the latest revision in order to use
> >> Cube2py.
>
> >> Thanks,


[web2py] Re: need help on managinge passwords by administrator

2010-07-13 Thread mdipierro
You can disable registration

auth.settings.actions_disabled.append('register')

You can register users and set a password for them using appadmin or
implement your own page that contains

form=crud.create(db.auth_user,onaccept=send_email)

where send email will tell the user to click on change password link.


On 13 Lug, 19:54, Frank  wrote:
> I try to manage the users' passwords by administrator,the rules are,
> users can not register by themself, only administrator can
> register.administrator set the password and send a email to user to provide a
> link,user click the link and login with the password that is prvovided in the
> email.users can do everingthngs like profile, retrive, change, reset on auth
> except registering .
> I need your help to find out whether there are easy way to do that and how?
> sound like reset or retrieve password process by administrator?
> thanks in advance,
> Frank.


[web2py] Re: ajax widget - asynchronously updated

2010-07-13 Thread weheh
Massimo, does this solve the problem I'm having? I have a background
queue serving an app. The ajax script should refresh the DIV to show
the status of the item of interest whilst the item is on the queue.
Once the item is processed, it's deleted from the queue and the output
is to be displayed in the div. At this point, polling for that DIV
should stop and no longer consume any CPU cycles.

I'm using jQuery everyTime. Problem is, once the timer is set upon
page refresh, it never stops, even if I overwrite the script. I
believe the right thing is to use jQuery's oneTime, but it only fires
one time, even if I try to overwrite the script. So I've debugged it
and the script only gets loaded once. Will thie ".load" watchamacallit
do the trick?


[web2py] Re: web2py Reference Manual -- a call to arms

2010-07-13 Thread weheh
Massimo, isn't epydocs more geared to the web2py developer than the
user? I agree, embedding the user documentation into the code is
desireable (write once, serve many). But, users and developers have
differing needs and comprehension levels. If the output of epydocs can
be optimized to also support reading by a web2py user through a
combination of information filtering, document formatting conventions
and templates, and user comments, then I'm all in favor of it as it
will likely save time and effort.


[web2py] Re: cube2py news

2010-07-13 Thread Scott
Massimo,

I'll take a look at the arguments and instructions tomorrow and give
you a report.

Cheers,
--Scott

On Jul 13, 5:49 am, mdipierro  wrote:
> Please checkout cube2py again. Now it has two new features:
>
> 1) a button [widget builder] that allows you to build widgets from a
> menu with ajax popup. It could not get easier.
>
> I could use somebody to go over the list of arguments and instructions
> shown in the builder to make sure they are consistent.
>
> 2) the widgets can also be embedded if plugin_wiki_mode='html' with
> elRTE wysiwyg editor, but elRTE has to be in 'source' mode so you can
> use cube2py without using MARKMIN.
>
> Massimo


[web2py] Re: openwysiwyg?

2010-07-13 Thread Scott
Never used it.


Re: [web2py] Re: T2, T3, Cube2py ...

2010-07-13 Thread Thadeus Burgess
>> easier programming without coding.

LOL =)

Best un-intentional oxy-moron I have read in a while

--
Thadeus





On Tue, Jul 13, 2010 at 4:53 PM, mdipierro  wrote:
> This video is already obsolete:
>
>     http://www.vimeo.com/13154869
>
> The goal is to build an additional layer on top of web2py that would
> allow:
> - easier programming without coding
> - integrate some content management functionality
> - could potentially become a new welcome (scaffolding) app
>
> T2,T3,Cube2py are all experiments. Cube2py is the latest. I still do
> not promise backward compatibility because it is an app.
>
> On 13 Lug, 14:49, Jeff S  wrote:
>> Hi,
>>
>> I'm not sure I understand all of this T2 T3 and Cube2py stuff.  I have
>> recently installed web2py(1.76.3) on my computer and I read somewhere
>> that T2, T3 are deprecated and Cube2py would be the new stuff.  But
>> what is T2 and T3 anyway?  Is it like project code names that were
>> included in web2py as upgrades like CRUD got included some time ago?
>>
>> What is the direction of web2py with cube2py?  As far as I understand
>> it, T3 is part of web2py, no?  Cube2py only looks like another
>> application like anyone that can be installed on web2py, or is it more
>> than that?  Actually Cube2py does not seem to work with my 1.76.3.  I
>> guess I'll have to upgrade to the latest revision in order to use
>> Cube2py.
>>
>> Thanks,
>


[web2py] need help on managinge passwords by administrator

2010-07-13 Thread Frank
I try to manage the users' passwords by administrator,the rules are,
users can not register by themself, only administrator can
register.administrator set the password and send a email to user to provide a
link,user click the link and login with the password that is prvovided in the
email.users can do everingthngs like profile, retrive, change, reset on auth
except registering .
I need your help to find out whether there are easy way to do that and how?
sound like reset or retrieve password process by administrator?
thanks in advance, 
Frank.





[web2py] Re: web2py Reference Manual -- a call to arms

2010-07-13 Thread mdipierro
I would look into the most common files

globals.py
html.py
sql.py

only stuff defined in these files is exposed to users. The rest is all
internals.

On 13 Lug, 17:31, Bruno Rocha  wrote:
> Massimo, could you provide a list with reference to the files that need docs?
> any way or idea, to separate, distribute the tasks, manage the
> versions and make the moderation of docstrings.
>
> I can help with that, a little every day, I reserve some hours of my
> day for this task, it would be interesting even to me, so I learn more
> about the framework, and it helps me to formulate training material
> for my Python-Web2py classes, and to write the articles to the blog
> and IT-Magazine that I mentioned to you by mail.
>
> I agree with you, and I believe in future the documentation generated
> in docstring could be shifted toward an easy reference guide.
>
> Furthermore, I advocate using a help forum (PyForum), instead of
> concentrating everything in the group,I like most of the style of
> organizing a forum, I'm pretty used to seek help in ubuntuforuns and
> several others, IMHO Forum has much more effective role in providing
> help than a list like this, forum is easy to search, best indexed by
> search engines, best with usability, navigation etc.
>
> How can we start with docstrings?
>
> 2010/7/13 mdipierro :
>
>
>
> > That is the problem.
>
> > for people who seriously want to help. Setting up another wiki is not
> > help. Instead, adopt a web2py file, add docstrings to all functions.
>
> > On 13 Lug, 16:38, ra3don  wrote:
> >> Yeah i noticed its a little hard to comprehend sometime if you have no
> >> idea whats going on. Some entries don't have descriptions at all, just
> >> leaves you scratching your head.
>
> >> On Jul 12, 10:25 pm, weheh  wrote:
>
> >> > @MDP: No reason for GAE in particular other than it's free initially
> >> > and because it's a showcase. Any server is good, as long as the url is
> >> > something like web2py.com/reference. There is no performance issue
> >> > with the current doc.
>
> >> > @ra3don: Epydocs have very little verbiage and is indecipherable to
> >> > the average user, IMHO.
>
> --
>
> http://rochacbruno.com.br


Re: [web2py] Re: Can web2py be used as a node in a P2P app or store data in a DHT?

2010-07-13 Thread Luis Díaz
ask
You can create an intranet-style distributed in web2py p2p?

Each client node is connected to the primary node and stores your content:
reference bone contents (not the full content)

client nodes are connected to the main content to search and locate the
reference of closest nodes which serve them.

"Physically closest nodes, could make a copy (cache) of the busiest nodes,
thus the network would be more fluid

benefits:
 - Web2py anyone with internet and could have a site and distribute their
content.
 - An advertising system Distributed nodes function as cache, will share $ $
advertising

problem: possibly the nodes (computers web2py) are behind a router, NAT or
firewall and have no public ip (just can not be seen from outside).

possible solution
google app engine mounted on an application with web2py function as the
primary node and this officer as a tunnel to the nodes are not visible (or
all)

I had the inspiration to read the following article:
http://sentidoweb.com/2009/12/17/w2w-la-web-vista-desde-el-p2p.php

My general idea may be difficult to explain, besides I write in Spanish and
translate with google.

do not understand I can make an illustration
--
Pregunto:
Es posible crear un intranet distribuida estilo p2p en web2py?

Cada nodo cliente se conecta al nodo principal y registra su contenido: osea
referencia de contenido (no los contenido completos)

los nodos cliente se conectan al principal para hacer busqueda de contenido
y ubicar la referencia de cuales nodos mas cercanos los sirven.

-los nodos mas cercanos físicamente, podrían hacer un copia (cache) de los
nodos mas concurridos, de esta forma al red seria mas fluida

beneficios:
 - cualquiera con internet y web2py podria tener un sitio y distribuir su
contenido.
 - un sistema de publicidad distribuida: los nodos que funcionen como cache,
tendrán una cuota $$ publicitaria

problema: posiblemente los nodos clientes (equipos con web2py) esten detrás
de un router, NAT o firewall y no tengan ip publicas (simplemente no puedan
ser vista desde afuera).

posible solución:
montar en google app engine una aplicacion con web2py que funcione como nodo
principal y este funcionaria como tunel para los nodos clientes no visibles
(o todos)

la inspiración la tuve al leer el siguiente articulo:
http://sentidoweb.com/2009/12/17/w2w-la-web-vista-desde-el-p2p.php

mi idea general, puede ser complicada de explicar, ademas que escribo en
español y la traduzco con google.

si no entiende puedo hacer una ilustración





2010/7/13 mdipierro 

> This can be done. I am very much interested in having this done. My
> idea is building a distributed news delivery network. Anybody can run
> and advertise a news web site. Every local installation would have
> local ads and the right to post news and vote for news. But news are
> not stored locally (only a copy) so the news network cannot be shut
> down.
>
> Massimo
>
> On 12 Lug, 22:43, xenfasa  wrote:
> > Can web2py be used as a node in a P2P app or store data in a DHT?
> >
> > For example, a user wishing to run a web2py P2P app node would install
> > web2py then the application file(s).  Access the application through a
> > web interface but then in the backend, instead of storing data just
> > locally, have the P2P back-end application share and manage data in
> > the form of encrypted Distributed Hash Table  (DHT) amoung other
> > web2py nodes?
> >
> > For example something like Khashmir (http://khashmir.sourceforge.net/)
> >  be integrated with web2py?
> > if so how?
> >
> > thanks,
> > xen
>



-- 
Díaz Luis
TSU Analisis de Sistemas
Universidad de Carabobo


[web2py] Re: i need help

2010-07-13 Thread sarsar
My problem probably is that i dont know python well to construct the
function . Following all examples and some examples from the
appliances , ii have a working program , based on the radio example of
yours, but no cimilar example  or discussion inside the group , for
what i am trying to do .

def  checkifthe datainside db.candidate.created_by_id is equal with
the curent_loggedin_user_id
 if equal then  redirect to show_candidate() function working
with crud.read
 else redirect to edit_candidate() function with crud.update
so form can be executed for first time
return (what)

I believe that my problem is not at the logical level but at coding
level , of creating a function that doesnot comes from another page
like comments on an existing wiki or blog page .  I better say that my
python knowledge is small to fill up the details for such a function .

I ll apreciate if you could give me some of your precious time .
Thanks again
Sarados

On 14 Ιούλ, 01:23, sarsar  wrote:
> sory i pressed wrong button . I sent my message to you , so probably i
> have to responde again
>
> On 14 Ιούλ, 00:34, mdipierro  wrote:
>
> > say you have this
>
> > create_by=Field('created_by',db.auth_user,default=auth.user_id,writable=False,label=T('created
> > by')
>
> > db.define_table('atable,Field('data'),created_by)
>
> > you can retrieve rows created by the current user with
>
> > rows=db(db.atable.created_by==auth.user_id).select()
>
> > On 13 Lug, 16:27, sarsar  wrote:
>
> > >   Hi , maybe because it is to late here , or because i am rather old
> > > and slow learning , i am in front of a problem i cannot find the
> > > solution . As i dont now python , i cannot combine something that
> > > logicaly is very simple and easy to do , but i can find the correct
> > > code to do it .  I declare a candidate with many fields and one field
> > > is ...
> > > ('created_by',db.auth_user,default=auth.user_id,writable=False,label=T('created
> > > by') .
> > >    I want each user to login (after registration) and fill up the form
> > > ONCE .  If the user has filled up the form , then he can only see his
> > > own data . and if he tries to see again the form then he has to be
> > > redirected again to index page . I have understanded that i have to
> > > check and compare the current logged user with the field inside the
> > > db.candidate.created_by But i cant do the coding . one small example
> > > would help me . Thanks in advance .


[web2py] Re: how to make a sql query with os.system

2010-07-13 Thread mmartinez
web2py to do so

import os
command="psql -U marcelo -c select
call_inicio,call_duracion,call_timedura,call_num_destino,call_dialstatus,call_valor,call_ip
from llamadas_moviles WHERE call_fecha >= '2010-7-5' and call_fecha <=
'2010-7-11' order by call_inicio" chips > /var/www/downloads/
13072010.csv"
os.system(command)

i get error in form


Re: [web2py] Re: oauth

2010-07-13 Thread Michele Comitini
:O
ok i put myself into troubles ;-)

2010/7/13 mdipierro 

> I'll wait for a patch then. ;-)
>
> On 13 Lug, 15:54, Michele Comitini  wrote:
> > Hi Massimo,
> >
> > From my experience with facebook auth,  I am quite confident that a login
> > method can made a generic OAuth 2.0 without introducing dependencies on
> > httplib and oauth as the pointed in the article.  Web2py has already
> > everything needed.
> >
> > ciao,
> > mic
> >
> > 2010/7/13 mdipierro 
> >
> > > I need a modified version of
> >
> > >   gluon/contrib/login_methods/linkedin_account.py
> >
> > > that works with oauth as explained here
> > >http://dougwarren.org/2010/06/oauth-and-web2py-part-1/,
> > > is integrated with web2py auth as linkedin_account.py, but also works
> > > out of the box with facebook and twitter.
> >
> > > If you have anything relevant please let me know.
> >
> > > Massimo
>


Re: [web2py] Re: web2py Reference Manual -- a call to arms

2010-07-13 Thread Bruno Rocha
Massimo, could you provide a list with reference to the files that need docs?
any way or idea, to separate, distribute the tasks, manage the
versions and make the moderation of docstrings.

I can help with that, a little every day, I reserve some hours of my
day for this task, it would be interesting even to me, so I learn more
about the framework, and it helps me to formulate training material
for my Python-Web2py classes, and to write the articles to the blog
and IT-Magazine that I mentioned to you by mail.

I agree with you, and I believe in future the documentation generated
in docstring could be shifted toward an easy reference guide.

Furthermore, I advocate using a help forum (PyForum), instead of
concentrating everything in the group,I like most of the style of
organizing a forum, I'm pretty used to seek help in ubuntuforuns and
several others, IMHO Forum has much more effective role in providing
help than a list like this, forum is easy to search, best indexed by
search engines, best with usability, navigation etc.

How can we start with docstrings?



2010/7/13 mdipierro :
> That is the problem.
>
> for people who seriously want to help. Setting up another wiki is not
> help. Instead, adopt a web2py file, add docstrings to all functions.
>
> On 13 Lug, 16:38, ra3don  wrote:
>> Yeah i noticed its a little hard to comprehend sometime if you have no
>> idea whats going on. Some entries don't have descriptions at all, just
>> leaves you scratching your head.
>>
>> On Jul 12, 10:25 pm, weheh  wrote:
>>
>> > @MDP: No reason for GAE in particular other than it's free initially
>> > and because it's a showcase. Any server is good, as long as the url is
>> > something like web2py.com/reference. There is no performance issue
>> > with the current doc.
>>
>> > @ra3don: Epydocs have very little verbiage and is indecipherable to
>> > the average user, IMHO.



-- 

http://rochacbruno.com.br


[web2py] Re: Upgrade web2py now(from 1.76.3 to 1.80.1)

2010-07-13 Thread Jeff S
Microsoft Windows XP, Professional Version 2002 Service Pack 3

I will re-install web2py.

Thanks,


[web2py] Re: i need help

2010-07-13 Thread sarsar
sory i pressed wrong button . I sent my message to you , so probably i
have to responde again

On 14 Ιούλ, 00:34, mdipierro  wrote:
> say you have this
>
> create_by=Field('created_by',db.auth_user,default=auth.user_id,writable=False,label=T('created
> by')
>
> db.define_table('atable,Field('data'),created_by)
>
> you can retrieve rows created by the current user with
>
> rows=db(db.atable.created_by==auth.user_id).select()
>
> On 13 Lug, 16:27, sarsar  wrote:
>
> >   Hi , maybe because it is to late here , or because i am rather old
> > and slow learning , i am in front of a problem i cannot find the
> > solution . As i dont now python , i cannot combine something that
> > logicaly is very simple and easy to do , but i can find the correct
> > code to do it .  I declare a candidate with many fields and one field
> > is ...
> > ('created_by',db.auth_user,default=auth.user_id,writable=False,label=T('created
> > by') .
> >    I want each user to login (after registration) and fill up the form
> > ONCE .  If the user has filled up the form , then he can only see his
> > own data . and if he tries to see again the form then he has to be
> > redirected again to index page . I have understanded that i have to
> > check and compare the current logged user with the field inside the
> > db.candidate.created_by But i cant do the coding . one small example
> > would help me . Thanks in advance .


Re: [web2py] Re: openwysiwyg?

2010-07-13 Thread Stef Mientki
 On 13-07-2010 23:07, Pepe wrote:
> never used it.

and how many people do you think are interested in what else you didn't do ?
cheers,
Stef


[web2py] how to make a sql query with os.system

2010-07-13 Thread mmartinez
the console is:
psql -U marcelo -c "select call_inicio, call_duracion, call_timedura,
call_num_destino, call_dialstatus, call_valor, call_ip from
llamadas_moviles WHERE call_fecha >= '2010-7-5' and call_fecha <=
'2010-7-11' order by call_inicio" chips > /var/www/downloads/
13072010.csv

as serious with web2py


Re: [web2py] Re: openwysiwyg?

2010-07-13 Thread Albert Abril
Me neither.

On Tue, Jul 13, 2010 at 11:07 PM, Pepe  wrote:

> never used it.
>
> On Jul 13, 4:55 pm, Chris S  wrote:
> > Ditto, never used it
> >
> > On Jul 13, 3:50 pm, Bruno Rocha  wrote:
> >
> >
> >
> > > Never used it
> >
> > > 2010/7/13 MikeEllis :
> >
> > > > FWIW, openwysiwyg doesn't work in Chrome.
> > > > Mike
> >
> > > > On Jul 13, 1:19 pm, Jean-Guy  wrote:
> > > >> Never used it!
> >
> > > >> Jonhy
> >
> > > >> On 2010-07-13 13:02, mdipierro wrote:
> >
> > > >> > on a view [htmledit]. Do you use it?
> >
> > > --
> >
> > >http://rochacbruno.com.br
>


[web2py] Re: cube2py news

2010-07-13 Thread mdipierro
let me add, the point for using markmin is that you cannot add
whitespaces arbitrarily but have to hanlde spaces via css.

On 13 Lug, 17:07, Chris S  wrote:
> Ah great, you're correct GAE does not start at id==1 (or it doesn't
> guarantee it).
>
> Any chance we could make the 'editor' group a variable so that when
> importing it into existing applications we can set the name to be that
> of an already created 'admin' group?
> Another thing I've been doing recently is to make the {{extend
> 'layout.html'}} in all of the views a varriable.  This lets me easily
> swap to a different layout with out having to rename files, or even
> swap on the fly.  I can manually do this but it might be something
> worth putting into the files.  It could just be set with the other
> 'required' globals to default to 'layout.html'.
>
> This looks really great I love the storing of pages in a DB and the
> auto-history tracking.  How do I go about inserting page breaks 
> or white space in markmin?  So far that's the only thing making me
> want to stick to WYSIWYG editing in HTML, though I like the look of
> markmin.
>
> On Jul 13, 4:06 pm, mdipierro  wrote:
>
> > The first user (id==1) is editor by default (but not on GAE). Create a
> > group with role='editor' and make yourself member using appadmin.
>
> > On 13 Lug, 13:11, Chris S  wrote:
>
> > > Ah it's an authorization thing.
>
> > > I can get myself to the the index page now, but I'm still not sure how
> > > I make myself a 'plugin_wiki_editor' I tried creating a group of that
> > > name and using appadmin to add my login to that group but that didn't
> > > work.  Maybe I'm missing something easy, or maybe the first registered
> > > user needs to become an 'editor'?  I'm not sure how anyone gets to be
> > > an editor if you have to first be one to assign the rights...
>
> > > On Jul 13, 12:42 pm, Chris S  wrote:
>
> > > > I also meant to ask, does plugin_wiki just come with cube2py?  Can it
> > > > also be downloaded somewhere separately?
> > > > I thought it could, but I can't find it anwywhere.  Can someone point
> > > > me to where plugin_wiki is?
>
> > > > On Jul 13, 12:39 pm, Chris S  wrote:
>
> > > > > I just loaded the latest trunk, and the latest cube2py 
> > > > > at:https://cube2py.googlecode.com/hg/cube2py
>
> > > > > I cleared the datastore and memcache then pointed my browser to
> > > > > 127.0.0.1:8080/cube2py
>
> > > > > I get the login screen, but when I try to register I get a 404.  The
> > > > > entire log from the initial page view to the redirect to home is shown
> > > > > below.
> > > > > Am I using the correct location for the cube2py repository?
>
> > > > > --Complete Log--
> > > > > INFO     2010-07-13 17:35:46,755 gaehandler.py:57]  Request:
> > > > > 25.00ms/25.65ms (real time/cpu time)
> > > > > INFO     2010-07-13 17:35:46,780 dev_appserver.py:3268] "GET /cube2py
> > > > > HTTP/1.1" 303 -
> > > > > INFO     2010-07-13 17:35:46,835 gaehandler.py:57]  Request:
> > > > > 23.00ms/23.60ms (real time/cpu time)
> > > > > INFO     2010-07-13 17:35:46,862 dev_appserver.py:3268] "GET /cube2py/
> > > > > plugin_wiki/page/home HTTP/1.1" 303 -
> > > > > INFO     2010-07-13 17:35:46,921 gaehandler.py:57]  Request:
> > > > > 27.00ms/26.93ms (real time/cpu time)
> > > > > INFO     2010-07-13 17:35:46,947 dev_appserver.py:3268] "GET /cube2py/
> > > > > default/user/login HTTP/1.1" 200 -
> > > > > ERROR    2010-07-13 17:35:47,092 dev_appserver.py:2633] Error
> > > > > encountered reading file "C:\Users\chris.sanders\Documents\Misc
> > > > > \workspace\WebDev\applications/cube2py/static/echo/images/ddd-
> > > > > gradient.jpg":
> > > > > [Errno 2] No such file or directory: 'C:\\Users\\chris.sanders\
> > > > > \Documents\\Misc\\workspace\\WebDev\\applications/cube2py/static/echo/
> > > > > images/ddd-gradient.jpg'
> > > > > INFO     2010-07-13 17:35:47,118 dev_appserver.py:3268] "GET /cube2py/
> > > > > static/echo/images/ddd-gradient.jpg HTTP/1.1" 404 -
> > > > > INFO     2010-07-13 17:35:51,035 gaehandler.py:57]  Request:
> > > > > 29.00ms/28.97ms (real time/cpu time)
> > > > > INFO     2010-07-13 17:35:51,062 dev_appserver.py:3268] "GET /cube2py/
> > > > > default/user/register HTTP/1.1" 200 -
> > > > > ERROR    2010-07-13 17:35:51,206 dev_appserver.py:2633] Error
> > > > > encountered reading file "C:\Users\chris.sanders\Documents\Misc
> > > > > \workspace\WebDev\applications/cube2py/static/echo/images/ddd-
> > > > > gradient.jpg":
> > > > > [Errno 2] No such file or directory: 'C:\\Users\\chris.sanders\
> > > > > \Documents\\Misc\\workspace\\WebDev\\applications/cube2py/static/echo/
> > > > > images/ddd-gradient.jpg'
> > > > > INFO     2010-07-13 17:35:51,230 dev_appserver.py:3268] "GET /cube2py/
> > > > > static/echo/images/ddd-gradient.jpg HTTP/1.1" 404 -
> > > > > INFO     2010-07-13 17:36:01,484 gaehandler.py:57]  Request:
> > > > > 57.00ms/57.08ms (real time/cpu time)
> > > > > INFO     2010-07-13 17:36:01,512 dev_appserve

[web2py] Re: cube2py news

2010-07-13 Thread mdipierro
You can override the default behavior, just set in db.py

plugin_wiki_editor = . your condition 

You cannot insert white spaces in markmin unless you do

  `` ``:template

but it is horrible.

On 13 Lug, 17:07, Chris S  wrote:
> Ah great, you're correct GAE does not start at id==1 (or it doesn't
> guarantee it).
>
> Any chance we could make the 'editor' group a variable so that when
> importing it into existing applications we can set the name to be that
> of an already created 'admin' group?
> Another thing I've been doing recently is to make the {{extend
> 'layout.html'}} in all of the views a varriable.  This lets me easily
> swap to a different layout with out having to rename files, or even
> swap on the fly.  I can manually do this but it might be something
> worth putting into the files.  It could just be set with the other
> 'required' globals to default to 'layout.html'.
>
> This looks really great I love the storing of pages in a DB and the
> auto-history tracking.  How do I go about inserting page breaks 
> or white space in markmin?  So far that's the only thing making me
> want to stick to WYSIWYG editing in HTML, though I like the look of
> markmin.
>
> On Jul 13, 4:06 pm, mdipierro  wrote:
>
> > The first user (id==1) is editor by default (but not on GAE). Create a
> > group with role='editor' and make yourself member using appadmin.
>
> > On 13 Lug, 13:11, Chris S  wrote:
>
> > > Ah it's an authorization thing.
>
> > > I can get myself to the the index page now, but I'm still not sure how
> > > I make myself a 'plugin_wiki_editor' I tried creating a group of that
> > > name and using appadmin to add my login to that group but that didn't
> > > work.  Maybe I'm missing something easy, or maybe the first registered
> > > user needs to become an 'editor'?  I'm not sure how anyone gets to be
> > > an editor if you have to first be one to assign the rights...
>
> > > On Jul 13, 12:42 pm, Chris S  wrote:
>
> > > > I also meant to ask, does plugin_wiki just come with cube2py?  Can it
> > > > also be downloaded somewhere separately?
> > > > I thought it could, but I can't find it anwywhere.  Can someone point
> > > > me to where plugin_wiki is?
>
> > > > On Jul 13, 12:39 pm, Chris S  wrote:
>
> > > > > I just loaded the latest trunk, and the latest cube2py 
> > > > > at:https://cube2py.googlecode.com/hg/cube2py
>
> > > > > I cleared the datastore and memcache then pointed my browser to
> > > > > 127.0.0.1:8080/cube2py
>
> > > > > I get the login screen, but when I try to register I get a 404.  The
> > > > > entire log from the initial page view to the redirect to home is shown
> > > > > below.
> > > > > Am I using the correct location for the cube2py repository?
>
> > > > > --Complete Log--
> > > > > INFO     2010-07-13 17:35:46,755 gaehandler.py:57]  Request:
> > > > > 25.00ms/25.65ms (real time/cpu time)
> > > > > INFO     2010-07-13 17:35:46,780 dev_appserver.py:3268] "GET /cube2py
> > > > > HTTP/1.1" 303 -
> > > > > INFO     2010-07-13 17:35:46,835 gaehandler.py:57]  Request:
> > > > > 23.00ms/23.60ms (real time/cpu time)
> > > > > INFO     2010-07-13 17:35:46,862 dev_appserver.py:3268] "GET /cube2py/
> > > > > plugin_wiki/page/home HTTP/1.1" 303 -
> > > > > INFO     2010-07-13 17:35:46,921 gaehandler.py:57]  Request:
> > > > > 27.00ms/26.93ms (real time/cpu time)
> > > > > INFO     2010-07-13 17:35:46,947 dev_appserver.py:3268] "GET /cube2py/
> > > > > default/user/login HTTP/1.1" 200 -
> > > > > ERROR    2010-07-13 17:35:47,092 dev_appserver.py:2633] Error
> > > > > encountered reading file "C:\Users\chris.sanders\Documents\Misc
> > > > > \workspace\WebDev\applications/cube2py/static/echo/images/ddd-
> > > > > gradient.jpg":
> > > > > [Errno 2] No such file or directory: 'C:\\Users\\chris.sanders\
> > > > > \Documents\\Misc\\workspace\\WebDev\\applications/cube2py/static/echo/
> > > > > images/ddd-gradient.jpg'
> > > > > INFO     2010-07-13 17:35:47,118 dev_appserver.py:3268] "GET /cube2py/
> > > > > static/echo/images/ddd-gradient.jpg HTTP/1.1" 404 -
> > > > > INFO     2010-07-13 17:35:51,035 gaehandler.py:57]  Request:
> > > > > 29.00ms/28.97ms (real time/cpu time)
> > > > > INFO     2010-07-13 17:35:51,062 dev_appserver.py:3268] "GET /cube2py/
> > > > > default/user/register HTTP/1.1" 200 -
> > > > > ERROR    2010-07-13 17:35:51,206 dev_appserver.py:2633] Error
> > > > > encountered reading file "C:\Users\chris.sanders\Documents\Misc
> > > > > \workspace\WebDev\applications/cube2py/static/echo/images/ddd-
> > > > > gradient.jpg":
> > > > > [Errno 2] No such file or directory: 'C:\\Users\\chris.sanders\
> > > > > \Documents\\Misc\\workspace\\WebDev\\applications/cube2py/static/echo/
> > > > > images/ddd-gradient.jpg'
> > > > > INFO     2010-07-13 17:35:51,230 dev_appserver.py:3268] "GET /cube2py/
> > > > > static/echo/images/ddd-gradient.jpg HTTP/1.1" 404 -
> > > > > INFO     2010-07-13 17:36:01,484 gaehandler.py:57]  Request:
> > > > > 57.00ms/57.08

[web2py] Re: cube2py news

2010-07-13 Thread Chris S
Ah great, you're correct GAE does not start at id==1 (or it doesn't
guarantee it).

Any chance we could make the 'editor' group a variable so that when
importing it into existing applications we can set the name to be that
of an already created 'admin' group?
Another thing I've been doing recently is to make the {{extend
'layout.html'}} in all of the views a varriable.  This lets me easily
swap to a different layout with out having to rename files, or even
swap on the fly.  I can manually do this but it might be something
worth putting into the files.  It could just be set with the other
'required' globals to default to 'layout.html'.

This looks really great I love the storing of pages in a DB and the
auto-history tracking.  How do I go about inserting page breaks 
or white space in markmin?  So far that's the only thing making me
want to stick to WYSIWYG editing in HTML, though I like the look of
markmin.



On Jul 13, 4:06 pm, mdipierro  wrote:
> The first user (id==1) is editor by default (but not on GAE). Create a
> group with role='editor' and make yourself member using appadmin.
>
> On 13 Lug, 13:11, Chris S  wrote:
>
> > Ah it's an authorization thing.
>
> > I can get myself to the the index page now, but I'm still not sure how
> > I make myself a 'plugin_wiki_editor' I tried creating a group of that
> > name and using appadmin to add my login to that group but that didn't
> > work.  Maybe I'm missing something easy, or maybe the first registered
> > user needs to become an 'editor'?  I'm not sure how anyone gets to be
> > an editor if you have to first be one to assign the rights...
>
> > On Jul 13, 12:42 pm, Chris S  wrote:
>
> > > I also meant to ask, does plugin_wiki just come with cube2py?  Can it
> > > also be downloaded somewhere separately?
> > > I thought it could, but I can't find it anwywhere.  Can someone point
> > > me to where plugin_wiki is?
>
> > > On Jul 13, 12:39 pm, Chris S  wrote:
>
> > > > I just loaded the latest trunk, and the latest cube2py 
> > > > at:https://cube2py.googlecode.com/hg/cube2py
>
> > > > I cleared the datastore and memcache then pointed my browser to
> > > > 127.0.0.1:8080/cube2py
>
> > > > I get the login screen, but when I try to register I get a 404.  The
> > > > entire log from the initial page view to the redirect to home is shown
> > > > below.
> > > > Am I using the correct location for the cube2py repository?
>
> > > > --Complete Log--
> > > > INFO     2010-07-13 17:35:46,755 gaehandler.py:57]  Request:
> > > > 25.00ms/25.65ms (real time/cpu time)
> > > > INFO     2010-07-13 17:35:46,780 dev_appserver.py:3268] "GET /cube2py
> > > > HTTP/1.1" 303 -
> > > > INFO     2010-07-13 17:35:46,835 gaehandler.py:57]  Request:
> > > > 23.00ms/23.60ms (real time/cpu time)
> > > > INFO     2010-07-13 17:35:46,862 dev_appserver.py:3268] "GET /cube2py/
> > > > plugin_wiki/page/home HTTP/1.1" 303 -
> > > > INFO     2010-07-13 17:35:46,921 gaehandler.py:57]  Request:
> > > > 27.00ms/26.93ms (real time/cpu time)
> > > > INFO     2010-07-13 17:35:46,947 dev_appserver.py:3268] "GET /cube2py/
> > > > default/user/login HTTP/1.1" 200 -
> > > > ERROR    2010-07-13 17:35:47,092 dev_appserver.py:2633] Error
> > > > encountered reading file "C:\Users\chris.sanders\Documents\Misc
> > > > \workspace\WebDev\applications/cube2py/static/echo/images/ddd-
> > > > gradient.jpg":
> > > > [Errno 2] No such file or directory: 'C:\\Users\\chris.sanders\
> > > > \Documents\\Misc\\workspace\\WebDev\\applications/cube2py/static/echo/
> > > > images/ddd-gradient.jpg'
> > > > INFO     2010-07-13 17:35:47,118 dev_appserver.py:3268] "GET /cube2py/
> > > > static/echo/images/ddd-gradient.jpg HTTP/1.1" 404 -
> > > > INFO     2010-07-13 17:35:51,035 gaehandler.py:57]  Request:
> > > > 29.00ms/28.97ms (real time/cpu time)
> > > > INFO     2010-07-13 17:35:51,062 dev_appserver.py:3268] "GET /cube2py/
> > > > default/user/register HTTP/1.1" 200 -
> > > > ERROR    2010-07-13 17:35:51,206 dev_appserver.py:2633] Error
> > > > encountered reading file "C:\Users\chris.sanders\Documents\Misc
> > > > \workspace\WebDev\applications/cube2py/static/echo/images/ddd-
> > > > gradient.jpg":
> > > > [Errno 2] No such file or directory: 'C:\\Users\\chris.sanders\
> > > > \Documents\\Misc\\workspace\\WebDev\\applications/cube2py/static/echo/
> > > > images/ddd-gradient.jpg'
> > > > INFO     2010-07-13 17:35:51,230 dev_appserver.py:3268] "GET /cube2py/
> > > > static/echo/images/ddd-gradient.jpg HTTP/1.1" 404 -
> > > > INFO     2010-07-13 17:36:01,484 gaehandler.py:57]  Request:
> > > > 57.00ms/57.08ms (real time/cpu time)
> > > > INFO     2010-07-13 17:36:01,512 dev_appserver.py:3268] "POST /cube2py/
> > > > default/user/register HTTP/1.1" 303 -
> > > > INFO     2010-07-13 17:36:01,569 gaehandler.py:57]  Request:
> > > > 28.00ms/27.92ms (real time/cpu time)
> > > > INFO     2010-07-13 17:36:01,598 dev_appserver.py:3268] "GET /cube2py/
> > > > default/index HTTP/1.1" 303 -
> > > > IN

[web2py] Re: web2py Reference Manual -- a call to arms

2010-07-13 Thread mdipierro
That is the problem.

for people who seriously want to help. Setting up another wiki is not
help. Instead, adopt a web2py file, add docstrings to all functions.

On 13 Lug, 16:38, ra3don  wrote:
> Yeah i noticed its a little hard to comprehend sometime if you have no
> idea whats going on. Some entries don't have descriptions at all, just
> leaves you scratching your head.
>
> On Jul 12, 10:25 pm, weheh  wrote:
>
> > @MDP: No reason for GAE in particular other than it's free initially
> > and because it's a showcase. Any server is good, as long as the url is
> > something like web2py.com/reference. There is no performance issue
> > with the current doc.
>
> > @ra3don: Epydocs have very little verbiage and is indecipherable to
> > the average user, IMHO.


[web2py] Re: T2, T3, Cube2py ...

2010-07-13 Thread mdipierro
This video is already obsolete:

 http://www.vimeo.com/13154869

The goal is to build an additional layer on top of web2py that would
allow:
- easier programming without coding
- integrate some content management functionality
- could potentially become a new welcome (scaffolding) app

T2,T3,Cube2py are all experiments. Cube2py is the latest. I still do
not promise backward compatibility because it is an app.

On 13 Lug, 14:49, Jeff S  wrote:
> Hi,
>
> I'm not sure I understand all of this T2 T3 and Cube2py stuff.  I have
> recently installed web2py(1.76.3) on my computer and I read somewhere
> that T2, T3 are deprecated and Cube2py would be the new stuff.  But
> what is T2 and T3 anyway?  Is it like project code names that were
> included in web2py as upgrades like CRUD got included some time ago?
>
> What is the direction of web2py with cube2py?  As far as I understand
> it, T3 is part of web2py, no?  Cube2py only looks like another
> application like anyone that can be installed on web2py, or is it more
> than that?  Actually Cube2py does not seem to work with my 1.76.3.  I
> guess I'll have to upgrade to the latest revision in order to use
> Cube2py.
>
> Thanks,


[web2py] Re: ajax widget - asynchronously updated

2010-07-13 Thread mdipierro
The simplest solution is that you get generic.load from  1.80.1 and
you

replace

function refreshWidget() {
   ajax('refresh_widget', [], 'mywidget');
}

with

function refreshWidget() {
   ajax('refresh_widget.load', [], 'mywidget');
}


On 13 Lug, 16:46, Tomas Pelka  wrote:
> Thank you very much Adi, but rpoblem is that refreshWidget is called
> only once. And after that page looks like in attached screenshot.
>
> My ajax function is here:
> function ajax(u,s,t) {
>    var query="";
>    for(i=0; i       if(i>0) query=query+"&";
>
> query=query+encodeURIComponent(s[i])+"="+encodeURIComponent(document.getElementById(s[i]).value);
>    }
>    jQuery.ajax({type: "POST", url: u, data: query, success:
> function(msg) { if(t==':eval') eval(msg); else
> document.getElementById(t).innerHTML=msg; } });
>
> }
>
> Cheers Tom.
>
> On 07/09/2010 07:01 AM, Adi wrote:
>
>
>
> > Some frameworks have active data widgets - the widget updates whenever
> > data changes. I'm not sure how exactly it can be implemented in
> > web2py, but something like this should work:
>
> > View (.html file):
> > 
> > {{=mywidget}}
> > 
> > setTimeout(refreshWidget, 1); // calls refreshwidget every 10
> > seconds
> > function refreshWidget() {
> >     ajax('refresh_widget', [], 'mywidget');
> > }
> > 
>
> > Controller (.py file)
> > ---
> > def refresh_widget():
> >     # logic to generate widget
> >     return dict(mywidget=mywidget)
>
> > Explanation:
> > Every 10 seconds there's an ajax call to controller's refresh_widget,
> > which generates the HTML for the updated view that you want to show
> > inside the mywidget tags (like list of elements). This HTML is placed
> > inside the mywidget tag.
>
> > This is the simplest way to solve this problem that I can think of,
> > and this is not efficient because even if your data has not changed,
> > you'll still be polling the server every 10 seconds. But this should
> > work!
>
> > On Jul 9, 1:32 am, Tomas Pelka  wrote:
> >> Hi all,
>
> >> Im trying to create widget (lets say list of elements) which should by
> >> updated asynchronously through ajax. I don't get all the ajax examples
> >> in web2py book for example. Those examples only deals with some action,
> >> like on click, on mouse move, on sbutton submit or so. I need something
> >> like check if queue (source of data) have anything to provide or simple
> >> use a timer and reload widget every e.g. 10 sec.
>
> >> Thanks for advices. Please let me know if anything was unclear/wrong
> >> described.
>
> >> --
> >> Tomas Pelka
>
> --
> Tomas Pelka
>
>  Screenshot.png
> 195KVisualizzaScarica


[web2py] Re: Upgrade web2py now(from 1.76.3 to 1.80.1)

2010-07-13 Thread mdipierro
I think this is a file permission issue. You are upgrading using the
[upgrade now] button and it is not letting overwrite a file that is in
use.
This is a bug in the [upgrade] mechanism on windows (which version do
you have?).

For now just download 1.80.1 manually and unzip the new one over the
old one (after you shut down web2py).

On 13 Lug, 15:24, Jeff S  wrote:
> Is there any known caveats to upgrade web2py from from 1.76.3 to
> 1.80.1?
>
> I get the following error:
>
> unable to upgrade because "[Errno 13] Permission denied: 'D:\\Inbox\
> \Web2py\\web2py/MSVCR71.dll'"
>
> Thanks,


[web2py] Re: web2py Reference Manual -- a call to arms

2010-07-13 Thread ra3don
Yeah i noticed its a little hard to comprehend sometime if you have no
idea whats going on. Some entries don't have descriptions at all, just
leaves you scratching your head.

On Jul 12, 10:25 pm, weheh  wrote:
> @MDP: No reason for GAE in particular other than it's free initially
> and because it's a showcase. Any server is good, as long as the url is
> something like web2py.com/reference. There is no performance issue
> with the current doc.
>
> @ra3don: Epydocs have very little verbiage and is indecipherable to
> the average user, IMHO.


[web2py] Re: i need help

2010-07-13 Thread mdipierro
say you have this

create_by=Field('created_by',db.auth_user,default=auth.user_id,writable=False,label=T('created
by')

db.define_table('atable,Field('data'),created_by)

you can retrieve rows created by the current user with

rows=db(db.atable.created_by==auth.user_id).select()

On 13 Lug, 16:27, sarsar  wrote:
>   Hi , maybe because it is to late here , or because i am rather old
> and slow learning , i am in front of a problem i cannot find the
> solution . As i dont now python , i cannot combine something that
> logicaly is very simple and easy to do , but i can find the correct
> code to do it .  I declare a candidate with many fields and one field
> is ...
> ('created_by',db.auth_user,default=auth.user_id,writable=False,label=T('created
> by') .
>    I want each user to login (after registration) and fill up the form
> ONCE .  If the user has filled up the form , then he can only see his
> own data . and if he tries to see again the form then he has to be
> redirected again to index page . I have understanded that i have to
> check and compare the current logged user with the field inside the
> db.candidate.created_by But i cant do the coding . one small example
> would help me . Thanks in advance .


[web2py] Upgrade web2py now(from 1.76.3 to 1.80.1)

2010-07-13 Thread Jeff S
Is there any known caveats to upgrade web2py from from 1.76.3 to
1.80.1?

I get the following error:

unable to upgrade because "[Errno 13] Permission denied: 'D:\\Inbox\
\Web2py\\web2py/MSVCR71.dll'"

Thanks,


[web2py] T2, T3, Cube2py ...

2010-07-13 Thread Jeff S
Hi,

I'm not sure I understand all of this T2 T3 and Cube2py stuff.  I have
recently installed web2py(1.76.3) on my computer and I read somewhere
that T2, T3 are deprecated and Cube2py would be the new stuff.  But
what is T2 and T3 anyway?  Is it like project code names that were
included in web2py as upgrades like CRUD got included some time ago?

What is the direction of web2py with cube2py?  As far as I understand
it, T3 is part of web2py, no?  Cube2py only looks like another
application like anyone that can be installed on web2py, or is it more
than that?  Actually Cube2py does not seem to work with my 1.76.3.  I
guess I'll have to upgrade to the latest revision in order to use
Cube2py.

Thanks,


[web2py] i need help

2010-07-13 Thread sarsar
  Hi , maybe because it is to late here , or because i am rather old
and slow learning , i am in front of a problem i cannot find the
solution . As i dont now python , i cannot combine something that
logicaly is very simple and easy to do , but i can find the correct
code to do it .  I declare a candidate with many fields and one field
is ...
('created_by',db.auth_user,default=auth.user_id,writable=False,label=T('created
by') .
   I want each user to login (after registration) and fill up the form
ONCE .  If the user has filled up the form , then he can only see his
own data . and if he tries to see again the form then he has to be
redirected again to index page . I have understanded that i have to
check and compare the current logged user with the field inside the
db.candidate.created_by But i cant do the coding . one small example
would help me . Thanks in advance .



[web2py] Re: storing hierarchical data in web2py database

2010-07-13 Thread sociotech
You might want to check out Massimo's code for Modified Preorder Tree
Traversal, which is an extremely efficient way of storing tree
structures in a database:

http://groups.google.com/group/web2py/browse_thread/thread/70efddab62dfe73

On Jul 13, 11:59 am, "topher.baron"  wrote:
> I'm looking forward to it.
>
> On Jul 13, 1:12 pm, Vasile Ermicioi  wrote:
>
> > I am developing a solution for my needs, something similar to nested sets,
> > if you could wait a few days I think I will be able to share it


Re: [web2py] Re: loop generated forms

2010-07-13 Thread Jonathan Lundell
On Jul 13, 2010, at 1:56 PM, Rick wrote:

> This gives no error:
> dict()[x] = [x]
> ..but my web page is still not shown in the browser, it's just printed
> "None". Maybe the controller-file-code is correct but something should
> be added to the view file?

It's not at all clear what you're trying to do. The line above creates a dict 
with a single entry whose key is x, and whose value is a list with x as a 
member. That doesn't seem very useful.

If you want a variable number of forms to be displayed, try creating a list of 
forms, and passing the list to your view in a dict as usual. The code that 
JmiXIII gave is a good example:

def listform():
 listf=[]
 thing = [one two three]
 for x in thing:
form=FORM(':', INPUT(_name="name"))
listf.append(form)
return dict(listf=listf)

In your view, you'll have to loop through the list and output each form.

One problem with the code above is that you'll need to give each form a unique 
name. See "Multiple forms per page" in the manual, Chapter 7.


> 
> On Jul 13, 12:19 am, Jonathan Lundell  wrote:
>> On Jul 12, 2010, at 3:04 PM, Rick wrote:
>> 
>>> Thanks for your inspiring answer,
>> 
>>> After I found this page:
>>> http://code.activestate.com/recipes/440502-a-dictionary-with-multiple...
>>> ...I tried with:
>>> return dict['form'].append([x])
>>> ...but my new code doesn't work neither. I just get "TypeError: 'type'
>>> object is unsubscriptable".
>> 
>> Don't use the word 'dict'.
>> 
>> 
>> 
>>> Though I think this code is nearer the
>>> solution.
>> 
>>> On Jul 12, 10:44 pm, JmiXIII  wrote:
 Hello ,
>> 
 I've used something like this :
 def listform():
   listf=[]
   thing = [one two three]
   for x in thing:
  form=FORM(':', INPUT(_name="name"))
  listf.append(form)
 return dict(listf=listf)
>> 
 Yet I usually use SQLFORM and add a submit button
>> 
 As this is my firts answer to a coding question, do not hesitate to
 tell if I'm wrong
>> 
 On 12 juil, 22:26, Rick  wrote:
>> 
> Hi,
>> 
> How to generate multiple forms with a loop?
>> 
> In my controller file there are forms generated with this loop:
>> 
> thing=[one, two, three]
> def theFunction():
> for thing1  in varibale1:
> form=FORM(':',
> INPUT(_name='name')
> )
> return dict(form=form)
>> 
> ...but this code doesn't work. I just get the message "invalid view".
> I suppose the reason that I get this message is that all the forms
> have the same name in the view file. Therefor I also tried with:
> return dict(form=[thing])
> ...but got:
> SyntaxError: keyword can't be an expression
>> 
> I've tried with this code in the view file:
>> 
> {{extend 'layout.html'}}
> {{=form}}
>> 
> ...and also with this:
>> 
> {{extend 'layout.html'}}
> 
> {{thing=[one, two, three]}}
> {{for thing1  in varibale1:}}
> {{=form}}
> 
>> 
> ...but none of them worked.
>> 
> Thanks in advance for help




[web2py] Re: oauth

2010-07-13 Thread mdipierro
I'll wait for a patch then. ;-)

On 13 Lug, 15:54, Michele Comitini  wrote:
> Hi Massimo,
>
> From my experience with facebook auth,  I am quite confident that a login
> method can made a generic OAuth 2.0 without introducing dependencies on
> httplib and oauth as the pointed in the article.  Web2py has already
> everything needed.
>
> ciao,
> mic
>
> 2010/7/13 mdipierro 
>
> > I need a modified version of
>
> >   gluon/contrib/login_methods/linkedin_account.py
>
> > that works with oauth as explained here
> >http://dougwarren.org/2010/06/oauth-and-web2py-part-1/,
> > is integrated with web2py auth as linkedin_account.py, but also works
> > out of the box with facebook and twitter.
>
> > If you have anything relevant please let me know.
>
> > Massimo


[web2py] Re: openwysiwyg?

2010-07-13 Thread Pepe
never used it.

On Jul 13, 4:55 pm, Chris S  wrote:
> Ditto, never used it
>
> On Jul 13, 3:50 pm, Bruno Rocha  wrote:
>
>
>
> > Never used it
>
> > 2010/7/13 MikeEllis :
>
> > > FWIW, openwysiwyg doesn't work in Chrome.
> > > Mike
>
> > > On Jul 13, 1:19 pm, Jean-Guy  wrote:
> > >> Never used it!
>
> > >> Jonhy
>
> > >> On 2010-07-13 13:02, mdipierro wrote:
>
> > >> > on a view [htmledit]. Do you use it?
>
> > --
>
> >http://rochacbruno.com.br


[web2py] Re: cube2py news

2010-07-13 Thread mdipierro
The first user (id==1) is editor by default (but not on GAE). Create a
group with role='editor' and make yourself member using appadmin.

On 13 Lug, 13:11, Chris S  wrote:
> Ah it's an authorization thing.
>
> I can get myself to the the index page now, but I'm still not sure how
> I make myself a 'plugin_wiki_editor' I tried creating a group of that
> name and using appadmin to add my login to that group but that didn't
> work.  Maybe I'm missing something easy, or maybe the first registered
> user needs to become an 'editor'?  I'm not sure how anyone gets to be
> an editor if you have to first be one to assign the rights...
>
> On Jul 13, 12:42 pm, Chris S  wrote:
>
> > I also meant to ask, does plugin_wiki just come with cube2py?  Can it
> > also be downloaded somewhere separately?
> > I thought it could, but I can't find it anwywhere.  Can someone point
> > me to where plugin_wiki is?
>
> > On Jul 13, 12:39 pm, Chris S  wrote:
>
> > > I just loaded the latest trunk, and the latest cube2py 
> > > at:https://cube2py.googlecode.com/hg/cube2py
>
> > > I cleared the datastore and memcache then pointed my browser to
> > > 127.0.0.1:8080/cube2py
>
> > > I get the login screen, but when I try to register I get a 404.  The
> > > entire log from the initial page view to the redirect to home is shown
> > > below.
> > > Am I using the correct location for the cube2py repository?
>
> > > --Complete Log--
> > > INFO     2010-07-13 17:35:46,755 gaehandler.py:57]  Request:
> > > 25.00ms/25.65ms (real time/cpu time)
> > > INFO     2010-07-13 17:35:46,780 dev_appserver.py:3268] "GET /cube2py
> > > HTTP/1.1" 303 -
> > > INFO     2010-07-13 17:35:46,835 gaehandler.py:57]  Request:
> > > 23.00ms/23.60ms (real time/cpu time)
> > > INFO     2010-07-13 17:35:46,862 dev_appserver.py:3268] "GET /cube2py/
> > > plugin_wiki/page/home HTTP/1.1" 303 -
> > > INFO     2010-07-13 17:35:46,921 gaehandler.py:57]  Request:
> > > 27.00ms/26.93ms (real time/cpu time)
> > > INFO     2010-07-13 17:35:46,947 dev_appserver.py:3268] "GET /cube2py/
> > > default/user/login HTTP/1.1" 200 -
> > > ERROR    2010-07-13 17:35:47,092 dev_appserver.py:2633] Error
> > > encountered reading file "C:\Users\chris.sanders\Documents\Misc
> > > \workspace\WebDev\applications/cube2py/static/echo/images/ddd-
> > > gradient.jpg":
> > > [Errno 2] No such file or directory: 'C:\\Users\\chris.sanders\
> > > \Documents\\Misc\\workspace\\WebDev\\applications/cube2py/static/echo/
> > > images/ddd-gradient.jpg'
> > > INFO     2010-07-13 17:35:47,118 dev_appserver.py:3268] "GET /cube2py/
> > > static/echo/images/ddd-gradient.jpg HTTP/1.1" 404 -
> > > INFO     2010-07-13 17:35:51,035 gaehandler.py:57]  Request:
> > > 29.00ms/28.97ms (real time/cpu time)
> > > INFO     2010-07-13 17:35:51,062 dev_appserver.py:3268] "GET /cube2py/
> > > default/user/register HTTP/1.1" 200 -
> > > ERROR    2010-07-13 17:35:51,206 dev_appserver.py:2633] Error
> > > encountered reading file "C:\Users\chris.sanders\Documents\Misc
> > > \workspace\WebDev\applications/cube2py/static/echo/images/ddd-
> > > gradient.jpg":
> > > [Errno 2] No such file or directory: 'C:\\Users\\chris.sanders\
> > > \Documents\\Misc\\workspace\\WebDev\\applications/cube2py/static/echo/
> > > images/ddd-gradient.jpg'
> > > INFO     2010-07-13 17:35:51,230 dev_appserver.py:3268] "GET /cube2py/
> > > static/echo/images/ddd-gradient.jpg HTTP/1.1" 404 -
> > > INFO     2010-07-13 17:36:01,484 gaehandler.py:57]  Request:
> > > 57.00ms/57.08ms (real time/cpu time)
> > > INFO     2010-07-13 17:36:01,512 dev_appserver.py:3268] "POST /cube2py/
> > > default/user/register HTTP/1.1" 303 -
> > > INFO     2010-07-13 17:36:01,569 gaehandler.py:57]  Request:
> > > 28.00ms/27.92ms (real time/cpu time)
> > > INFO     2010-07-13 17:36:01,598 dev_appserver.py:3268] "GET /cube2py/
> > > default/index HTTP/1.1" 303 -
> > > INFO     2010-07-13 17:36:01,607 dev_appserver_index.py:205] Updating
> > > C:\Users\chris.sanders\Documents\Misc\workspace\WebDev\index.yaml
> > > INFO     2010-07-13 17:36:01,665 gaehandler.py:57]  Request:
> > > 27.00ms/26.94ms (real time/cpu time)
> > > INFO     2010-07-13 17:36:01,694 dev_appserver.py:3268] "GET /cube2py/
> > > plugin_wiki/page/home HTTP/1.1" 404 -
> > > ---


Re: [web2py] Re: Commenting system - Disqus/IntenseDebate

2010-07-13 Thread Thadeus Burgess
Pros:

* Disqus is really easy to use and setup and include on your site.
* Automatically emails you with comments, that you can respond to from
your email client
* You don't have to do anything but include the javascript on your
page and include a page ID.

Cons:

* Reliant on disqus, their export feature is weak and a manual
process. If they go down or decide to start charging for the service,
your SOL.
* If for some reason disqus servers go offline, like what happens with
the fail whale, then so does your sites commenting system.
* Because your comments are javascript, they are NOT included in
search results. Comments can be a decent source of SEO to the page.

--
Thadeus





On Tue, Jul 13, 2010 at 3:25 AM, mdipierro  wrote:
> I do not know about them but I have these
>
> http://web2py.com/plugins/default/comments
> http://web2py.com/plugins/default/simple_comments
>
> Other users have other systems
>
> On 13 Lug, 03:11, Narendran  wrote:
>> Hi,
>> I'm about to add commenting system to my site I've developed using
>> web2py. I'd like to hear opinions regarding integrating Disqus, or
>> IntenseDebate, if someone has already done this.
>> If there is some native web2py widget, I'd like to try that as well. I
>> could not hit any on googling for one.
>>
>> --
>> Thanks
>> Narendran
>


[web2py] Re: loop generated forms

2010-07-13 Thread Rick
This gives no error:
dict()[x] = [x]
..but my web page is still not shown in the browser, it's just printed
"None". Maybe the controller-file-code is correct but something should
be added to the view file?

On Jul 13, 12:19 am, Jonathan Lundell  wrote:
> On Jul 12, 2010, at 3:04 PM, Rick wrote:
>
> > Thanks for your inspiring answer,
>
> > After I found this page:
> >http://code.activestate.com/recipes/440502-a-dictionary-with-multiple...
> > ...I tried with:
> > return dict['form'].append([x])
> > ...but my new code doesn't work neither. I just get "TypeError: 'type'
> > object is unsubscriptable".
>
> Don't use the word 'dict'.
>
>
>
> > Though I think this code is nearer the
> > solution.
>
> > On Jul 12, 10:44 pm, JmiXIII  wrote:
> >> Hello ,
>
> >> I've used something like this :
> >> def listform():
> >>   listf=[]
> >>   thing = [one two three]
> >>   for x in thing:
> >>      form=FORM(':', INPUT(_name="name"))
> >>      listf.append(form)
> >> return dict(listf=listf)
>
> >> Yet I usually use SQLFORM and add a submit button
>
> >> As this is my firts answer to a coding question, do not hesitate to
> >> tell if I'm wrong
>
> >> On 12 juil, 22:26, Rick  wrote:
>
> >>> Hi,
>
> >>> How to generate multiple forms with a loop?
>
> >>> In my controller file there are forms generated with this loop:
>
> >>> thing=[one, two, three]
> >>> def theFunction():
> >>>         for thing1  in varibale1:
> >>>                 form=FORM(':',
> >>>                                 INPUT(_name='name')
> >>>                         )
> >>>                 return dict(form=form)
>
> >>> ...but this code doesn't work. I just get the message "invalid view".
> >>> I suppose the reason that I get this message is that all the forms
> >>> have the same name in the view file. Therefor I also tried with:
> >>>         return dict(form=[thing])
> >>> ...but got:
> >>> SyntaxError: keyword can't be an expression
>
> >>> I've tried with this code in the view file:
>
> >>>         {{extend 'layout.html'}}
> >>>         {{=form}}
>
> >>> ...and also with this:
>
> >>>         {{extend 'layout.html'}}
> >>>         
> >>>         {{thing=[one, two, three]}}
> >>>         {{for thing1  in varibale1:}}
> >>>                 {{=form}}
> >>>         
>
> >>> ...but none of them worked.
>
> >>> Thanks in advance for help


[web2py] Re: openwysiwyg?

2010-07-13 Thread Chris S
Ditto, never used it

On Jul 13, 3:50 pm, Bruno Rocha  wrote:
> Never used it
>
> 2010/7/13 MikeEllis :
>
> > FWIW, openwysiwyg doesn't work in Chrome.
> > Mike
>
> > On Jul 13, 1:19 pm, Jean-Guy  wrote:
> >> Never used it!
>
> >> Jonhy
>
> >> On 2010-07-13 13:02, mdipierro wrote:
>
> >> > on a view [htmledit]. Do you use it?
>
> --
>
> http://rochacbruno.com.br


Re: [web2py] oauth

2010-07-13 Thread Michele Comitini
Hi Massimo,

>From my experience with facebook auth,  I am quite confident that a login
method can made a generic OAuth 2.0 without introducing dependencies on
httplib and oauth as the pointed in the article.  Web2py has already
everything needed.

ciao,
mic

2010/7/13 mdipierro 

> I need a modified version of
>
>   gluon/contrib/login_methods/linkedin_account.py
>
> that works with oauth as explained here
> http://dougwarren.org/2010/06/oauth-and-web2py-part-1/,
> is integrated with web2py auth as linkedin_account.py, but also works
> out of the box with facebook and twitter.
>
> If you have anything relevant please let me know.
>
> Massimo


Re: [web2py] Re: openwysiwyg?

2010-07-13 Thread Bruno Rocha
Never used it

2010/7/13 MikeEllis :
> FWIW, openwysiwyg doesn't work in Chrome.
> Mike
>
> On Jul 13, 1:19 pm, Jean-Guy  wrote:
>> Never used it!
>>
>> Jonhy
>>
>> On 2010-07-13 13:02, mdipierro wrote:
>>
>>
>>
>> > on a view [htmledit]. Do you use it?



-- 

http://rochacbruno.com.br


[web2py] Re: openwysiwyg?

2010-07-13 Thread MikeEllis
FWIW, openwysiwyg doesn't work in Chrome.
Mike

On Jul 13, 1:19 pm, Jean-Guy  wrote:
> Never used it!
>
> Jonhy
>
> On 2010-07-13 13:02, mdipierro wrote:
>
>
>
> > on a view [htmledit]. Do you use it?


[web2py] Re: storing hierarchical data in web2py database

2010-07-13 Thread topher.baron
I'm looking forward to it.

On Jul 13, 1:12 pm, Vasile Ermicioi  wrote:
> I am developing a solution for my needs, something similar to nested sets,
> if you could wait a few days I think I will be able to share it


Re: [web2py] storing hierarchical data in web2py database

2010-07-13 Thread Vasile Ermicioi
I am developing a solution for my needs, something similar to nested sets,
if you could wait a few days I think I will be able to share it


[web2py] Re: cube2py news

2010-07-13 Thread Chris S
Ah it's an authorization thing.

I can get myself to the the index page now, but I'm still not sure how
I make myself a 'plugin_wiki_editor' I tried creating a group of that
name and using appadmin to add my login to that group but that didn't
work.  Maybe I'm missing something easy, or maybe the first registered
user needs to become an 'editor'?  I'm not sure how anyone gets to be
an editor if you have to first be one to assign the rights...


On Jul 13, 12:42 pm, Chris S  wrote:
> I also meant to ask, does plugin_wiki just come with cube2py?  Can it
> also be downloaded somewhere separately?
> I thought it could, but I can't find it anwywhere.  Can someone point
> me to where plugin_wiki is?
>
> On Jul 13, 12:39 pm, Chris S  wrote:
>
> > I just loaded the latest trunk, and the latest cube2py 
> > at:https://cube2py.googlecode.com/hg/cube2py
>
> > I cleared the datastore and memcache then pointed my browser to
> > 127.0.0.1:8080/cube2py
>
> > I get the login screen, but when I try to register I get a 404.  The
> > entire log from the initial page view to the redirect to home is shown
> > below.
> > Am I using the correct location for the cube2py repository?
>
> > --Complete Log--
> > INFO     2010-07-13 17:35:46,755 gaehandler.py:57]  Request:
> > 25.00ms/25.65ms (real time/cpu time)
> > INFO     2010-07-13 17:35:46,780 dev_appserver.py:3268] "GET /cube2py
> > HTTP/1.1" 303 -
> > INFO     2010-07-13 17:35:46,835 gaehandler.py:57]  Request:
> > 23.00ms/23.60ms (real time/cpu time)
> > INFO     2010-07-13 17:35:46,862 dev_appserver.py:3268] "GET /cube2py/
> > plugin_wiki/page/home HTTP/1.1" 303 -
> > INFO     2010-07-13 17:35:46,921 gaehandler.py:57]  Request:
> > 27.00ms/26.93ms (real time/cpu time)
> > INFO     2010-07-13 17:35:46,947 dev_appserver.py:3268] "GET /cube2py/
> > default/user/login HTTP/1.1" 200 -
> > ERROR    2010-07-13 17:35:47,092 dev_appserver.py:2633] Error
> > encountered reading file "C:\Users\chris.sanders\Documents\Misc
> > \workspace\WebDev\applications/cube2py/static/echo/images/ddd-
> > gradient.jpg":
> > [Errno 2] No such file or directory: 'C:\\Users\\chris.sanders\
> > \Documents\\Misc\\workspace\\WebDev\\applications/cube2py/static/echo/
> > images/ddd-gradient.jpg'
> > INFO     2010-07-13 17:35:47,118 dev_appserver.py:3268] "GET /cube2py/
> > static/echo/images/ddd-gradient.jpg HTTP/1.1" 404 -
> > INFO     2010-07-13 17:35:51,035 gaehandler.py:57]  Request:
> > 29.00ms/28.97ms (real time/cpu time)
> > INFO     2010-07-13 17:35:51,062 dev_appserver.py:3268] "GET /cube2py/
> > default/user/register HTTP/1.1" 200 -
> > ERROR    2010-07-13 17:35:51,206 dev_appserver.py:2633] Error
> > encountered reading file "C:\Users\chris.sanders\Documents\Misc
> > \workspace\WebDev\applications/cube2py/static/echo/images/ddd-
> > gradient.jpg":
> > [Errno 2] No such file or directory: 'C:\\Users\\chris.sanders\
> > \Documents\\Misc\\workspace\\WebDev\\applications/cube2py/static/echo/
> > images/ddd-gradient.jpg'
> > INFO     2010-07-13 17:35:51,230 dev_appserver.py:3268] "GET /cube2py/
> > static/echo/images/ddd-gradient.jpg HTTP/1.1" 404 -
> > INFO     2010-07-13 17:36:01,484 gaehandler.py:57]  Request:
> > 57.00ms/57.08ms (real time/cpu time)
> > INFO     2010-07-13 17:36:01,512 dev_appserver.py:3268] "POST /cube2py/
> > default/user/register HTTP/1.1" 303 -
> > INFO     2010-07-13 17:36:01,569 gaehandler.py:57]  Request:
> > 28.00ms/27.92ms (real time/cpu time)
> > INFO     2010-07-13 17:36:01,598 dev_appserver.py:3268] "GET /cube2py/
> > default/index HTTP/1.1" 303 -
> > INFO     2010-07-13 17:36:01,607 dev_appserver_index.py:205] Updating
> > C:\Users\chris.sanders\Documents\Misc\workspace\WebDev\index.yaml
> > INFO     2010-07-13 17:36:01,665 gaehandler.py:57]  Request:
> > 27.00ms/26.94ms (real time/cpu time)
> > INFO     2010-07-13 17:36:01,694 dev_appserver.py:3268] "GET /cube2py/
> > plugin_wiki/page/home HTTP/1.1" 404 -
> > ---
>
>


[web2py] storing hierarchical data in web2py database

2010-07-13 Thread topher.baron
I need to store tree information in a database.  For each node in the
tree, there are multiple rows that need to be inserted into a couple
of database tables.

I'm under the impression that calling a recursive function that
iterates through the tree to insert the appropriate rows for each node
will be slow for trees with thousands of rows because there will be
thousands of separate insert statements - is this correct ?  If so,
what are other solutions ?


Thanks in advance.


[web2py] Re: cube2py news

2010-07-13 Thread Chris S
I also meant to ask, does plugin_wiki just come with cube2py?  Can it
also be downloaded somewhere separately?
I thought it could, but I can't find it anwywhere.  Can someone point
me to where plugin_wiki is?

On Jul 13, 12:39 pm, Chris S  wrote:
> I just loaded the latest trunk, and the latest cube2py 
> at:https://cube2py.googlecode.com/hg/cube2py
>
> I cleared the datastore and memcache then pointed my browser to
> 127.0.0.1:8080/cube2py
>
> I get the login screen, but when I try to register I get a 404.  The
> entire log from the initial page view to the redirect to home is shown
> below.
> Am I using the correct location for the cube2py repository?
>
> --Complete Log--
> INFO     2010-07-13 17:35:46,755 gaehandler.py:57]  Request:
> 25.00ms/25.65ms (real time/cpu time)
> INFO     2010-07-13 17:35:46,780 dev_appserver.py:3268] "GET /cube2py
> HTTP/1.1" 303 -
> INFO     2010-07-13 17:35:46,835 gaehandler.py:57]  Request:
> 23.00ms/23.60ms (real time/cpu time)
> INFO     2010-07-13 17:35:46,862 dev_appserver.py:3268] "GET /cube2py/
> plugin_wiki/page/home HTTP/1.1" 303 -
> INFO     2010-07-13 17:35:46,921 gaehandler.py:57]  Request:
> 27.00ms/26.93ms (real time/cpu time)
> INFO     2010-07-13 17:35:46,947 dev_appserver.py:3268] "GET /cube2py/
> default/user/login HTTP/1.1" 200 -
> ERROR    2010-07-13 17:35:47,092 dev_appserver.py:2633] Error
> encountered reading file "C:\Users\chris.sanders\Documents\Misc
> \workspace\WebDev\applications/cube2py/static/echo/images/ddd-
> gradient.jpg":
> [Errno 2] No such file or directory: 'C:\\Users\\chris.sanders\
> \Documents\\Misc\\workspace\\WebDev\\applications/cube2py/static/echo/
> images/ddd-gradient.jpg'
> INFO     2010-07-13 17:35:47,118 dev_appserver.py:3268] "GET /cube2py/
> static/echo/images/ddd-gradient.jpg HTTP/1.1" 404 -
> INFO     2010-07-13 17:35:51,035 gaehandler.py:57]  Request:
> 29.00ms/28.97ms (real time/cpu time)
> INFO     2010-07-13 17:35:51,062 dev_appserver.py:3268] "GET /cube2py/
> default/user/register HTTP/1.1" 200 -
> ERROR    2010-07-13 17:35:51,206 dev_appserver.py:2633] Error
> encountered reading file "C:\Users\chris.sanders\Documents\Misc
> \workspace\WebDev\applications/cube2py/static/echo/images/ddd-
> gradient.jpg":
> [Errno 2] No such file or directory: 'C:\\Users\\chris.sanders\
> \Documents\\Misc\\workspace\\WebDev\\applications/cube2py/static/echo/
> images/ddd-gradient.jpg'
> INFO     2010-07-13 17:35:51,230 dev_appserver.py:3268] "GET /cube2py/
> static/echo/images/ddd-gradient.jpg HTTP/1.1" 404 -
> INFO     2010-07-13 17:36:01,484 gaehandler.py:57]  Request:
> 57.00ms/57.08ms (real time/cpu time)
> INFO     2010-07-13 17:36:01,512 dev_appserver.py:3268] "POST /cube2py/
> default/user/register HTTP/1.1" 303 -
> INFO     2010-07-13 17:36:01,569 gaehandler.py:57]  Request:
> 28.00ms/27.92ms (real time/cpu time)
> INFO     2010-07-13 17:36:01,598 dev_appserver.py:3268] "GET /cube2py/
> default/index HTTP/1.1" 303 -
> INFO     2010-07-13 17:36:01,607 dev_appserver_index.py:205] Updating
> C:\Users\chris.sanders\Documents\Misc\workspace\WebDev\index.yaml
> INFO     2010-07-13 17:36:01,665 gaehandler.py:57]  Request:
> 27.00ms/26.94ms (real time/cpu time)
> INFO     2010-07-13 17:36:01,694 dev_appserver.py:3268] "GET /cube2py/
> plugin_wiki/page/home HTTP/1.1" 404 -
> ---


[web2py] Re: cube2py news

2010-07-13 Thread Chris S
I just loaded the latest trunk, and the latest cube2py at:
https://cube2py.googlecode.com/hg/cube2py

I cleared the datastore and memcache then pointed my browser to
127.0.0.1:8080/cube2py

I get the login screen, but when I try to register I get a 404.  The
entire log from the initial page view to the redirect to home is shown
below.
Am I using the correct location for the cube2py repository?

--Complete Log--
INFO 2010-07-13 17:35:46,755 gaehandler.py:57]  Request:
25.00ms/25.65ms (real time/cpu time)
INFO 2010-07-13 17:35:46,780 dev_appserver.py:3268] "GET /cube2py
HTTP/1.1" 303 -
INFO 2010-07-13 17:35:46,835 gaehandler.py:57]  Request:
23.00ms/23.60ms (real time/cpu time)
INFO 2010-07-13 17:35:46,862 dev_appserver.py:3268] "GET /cube2py/
plugin_wiki/page/home HTTP/1.1" 303 -
INFO 2010-07-13 17:35:46,921 gaehandler.py:57]  Request:
27.00ms/26.93ms (real time/cpu time)
INFO 2010-07-13 17:35:46,947 dev_appserver.py:3268] "GET /cube2py/
default/user/login HTTP/1.1" 200 -
ERROR2010-07-13 17:35:47,092 dev_appserver.py:2633] Error
encountered reading file "C:\Users\chris.sanders\Documents\Misc
\workspace\WebDev\applications/cube2py/static/echo/images/ddd-
gradient.jpg":
[Errno 2] No such file or directory: 'C:\\Users\\chris.sanders\
\Documents\\Misc\\workspace\\WebDev\\applications/cube2py/static/echo/
images/ddd-gradient.jpg'
INFO 2010-07-13 17:35:47,118 dev_appserver.py:3268] "GET /cube2py/
static/echo/images/ddd-gradient.jpg HTTP/1.1" 404 -
INFO 2010-07-13 17:35:51,035 gaehandler.py:57]  Request:
29.00ms/28.97ms (real time/cpu time)
INFO 2010-07-13 17:35:51,062 dev_appserver.py:3268] "GET /cube2py/
default/user/register HTTP/1.1" 200 -
ERROR2010-07-13 17:35:51,206 dev_appserver.py:2633] Error
encountered reading file "C:\Users\chris.sanders\Documents\Misc
\workspace\WebDev\applications/cube2py/static/echo/images/ddd-
gradient.jpg":
[Errno 2] No such file or directory: 'C:\\Users\\chris.sanders\
\Documents\\Misc\\workspace\\WebDev\\applications/cube2py/static/echo/
images/ddd-gradient.jpg'
INFO 2010-07-13 17:35:51,230 dev_appserver.py:3268] "GET /cube2py/
static/echo/images/ddd-gradient.jpg HTTP/1.1" 404 -
INFO 2010-07-13 17:36:01,484 gaehandler.py:57]  Request:
57.00ms/57.08ms (real time/cpu time)
INFO 2010-07-13 17:36:01,512 dev_appserver.py:3268] "POST /cube2py/
default/user/register HTTP/1.1" 303 -
INFO 2010-07-13 17:36:01,569 gaehandler.py:57]  Request:
28.00ms/27.92ms (real time/cpu time)
INFO 2010-07-13 17:36:01,598 dev_appserver.py:3268] "GET /cube2py/
default/index HTTP/1.1" 303 -
INFO 2010-07-13 17:36:01,607 dev_appserver_index.py:205] Updating
C:\Users\chris.sanders\Documents\Misc\workspace\WebDev\index.yaml
INFO 2010-07-13 17:36:01,665 gaehandler.py:57]  Request:
27.00ms/26.94ms (real time/cpu time)
INFO 2010-07-13 17:36:01,694 dev_appserver.py:3268] "GET /cube2py/
plugin_wiki/page/home HTTP/1.1" 404 -
---


Re: [web2py] Re: openwysiwyg?

2010-07-13 Thread Jean-Guy

Never used it!

Jonhy





On 2010-07-13 13:02, mdipierro wrote:

on a view [htmledit]. Do you use it?

   




[web2py] Re: oauth

2010-07-13 Thread ChrisM
+1
I am still using web2py1.73 as when I try and upgrade web2py the
rpxauth.py module i am using throws an error
because storage.py and  restricted.py must have changed.
error: self.setting.rpx_key does not exist


It would be good to have a module that allowed for users to log in
from social apps accounts without developer having to have jainrain
account!
ChrisM

On Jul 13, 5:24 pm, mdipierro  wrote:
> I need a modified version of
>
>    gluon/contrib/login_methods/linkedin_account.py
>
> that works with oauth as explained 
> herehttp://dougwarren.org/2010/06/oauth-and-web2py-part-1/,
> is integrated with web2py auth as linkedin_account.py, but also works
> out of the box with facebook and twitter.
>
> If you have anything relevant please let me know.
>
> Massimo


[web2py] generic.load

2010-07-13 Thread mdipierro
BTW since 1.80.1 welcome include a generic.load
what is it?

Say you have

 def someaction():
 """ any action """
 return dict(form=crud.create(db.mytable))

which may or may not have a view. And you have another action

   def index(): return dict()

with its own view

{{extend 'layout.htm'}}
Hello

Now you can include an ajax callback from the latter to the former
with

{{extend 'layout.htm'}}
Hello
{{=LOAD(request.controller,'someaction.load')}}

NOTICE .load. The form will be ebedded in the view. The processing
will not reload the page. The flash message will be displayed
correctly.

To use in old apps you need to copy views/generic.load into your old
app.


[web2py] Re: openwysiwyg?

2010-07-13 Thread mdipierro
There is both a texteditor (editarea) and an html editor
(openwysiwyg). I am only talking about the latter. You see if you
click on a view [htmledit]. Do you use it?

On 13 Lug, 11:55, Jean-Guy  wrote:
> On 2010-07-13 12:50, mdipierro wrote:> d making admin lighter. Anybody 
> opposed?
>
> Do you mean the text editor built in web2py??
>
> I use it!
>
> Jonhy


[web2py] Re: translation data in a database

2010-07-13 Thread max
thanks  a lot.

On 12 Jul., 00:22, mdipierro  wrote:
> My advice it keep using the web2py translation but create a database
> copy and work on it.
> This may be useful
> web2py/scripts/sync_languages.py
>
> On 11 Lug, 17:16, max  wrote:
>
> > thanks for the reply.
> > I have lots of small data tables, where i  have the translations. They
> > are really a lot and I handle 5 langauges simmultaneously.
> > I have to add new words  often and in the database i can add them once
> > and then it is ok.
> > but in the texts i have to write them manually and it is harder to
> > organize them.
> > max
>
> > On 11 Jul., 14:10, Kenneth  wrote:
>
> > > The reason for not using a database is speed, I think. It is much
> > > faster to read a text file than read the texts from a database.
>
> > > What kind of a problem do you have with the text files?
>
> > > Kenneth
>
> > > On Jul 11, 9:59 am, max  wrote:
>
> > > > I am  writing a enterprise multi-linugual web application  using
> > > > web2py.
> > > > I am having a hard time converting the csv files, language files in
> > > > the text format.
> > > > Is there any way that I can save the translation data in a database.
> > > > thanks a lot.


Re: [web2py] openwysiwyg?

2010-07-13 Thread Jean-Guy

On 2010-07-13 12:50, mdipierro wrote:

d making admin lighter. Anybody opposed?
   

Do you mean the text editor built in web2py??

I use it!

Jonhy


[web2py] Re: crud.update not updating image correctly?

2010-07-13 Thread Rob
any word on getting SQLFORM to work correctly?  it doesn't work in
Version 1.80.1

form = SQLFORM(db.Item, item, upload=URL(r=request,f='download'),
deletable=True, next=URL(r=request, args=item))

On Jul 11, 12:16 am, Rob  wrote:
> FYI, the problem also appears when using SQLFORM.  Your fix works when
> using crud - slightly modified:
> form = crud.update(db.Item, item, next=URL(r=request, args=item))
>
> This fix doesn't appear to work for SQLFORM.
>
> On Jul 10, 11:46 pm, mdipierro  wrote:
>
>
>
> > form = crud.update(db.Item, item,next=URL(r=request))
>
> > but this should be considered a bug in sqlhtml.py and I will try fix
> > it.
>
> > On 10 Lug, 20:06, Rob  wrote:
>
> > > db:
> > > db.define_table('Item',
> > >                 Field('description'),
> > >                 Field('need', 'boolean'),
> > >                 Field('image', 'upload'))
>
> > > controller:
> > > def update():
> > >     item = request.args(0)
> > >     form = crud.update(db.Item, item)
> > >     return dict(form=form)
>
> > > When I upload a different image, the old image still shows until a
> > > page refresh happens.  What trickery do I need to do it to act
> > > correctly?
>
> > > Thanks again...


[web2py] openwysiwyg?

2010-07-13 Thread mdipierro
Does anybody use openwysiwyg that ships with admin? I am thinking
about removing it and making admin lighter. Anybody opposed?


[web2py] Re: new welcome app in trunk

2010-07-13 Thread mdipierro
I posted a lot of junk accidentally. Thanks to Jonathan for pointing
it out. It should now be cleaned up.

On 13 Lug, 11:20, Júlio Monteiro  wrote:
> Good news, Massimo!
>
> This new welcome app will be much more appealing for prototyping and simple
> applications.
> In my humble opinion, plugin_wiki should be on by default specially because
> it will give cube2py
> more visibility and more opportunities for others to contribute to it.
>
> Cheers,
> Julio Monteiro
>
> On Tue, Jul 13, 2010 at 12:35 PM, mdipierro  wrote:
> > I have posted a new welcome app in trunk.
>
> > - it is very simple and should be easier to cutomize
> > - the layout uses ez.css (as before) but this has been included in
> > base.css
> > - the css (base.css) is smaller than before but it is now documented
> > (it separates layout from color info)
> > - uses superfish.js for the menu and this should avoid problems with
> > IE6 and work more smoothly
> > - index.html includes some instructions and more links
> > - menu.py uses a single menu (response.menu) instead of two menus.
>
> > I am still not sure whether plugin_wiki from cube2py should ship with
> > welcome. If we do, welcome and cube2py become one single app.
>
> > Please check it for bugs and cross browser issues.
>
> > Massimo


Re: [web2py] new welcome app in trunk

2010-07-13 Thread Júlio Monteiro
Good news, Massimo!

This new welcome app will be much more appealing for prototyping and simple
applications.
In my humble opinion, plugin_wiki should be on by default specially because
it will give cube2py
more visibility and more opportunities for others to contribute to it.

Cheers,
Julio Monteiro

On Tue, Jul 13, 2010 at 12:35 PM, mdipierro  wrote:

> I have posted a new welcome app in trunk.
>
> - it is very simple and should be easier to cutomize
> - the layout uses ez.css (as before) but this has been included in
> base.css
> - the css (base.css) is smaller than before but it is now documented
> (it separates layout from color info)
> - uses superfish.js for the menu and this should avoid problems with
> IE6 and work more smoothly
> - index.html includes some instructions and more links
> - menu.py uses a single menu (response.menu) instead of two menus.
>
> I am still not sure whether plugin_wiki from cube2py should ship with
> welcome. If we do, welcome and cube2py become one single app.
>
> Please check it for bugs and cross browser issues.
>
> Massimo
>


[web2py] oauth

2010-07-13 Thread mdipierro
I need a modified version of

   gluon/contrib/login_methods/linkedin_account.py

that works with oauth as explained here 
http://dougwarren.org/2010/06/oauth-and-web2py-part-1/,
is integrated with web2py auth as linkedin_account.py, but also works
out of the box with facebook and twitter.

If you have anything relevant please let me know.

Massimo


[web2py] Re: Fastcgi vs uwsgi

2010-07-13 Thread mdipierro
Can you please contact the authors of that message and let them know?

On 13 Lug, 10:51, Jose  wrote:
> The following was taken from [1].
>
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> - - - - - - - - - - - - - - - - - - - - - -
> Web2Py
>
> web2py does not work well on multiple application environment so you
> have to use it as the only WSGI application of the uWSGI server.
>
> Use this wsgi script (look at the chdir call where you have to specify
> the app path):
>
> import os
>
> os.chdir("full_path_of_your_web2py_app")
>
> import gluon.main
>
> application = gluon.main.wsgibase
>
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> - - - - - - - - - - - - - - - - - - - - - -
>
> Why do you say that does not work well in environments with multiple
> applications?
>
> I'm rewriting an application web2py. The "old application" is in
> production (Cherokee + fastcgi) and the "new application" (beta
> version) with Cherokee + uwsgi. They work well for both applications.
>
> I tried to change the "old application" from fastcgi to uwsgi. The
> first application that run from the browser works well (whether new or
> old), but the other fails when trying to access the database,
> obviously this is the same database.
>
> [1]http://projects.unbit.it/uwsgi/wiki/Example


[web2py] Re: Fastcgi vs uwsgi

2010-07-13 Thread Jose
The following was taken from [1].

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - -
Web2Py

web2py does not work well on multiple application environment so you
have to use it as the only WSGI application of the uWSGI server.

Use this wsgi script (look at the chdir call where you have to specify
the app path):

import os

os.chdir("full_path_of_your_web2py_app")

import gluon.main

application = gluon.main.wsgibase

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - -

Why do you say that does not work well in environments with multiple
applications?


I'm rewriting an application web2py. The "old application" is in
production (Cherokee + fastcgi) and the "new application" (beta
version) with Cherokee + uwsgi. They work well for both applications.

I tried to change the "old application" from fastcgi to uwsgi. The
first application that run from the browser works well (whether new or
old), but the other fails when trying to access the database,
obviously this is the same database.



[1] http://projects.unbit.it/uwsgi/wiki/Example



Re: [web2py] Re: crud.update strange behavior

2010-07-13 Thread Jean-Guy
Ok I short my function for more clarity there is a else clause for the 
first if in the original function... And I found a solution see my foward.


Jonhy

On 2010-07-13 11:28, mdipierro wrote:

  if is false and the second it true?

   




[web2py] new welcome app in trunk

2010-07-13 Thread mdipierro
I have posted a new welcome app in trunk.

- it is very simple and should be easier to cutomize
- the layout uses ez.css (as before) but this has been included in
base.css
- the css (base.css) is smaller than before but it is now documented
(it separates layout from color info)
- uses superfish.js for the menu and this should avoid problems with
IE6 and work more smoothly
- index.html includes some instructions and more links
- menu.py uses a single menu (response.menu) instead of two menus.

I am still not sure whether plugin_wiki from cube2py should ship with
welcome. If we do, welcome and cube2py become one single app.

Please check it for bugs and cross browser issues.

Massimo


[web2py] Re: crud.update strange behavior

2010-07-13 Thread mdipierro
No. There are lots of errors in the code mostly here:

 if auth.has_membership(auth.id_group('tech')):
 form = crud.create(db.atable)
 ...
 if form.accepts(request.vars, session):

1) you cannot form.accept a crud form. crud forms already accept
internally.
2) even if you use a normal SQLFORM instead of a crud form, what if
the first if is false and the second it true?

On 13 Lug, 09:49, Jean-Guy  wrote:
> Hello,
>
> I would like to make sure if it is my function that is not correct or
> the crud.update behavior...
>
> Here are my create function and update fuction :
>
> @auth.requires_login()
> def create():
>      if auth.has_membership(auth.id_group('tech')):
>          form = crud.create(db.atable)
>          db.atable.initials.default=auth.user and auth.user.initials
>          db.atable.initials_date.default=request.now
>      if form.accepts(request.vars, session):
>          response.flash = T('form accepted')
>          redirect(URL(somewhere))
>      elif form.errors:
>          response.flash = T('form has errors')
>      else:
>          response.flash = T('please fill out the form')
>      return dict(form=form)
>
> @auth.requires_login()
> def update():
>      if auth.has_membership(auth.id_group('tech')):
>          form=crud.update(db.atable,request.args[1],deletable=False)
>         db.atable.initials.default=auth.user and auth.user.initials
>          db.atable.initials_date.default=request.now
>      if form.accepts(request.vars, session):
>          response.flash = T('form accepted')
>          redirect(URL(somewhere))
>      elif form.errors:
>          response.flash = T('form has errors')
>      else:
>          response.flash = T('please correct the form')
>      return dict(form=form)
>
> The problematic lines are in red in the function update
>
> The database field initials is not updated when the update form is submit...
>
> Is it normal?
>
> Could it be reliated to .default= ??
>
> I thought the problem were coming from the next argument that were
> included in the crud.update like this :
>
> form=crud.update(db.atable,
>                               request.args[1],
>                               next=URL(request.application,'home','index'),
>                               deletable=False)
>
> So i change it for what I wrote up there...
>
> Thanks.
>
> Jonhy


[web2py] Re: user registration approval - how to get email about new wating registration?

2010-07-13 Thread mdipierro
auth.settings.registration_onaccept=lambda form: mail.send(.)

On 13 Lug, 07:53, David Marko  wrote:
> Hello,
> in my app I would like to use registration, that will require admin
> approval.
> ( auth.settings.registration_requires_approval = True ). Is there a
> way, how to get information( e.g. by email message) that someone did
> registration and is waiting on my admin approval?
>
> Thanks your for you info,
> David


[web2py] Re: markmin, t2, t3, cube9 etc. (important update)

2010-07-13 Thread mdipierro
I found restructured text to be too complex to parse.

On 13 Lug, 07:50, Timmie  wrote:
> Hello,
> cube2py looks awesome.
>
> > It uses markmin:
>
> > -
> >    http://web2py.com/examples/static/markmin.html
> > -
>
> I wonder why the syntax was not derived from restructured text or
> alike?


[web2py] Re: Wing IDE / GAE / breakpoints not getting hit for "exec" code

2010-07-13 Thread NickFranceschina
thanks but this doesn't help me...
  1) I'm using Wing
  2) I'm trying to debug using GAE's dev_appserver.py

Wing debugs fine if I use web2py's web server... but when run on GAE,
Web2py has that extra code to cache files by key... and the path gets
screwed up.  Are you debugging against GAE's dev_appserver.py?I
would venture a guess that if you were, you'd see the same problem??





On Jul 12, 11:19 pm, Phyo Arkar  wrote:
> In Pydev every debugging is working very well if you follow this web2py
> slice by mr.freeze:www.web2pyslices.com/main/slices/take_slice/2
>
> May be setting it up in Mercurial way as shown in above slice,  inside
> WingIDE  can make Web2py debug well as whole server is run through IDE's
> debugger. But i dont know if it supports Mercurial.
>
> I dont use WingIDE (coz Pydev have better completions, current version works
> almost all Completions in web2py ).
>
> On Mon, Jul 12, 2010 at 9:48 PM, NickFranceschina <
>
>
>
> nickfrancesch...@gmail.com> wrote:
> > after going back and forth a bit with WING support guys... it appears
> > to be an issue with Web2py...
>
> > on line 388 of compileapp.py there are two lines of code that only run
> > on GAE... which essentially cache the compiled? code file using
> > filename + ':' + key... where key is the function name.  this ccode
> > object then gets executed with a path of (this is my test example):
>
> >  "C:\SVNs\T4H\Buttrcup\www\applications\init\controllers
> > \default.py:test"
>
> > Since this is an invalid path, if there are any breakpoints set in the
> > controller, Wing cannot hit them because it doesn't know where this
> > file is.  If I comment out the GAE caching function, then Wing hits
> > its breakpoints correctly.
>
> > if this is not a bug, and there is some other configuration settings I
> > should be doing in order to debug with Wing, would someone kindly
> > inform me?
>
> > Thank you much,
> > -Nick Franceschina
>
> > On Jul 2, 12:55 pm, NickFranceschina 
> > wrote:
> > > I've been using WingIDE pro for a while... love it... followed advice
> > > to get it setup to work with Web2py and runs fine if I launch debugger
> > > through web2py.py ... but if I launch it through dev_appserver.py then
> > > the server runs and the app works and the breakpoints are hit for all
> > > code except for the controller code because, apparently, it is called
> > > via python "exec" method...
>
> > > this works fine through web2py's web server... but not through
> > > dev_appserver ... for me anyways
>
> > > What am I doing wrong?
>
> > > Thank you!
> > > -Nick Franceschina


Re: [web2py] Re: prohibit users to edit their profiles

2010-07-13 Thread Jonathan Lundell
On Jul 13, 2010, at 7:57 AM, Jean-Guy wrote:

> It had a the auth bar in the body of the views I put it into...
> 
> The profile button is still in the navigatio bar and the bar is duplicate.
> 
> It not replacing the original bar, not sure that was the goal... 

I haven't been following this thread, so I don't have a view on that. The 
SyntaxError you're seeing below, though, is simply that you've got two c= 
keyword arguments, which Python objects to. 'user' is a function, not a 
controller.

> 
> Jonhy
> 
> On 2010-07-13 10:25, Jonathan Lundell wrote:
>> 
>> On Jul 13, 2010, at 6:52 AM, Jean-Guy wrote:
>> 
>>> The : 
>>>{{=auth.navbar('welcome',URL(r=request,c='default',c='user'))}}
>> 
>> Try f='user' (not c=).
>> 
>> 
>>> 
>>> Not working :
>>> 
>>>  Traceback (most recent call last):
>>>   File "/nigthly_build/web2py/gluon/restricted.py", line 176, in restricted
>>> ccode = compile2(code,layer)
>>>   File "/nigthly_build/web2py/gluon/restricted.py", line 163, in compile2
>>> return compile(code.rstrip().replace('\r\n','\n')+'\n', layer, 'exec')
>>>   File 
>>> "/nigthly_build/web2py/applications/GUImdg1/views/lotns/create.html", line 
>>> 88
>>> 
>>> SyntaxError: keyword argument repeated
>>> 
>>> Jonhy
>>> 
>>> On 2010-07-12 18:22, mdipierro wrote:
 
 if in the view you use
 
{{=auth.navbar('welcome',URL(r=request,c='default',c='user'))}}
 
 then I just added some code to trunk so that if
 
auth.settings.actions_disabled.append('profile')
 
 The link to profile is not displayed.
 
 Please check it.
 
 On 12 Lug, 16:38, Jean-Guy  wrote:
   
> It raises a 404 error when "modify profil" is cliked...
> 
> I add those line to catch it up in the user controller:
> 
>  if request.args[0] == 'profile':
>  return dict(form='you are not allowed (permission)')
> 
> Maybe it could be simpler to just remove the entry in the layout??
> 
> Or both...
> 
> Jonhy
> 
> On 2010-07-12 15:31, mdipierro wrote:
> 
> 
>> auth.settings.actions_disabled.append('profile')
>>   
> 
>> On 12 Lug, 10:29, Jean-Guy  wrote:
>>   
> 
>>> I get this error :
>>> 
> 
>>> AttributeError:'NoneType'object has no attribute'append'
>>> 
> 
>>> I put this :
>>> 
> 
>>> auth.settings.function_disabled.append('profile')
>>> 
> 
>>> In the db.py and in the user function...
>>> 
> 
>>> Jonhy
>>> 
> 
>>> On 2010-07-12 11:04, mdipierro wrote:
>>> 
> 
 That line only links the edit profile page. To block it you need to
 1) remove the list (as you did) and
 2) auth.settings.function_disabled.append('profile')
   
> 
 On 12 Lug, 09:48, Jean-Guywrote:
   
> 
> Hello,
> 
> 
> It says here 
> :http://web2py.com/book/default/section/8/1?search=profile
> 
> 
> That this line :
> 
> 
> http://.../[app]/default/user/profile
> 
> 
> Control if the user can or not edit their profile by exposing or not 
> the
> function.
> 
> 
> I remove it but the users can still edit their profiles.
> 
> 
> Do I miss something?
> 
> 
> Jonhy
> 
>>> 
>> 
>> 
> 




[web2py] Fwd: crud.update strange behavior

2010-07-13 Thread Jean-Guy

Ok forget it I got it what my mistake :

   db.atable.initials.update=auth.user and auth.user.initials
db.atable.initials_date.update=request.now


Jonhy
 Original Message 
Subject:crud.update strange behavior
Date:   Tue, 13 Jul 2010 10:49:00 -0400
From:   Jean-Guy 
To: web2py@googlegroups.com



Hello,

I would like to make sure if it is my function that is not correct or 
the crud.update behavior...


Here are my create function and update fuction :

@auth.requires_login()
def create():
if auth.has_membership(auth.id_group('tech')):
form = crud.create(db.atable)
db.atable.initials.default=auth.user and auth.user.initials
db.atable.initials_date.default=request.now
if form.accepts(request.vars, session):
response.flash = T('form accepted')
redirect(URL(somewhere))
elif form.errors:
response.flash = T('form has errors')
else:
response.flash = T('please fill out the form')
return dict(form=form)

@auth.requires_login()
def update():
if auth.has_membership(auth.id_group('tech')):
form=crud.update(db.atable,request.args[1],deletable=False)
   db.atable.initials.default=auth.user and auth.user.initials
db.atable.initials_date.default=request.now
if form.accepts(request.vars, session):
response.flash = T('form accepted')
redirect(URL(somewhere))
elif form.errors:
response.flash = T('form has errors')
else:
response.flash = T('please correct the form')
return dict(form=form)

The problematic lines are in red in the function update

The database field initials is not updated when the update form is submit...

Is it normal?

Could it be reliated to .default= ??

I thought the problem were coming from the next argument that were 
included in the crud.update like this :


form=crud.update(db.atable,
 request.args[1],
 next=URL(request.application,'home','index'),
 deletable=False)

So i change it for what I wrote up there...

Thanks.

Jonhy



[web2py] Re: cube2py news

2010-07-13 Thread selecta
no really wysiwyg? you are my HERO :D

On Jul 13, 12:05 pm, mdipierro  wrote:
> It would be nice it were possible to modify elRTE to allow
> 1) not adding <..> tags inside ``...``:widget blocks
> 2) call the widget builder from inside elRTE.
>
> On 13 Lug, 04:49, mdipierro  wrote:
>
>
>
> > Please checkout cube2py again. Now it has two new features:
>
> > 1) a button [widget builder] that allows you to build widgets from a
> > menu with ajax popup. It could not get easier.
>
> > I could use somebody to go over the list of arguments and instructions
> > shown in the builder to make sure they are consistent.
>
> > 2) the widgets can also be embedded if plugin_wiki_mode='html' with
> > elRTE wysiwyg editor, but elRTE has to be in 'source' mode so you can
> > use cube2py without using MARKMIN.
>
> > Massimo


[web2py] login_methods/linkedin_account.py error

2010-07-13 Thread selecta
I tried to import  gluon.contrib.login_methods.linkedin_account
and got
File "/.../web2py/gluon/contrib/login_methods/linkedin_account.py",
line 45
profile = api.GetProfile(profile.public_url = "http://
www.linkedin.com/in/ozgurv")
SyntaxError: keyword can't be an expression


Re: [web2py] Re: prohibit users to edit their profiles

2010-07-13 Thread Jean-Guy

It had a the auth bar in the body of the views I put it into...

The profile button is still in the navigatio bar and the bar is duplicate.

It not replacing the original bar, not sure that was the goal...

Jonhy

On 2010-07-13 10:25, Jonathan Lundell wrote:

On Jul 13, 2010, at 6:52 AM, Jean-Guy wrote:


The :
{{=auth.navbar('welcome',URL(r=request,c='default',c='user'))}}


Try f='user' (not c=).




Not working :

Traceback(most recent call last):
   File"/nigthly_build/web2py/gluon/restricted.py",line176,inrestricted
 ccode=compile2(code,layer)
   File"/nigthly_build/web2py/gluon/restricted.py",line163,incompile2
 returncompile(code.rstrip().replace('\r\n','\n')+'\n',layer,'exec')
   
File"/nigthly_build/web2py/applications/GUImdg1/views/lotns/create.html",line88

SyntaxError:keyword argument repeated

Jonhy

On 2010-07-12 18:22, mdipierro wrote:

if in the view you use

{{=auth.navbar('welcome',URL(r=request,c='default',c='user'))}}

then I just added some code to trunk so that if

auth.settings.actions_disabled.append('profile')

The link to profile is not displayed.

Please check it.

On 12 Lug, 16:38, Jean-Guy  wrote:
   

It raises a 404 error when "modify profil" is cliked...

I add those line to catch it up in the user controller:

  if request.args[0] == 'profile':
  return dict(form='you are not allowed (permission)')

Maybe it could be simpler to just remove the entry in the layout??

Or both...

Jonhy

On 2010-07-12 15:31, mdipierro wrote:

 

auth.settings.actions_disabled.append('profile')
   
 

On 12 Lug, 10:29, Jean-Guywrote:
   
 

I get this error :
 
 

AttributeError:'NoneType'object has no attribute'append'
 
 

I put this :
 
 

auth.settings.function_disabled.append('profile')
 
 

In the db.py and in the user function...
 
 

Jonhy
 
 

On 2010-07-12 11:04, mdipierro wrote:
 
 

That line only links the edit profile page. To block it you need to
1) remove the list (as you did) and
2) auth.settings.function_disabled.append('profile')
   
 

On 12 Lug, 09:48, Jean-Guy  wrote:
   
 

Hello,
 
 

It says here :http://web2py.com/book/default/section/8/1?search=profile
 
 

That this line :
 
 

http://.../[app]/default/user/profile
 
 

Control if the user can or not edit their profile by exposing or not the
function.
 
 

I remove it but the users can still edit their profiles.
 
 

Do I miss something?
 
 

Jonhy
 









[web2py] crud.update strange behavior

2010-07-13 Thread Jean-Guy

Hello,

I would like to make sure if it is my function that is not correct or 
the crud.update behavior...


Here are my create function and update fuction :

@auth.requires_login()
def create():
if auth.has_membership(auth.id_group('tech')):
form = crud.create(db.atable)
db.atable.initials.default=auth.user and auth.user.initials
db.atable.initials_date.default=request.now
if form.accepts(request.vars, session):
response.flash = T('form accepted')
redirect(URL(somewhere))
elif form.errors:
response.flash = T('form has errors')
else:
response.flash = T('please fill out the form')
return dict(form=form)

@auth.requires_login()
def update():
if auth.has_membership(auth.id_group('tech')):
form=crud.update(db.atable,request.args[1],deletable=False)
   db.atable.initials.default=auth.user and auth.user.initials
db.atable.initials_date.default=request.now
if form.accepts(request.vars, session):
response.flash = T('form accepted')
redirect(URL(somewhere))
elif form.errors:
response.flash = T('form has errors')
else:
response.flash = T('please correct the form')
return dict(form=form)

The problematic lines are in red in the function update

The database field initials is not updated when the update form is submit...

Is it normal?

Could it be reliated to .default= ??

I thought the problem were coming from the next argument that were 
included in the crud.update like this :


form=crud.update(db.atable,
 request.args[1],
 next=URL(request.application,'home','index'),
 deletable=False)

So i change it for what I wrote up there...

Thanks.

Jonhy


Re: [web2py] Re: prohibit users to edit their profiles

2010-07-13 Thread Jonathan Lundell
On Jul 13, 2010, at 6:52 AM, Jean-Guy wrote:

> The : 
>{{=auth.navbar('welcome',URL(r=request,c='default',c='user'))}}

Try f='user' (not c=).


> 
> Not working :
> 
>  Traceback (most recent call last):
>   File "/nigthly_build/web2py/gluon/restricted.py", line 176, in restricted
> ccode = compile2(code,layer)
>   File "/nigthly_build/web2py/gluon/restricted.py", line 163, in compile2
> return compile(code.rstrip().replace('\r\n','\n')+'\n', layer, 'exec')
>   File "/nigthly_build/web2py/applications/GUImdg1/views/lotns/create.html", 
> line 88
> 
> SyntaxError: keyword argument repeated
> 
> Jonhy
> 
> On 2010-07-12 18:22, mdipierro wrote:
>> 
>> if in the view you use
>> 
>>{{=auth.navbar('welcome',URL(r=request,c='default',c='user'))}}
>> 
>> then I just added some code to trunk so that if
>> 
>>auth.settings.actions_disabled.append('profile')
>> 
>> The link to profile is not displayed.
>> 
>> Please check it.
>> 
>> On 12 Lug, 16:38, Jean-Guy  wrote:
>>   
>>> It raises a 404 error when "modify profil" is cliked...
>>> 
>>> I add those line to catch it up in the user controller:
>>> 
>>>  if request.args[0] == 'profile':
>>>  return dict(form='you are not allowed (permission)')
>>> 
>>> Maybe it could be simpler to just remove the entry in the layout??
>>> 
>>> Or both...
>>> 
>>> Jonhy
>>> 
>>> On 2010-07-12 15:31, mdipierro wrote:
>>> 
>>> 
 auth.settings.actions_disabled.append('profile')
   
>>> 
 On 12 Lug, 10:29, Jean-Guy  wrote:
   
>>> 
> I get this error :
> 
>>> 
> AttributeError:'NoneType'object has no attribute'append'
> 
>>> 
> I put this :
> 
>>> 
> auth.settings.function_disabled.append('profile')
> 
>>> 
> In the db.py and in the user function...
> 
>>> 
> Jonhy
> 
>>> 
> On 2010-07-12 11:04, mdipierro wrote:
> 
>>> 
>> That line only links the edit profile page. To block it you need to
>> 1) remove the list (as you did) and
>> 2) auth.settings.function_disabled.append('profile')
>>   
>>> 
>> On 12 Lug, 09:48, Jean-Guywrote:
>>   
>>> 
>>> Hello,
>>> 
>>> 
>>> It says here :http://web2py.com/book/default/section/8/1?search=profile
>>> 
>>> 
>>> That this line :
>>> 
>>> 
>>> http://.../[app]/default/user/profile
>>> 
>>> 
>>> Control if the user can or not edit their profile by exposing or not the
>>> function.
>>> 
>>> 
>>> I remove it but the users can still edit their profiles.
>>> 
>>> 
>>> Do I miss something?
>>> 
>>> 
>>> Jonhy
>>> 
> 




[web2py] Web2py Application Exhibition - 2 weeks left

2010-07-13 Thread NetAdmin
Web2py Application Exhibition

Do you have a Web2py app that you'd like to show the world?
If so, you may be interested in the Web2py Application Exhibition.

The WAE is a way to...
1. Demonstrate what can be done with Web2py.
2. Share and learn about useful web2py, python, Javascript, jQuery
etc. techniques.
3. Earn some money toward that new  you've been craving.

Projects will be judged in the following areas.

Ease of use
Usefulness
Visual Appeal

The Rules
1. Applications must be submitted no later than July 30, 2010

2. Source must be included with your submissions.

3. If the application is written by a team, Massimo can NOT be
part of the team.

4. After a 2 week review period, on August 15, 2010, the
winners will be announced on the web2py-users list.

5. The 1st place winner will receive $100 US Dollars,
2nd place will receive $50

6. You must enjoy using Web2py!

Massimo is not affiliated with this exhibition, ( maybe he'll help
judge if I can twist his arm ) so, if you have any questions or
comments, I can be contacted on gmail


If the google-groups hides my contact info, you can
find it at http://bithawk.org

Note: My internet access will be down until the 21st of July,
so the above link won't be active until then.

mr.netadmin


Re: [web2py] Re: prohibit users to edit their profiles

2010-07-13 Thread Jean-Guy

The :

   {{=auth.navbar('welcome',URL(r=request,c='default',c='user'))}}


Not working :

Traceback(most recent call last):
  File"/nigthly_build/web2py/gluon/restricted.py",line176,inrestricted
ccode=compile2(code,layer)
  File"/nigthly_build/web2py/gluon/restricted.py",line163,incompile2
returncompile(code.rstrip().replace('\r\n','\n')+'\n',layer,'exec')
  
File"/nigthly_build/web2py/applications/GUImdg1/views/lotns/create.html",line88

SyntaxError:keyword argument repeated


Jonhy

On 2010-07-12 18:22, mdipierro wrote:

if in the view you use

{{=auth.navbar('welcome',URL(r=request,c='default',c='user'))}}

then I just added some code to trunk so that if

auth.settings.actions_disabled.append('profile')

The link to profile is not displayed.

Please check it.

On 12 Lug, 16:38, Jean-Guy  wrote:
   

It raises a 404 error when "modify profil" is cliked...

I add those line to catch it up in the user controller:

  if request.args[0] == 'profile':
  return dict(form='you are not allowed (permission)')

Maybe it could be simpler to just remove the entry in the layout??

Or both...

Jonhy

On 2010-07-12 15:31, mdipierro wrote:

 

auth.settings.actions_disabled.append('profile')
   
 

On 12 Lug, 10:29, Jean-Guywrote:
   
 

I get this error :
 
 

AttributeError:'NoneType'object has no attribute'append'
 
 

I put this :
 
 

auth.settings.function_disabled.append('profile')
 
 

In the db.py and in the user function...
 
 

Jonhy
 
 

On 2010-07-12 11:04, mdipierro wrote:
 
 

That line only links the edit profile page. To block it you need to
1) remove the list (as you did) and
2) auth.settings.function_disabled.append('profile')
   
 

On 12 Lug, 09:48, Jean-Guy  wrote:
   
 

Hello,
 
 

It says here :http://web2py.com/book/default/section/8/1?search=profile
 
 

That this line :
 
 

http://.../[app]/default/user/profile
 
 

Control if the user can or not edit their profile by exposing or not the
function.
 
 

I remove it but the users can still edit their profiles.
 
 

Do I miss something?
 
 

Jonhy
 




Re: [web2py] Re: prohibit users to edit their profiles

2010-07-13 Thread Jean-Guy

Ok I think I miss understand for now I use this line :

   {{=auth.navbar('welcome',URL(r=request,c='default',c='user'))}}


In the view... And in the trunk only this line will be necessary

   auth.settings.actions_disabled.append('profile')


??

Jonhy

PS.: The nigthly build no seems to contain the mod for now.






On 2010-07-12 18:22, mdipierro wrote:

if in the view you use

{{=auth.navbar('welcome',URL(r=request,c='default',c='user'))}}

then I just added some code to trunk so that if

auth.settings.actions_disabled.append('profile')

The link to profile is not displayed.

Please check it.

On 12 Lug, 16:38, Jean-Guy  wrote:
   

It raises a 404 error when "modify profil" is cliked...

I add those line to catch it up in the user controller:

  if request.args[0] == 'profile':
  return dict(form='you are not allowed (permission)')

Maybe it could be simpler to just remove the entry in the layout??

Or both...

Jonhy

On 2010-07-12 15:31, mdipierro wrote:

 

auth.settings.actions_disabled.append('profile')
   
 

On 12 Lug, 10:29, Jean-Guywrote:
   
 

I get this error :
 
 

AttributeError:'NoneType'object has no attribute'append'
 
 

I put this :
 
 

auth.settings.function_disabled.append('profile')
 
 

In the db.py and in the user function...
 
 

Jonhy
 
 

On 2010-07-12 11:04, mdipierro wrote:
 
 

That line only links the edit profile page. To block it you need to
1) remove the list (as you did) and
2) auth.settings.function_disabled.append('profile')
   
 

On 12 Lug, 09:48, Jean-Guy  wrote:
   
 

Hello,
 
 

It says here :http://web2py.com/book/default/section/8/1?search=profile
 
 

That this line :
 
 

http://.../[app]/default/user/profile
 
 

Control if the user can or not edit their profile by exposing or not the
function.
 
 

I remove it but the users can still edit their profiles.
 
 

Do I miss something?
 
 

Jonhy
 




Re: [web2py] Re: prohibit users to edit their profiles

2010-07-13 Thread Jean-Guy

Hello,

Is the mod you made is in the nightly build now?

Jonhy

On 2010-07-12 18:22, mdipierro wrote:

if in the view you use

{{=auth.navbar('welcome',URL(r=request,c='default',c='user'))}}

then I just added some code to trunk so that if

auth.settings.actions_disabled.append('profile')

The link to profile is not displayed.

Please check it.

On 12 Lug, 16:38, Jean-Guy  wrote:
   

It raises a 404 error when "modify profil" is cliked...

I add those line to catch it up in the user controller:

  if request.args[0] == 'profile':
  return dict(form='you are not allowed (permission)')

Maybe it could be simpler to just remove the entry in the layout??

Or both...

Jonhy

On 2010-07-12 15:31, mdipierro wrote:

 

auth.settings.actions_disabled.append('profile')
   
 

On 12 Lug, 10:29, Jean-Guywrote:
   
 

I get this error :
 
 

AttributeError:'NoneType'object has no attribute'append'
 
 

I put this :
 
 

auth.settings.function_disabled.append('profile')
 
 

In the db.py and in the user function...
 
 

Jonhy
 
 

On 2010-07-12 11:04, mdipierro wrote:
 
 

That line only links the edit profile page. To block it you need to
1) remove the list (as you did) and
2) auth.settings.function_disabled.append('profile')
   
 

On 12 Lug, 09:48, Jean-Guy  wrote:
   
 

Hello,
 
 

It says here :http://web2py.com/book/default/section/8/1?search=profile
 
 

That this line :
 
 

http://.../[app]/default/user/profile
 
 

Control if the user can or not edit their profile by exposing or not the
function.
 
 

I remove it but the users can still edit their profiles.
 
 

Do I miss something?
 
 

Jonhy
 




[web2py] user registration approval - how to get email about new wating registration?

2010-07-13 Thread David Marko
Hello,
in my app I would like to use registration, that will require admin
approval.
( auth.settings.registration_requires_approval = True ). Is there a
way, how to get information( e.g. by email message) that someone did
registration and is waiting on my admin approval?

Thanks your for you info,
David


[web2py] Re: markmin, t2, t3, cube9 etc. (important update)

2010-07-13 Thread Timmie
Hello,
cube2py looks awesome.

> It uses markmin:
>
> -
>    http://web2py.com/examples/static/markmin.html
> -
I wonder why the syntax was not derived from restructured text or
alike?


Re: [web2py] Best way for a config file

2010-07-13 Thread Mathieu Clabaut
I use http://web2pyslices.com/main/slices/take_slice/88 
Which allows the admin to change config on the fly by updating the database
values.

On Tue, Jul 13, 2010 at 09:06, Narendran  wrote:

> Hi,
> I have been trying to work without a config file, but it is a little
> difficult to work across multiple (dev, test and prod) envs. I'd like
> to know the solution if this has been already discussed:
> 1. The db configuration in db.py changes in dev, test and prod env.
> 2. App name changes in different env.
> 3. Other global variables that can change in different envs.
>
> --
> Thanks
> Narendran


[web2py] Re: cube2py news

2010-07-13 Thread mdipierro
It would be nice it were possible to modify elRTE to allow
1) not adding <..> tags inside ``...``:widget blocks
2) call the widget builder from inside elRTE.


On 13 Lug, 04:49, mdipierro  wrote:
> Please checkout cube2py again. Now it has two new features:
>
> 1) a button [widget builder] that allows you to build widgets from a
> menu with ajax popup. It could not get easier.
>
> I could use somebody to go over the list of arguments and instructions
> shown in the builder to make sure they are consistent.
>
> 2) the widgets can also be embedded if plugin_wiki_mode='html' with
> elRTE wysiwyg editor, but elRTE has to be in 'source' mode so you can
> use cube2py without using MARKMIN.
>
> Massimo


[web2py] Re: new welcome (scaffolding) app

2010-07-13 Thread mdipierro
The list of options is a possibility but add complexity to the code.

How about?
1) a new layout
2) jquery + js menu
3) everything else in a plugin can can be removed

Massimo

On 13 Lug, 04:47, Nicol van der Merwe  wrote:
> On Sat, Jul 10, 2010 at 2:28 AM, Bruno Rocha  wrote:
> > Is there any chance to have that options for choose just at the moment
> > of app creation?
>
> > we put the name for the application, then check what do we want to have
> > within.
>
> > May be choosing a completely blank new app or a complete one,
>
> +1 for a blank and complete option.
>
> choosing
>
>
>
> > the theme, to have or not things like Plugins, Wiki, Jquery UI etc..
>
> > and the new app based on scaffold app is created dinamically.
>
> > By the way my choice is:
>
> > 2010/7/9 mdipierro :
> > > let's consider a new scaffolding app.
>
> > > What should be in it?
> > > What should not be in it?
>
> > > possible suggestions:
> > > [ ] js menu
> > I prefer a simple CSS menu
> > > [x] new layout (suggestions?)
> > I think default scaffold app needs to be clean, minimalist, a blank theme.
> > "Good design is as little design as possible."
> > 
> > > [x] more complex views/layout?
> > RSS, Json, XML examples too
> > > [ ] simpler views/layout.html
> > > [x ] example plugins
> > GRID plugin, it is usefull for most projects
> > > [ ] plugin_wiki from cube2py?
> > > [ ] jquery.ui
> > > [x] facebook, twitter, Gmail, openID authentication
> > > [x] webservices example
> > > [x] Sending mail examples
> > > Massimo
>
> > --
>
> >http://rochacbruno.com.br
>
> --
> Old Gregg: Ever drink baileys from a shoe? Wanna go to a club where people
> wee on each other? I'm gonna hurt you. I like you. What do ya think of me?
> Howard:I think your a nice..modern gentleman


[web2py] cube2py news

2010-07-13 Thread mdipierro
Please checkout cube2py again. Now it has two new features:

1) a button [widget builder] that allows you to build widgets from a
menu with ajax popup. It could not get easier.

I could use somebody to go over the list of arguments and instructions
shown in the builder to make sure they are consistent.

2) the widgets can also be embedded if plugin_wiki_mode='html' with
elRTE wysiwyg editor, but elRTE has to be in 'source' mode so you can
use cube2py without using MARKMIN.

Massimo


Re: [web2py] new welcome (scaffolding) app

2010-07-13 Thread Nicol van der Merwe
On Sat, Jul 10, 2010 at 2:28 AM, Bruno Rocha  wrote:

> Is there any chance to have that options for choose just at the moment
> of app creation?
>
> we put the name for the application, then check what do we want to have
> within.
>
> May be choosing a completely blank new app or a complete one,


+1 for a blank and complete option.

choosing
> the theme, to have or not things like Plugins, Wiki, Jquery UI etc..
>
> and the new app based on scaffold app is created dinamically.
>
> By the way my choice is:
>
> 2010/7/9 mdipierro :
> > let's consider a new scaffolding app.
> >
> > What should be in it?
> > What should not be in it?
> >
> > possible suggestions:
> > [ ] js menu
> I prefer a simple CSS menu
> > [x] new layout (suggestions?)
> I think default scaffold app needs to be clean, minimalist, a blank theme.
> "Good design is as little design as possible."
> < http://52weeksofux.com/tagged/week_8 >
> > [x] more complex views/layout?
> RSS, Json, XML examples too
> > [ ] simpler views/layout.html
> > [x ] example plugins
> GRID plugin, it is usefull for most projects
> > [ ] plugin_wiki from cube2py?
> > [ ] jquery.ui
> > [x] facebook, twitter, Gmail, openID authentication
> > [x] webservices example
> > [x] Sending mail examples
> > Massimo
>
>
>
> --
>
> http://rochacbruno.com.br
>



-- 
Old Gregg: Ever drink baileys from a shoe? Wanna go to a club where people
wee on each other? I'm gonna hurt you. I like you. What do ya think of me?
Howard:I think your a nice..modern gentleman


[web2py] Re: Help in getting csv-download to work

2010-07-13 Thread mdipierro
Thanks for your questions. I am sure it helps clarify this to other
users as well.

Massimo

On 13 Lug, 04:13, Johann Spies  wrote:
> On 13 July 2010 00:07, mdipierro  wrote:
>
> > This your actions
>
> > def evaluation_data():
> ...
> >    if form.accepts(request.vars, session):
> >        redirect(URL(r=request,
> > f='search_filled_in_forms',vars=request.vars))
> >
> > IT DOES NOT DEFINE rows
>
> Correct, it was defined in the redirected function 'search_filled_in_forms'
>
>
>
> > IT EXPECTS A VARIABLE rows
>
> Thanks anyhow.  I got it working from your answers in another thread
> earlier today.
>
> Much appreciated.
>
> Johann
> --
> "Finally, brethren, whatsoever things are true,  whatsoever things are
> honest, whatsoever things are  just, whatsoever things are pure,
> whatsoever things are lovely, whatsoever things are of good report; if
> there be any virtue, and if there be any praise, think on these
> things."    Philippians 4:8


Re: [web2py] Re: Help in getting csv-download to work

2010-07-13 Thread Johann Spies
On 13 July 2010 00:07, mdipierro  wrote:
> This your actions
>
> def evaluation_data():
...
>    if form.accepts(request.vars, session):
>        redirect(URL(r=request,
> f='search_filled_in_forms',vars=request.vars))
>
> IT DOES NOT DEFINE rows

Correct, it was defined in the redirected function 'search_filled_in_forms'

>
> IT EXPECTS A VARIABLE rows

Thanks anyhow.  I got it working from your answers in another thread
earlier today.

Much appreciated.

Johann
-- 
"Finally, brethren, whatsoever things are true,  whatsoever things are
honest, whatsoever things are  just, whatsoever things are pure,
whatsoever things are lovely, whatsoever things are of good report; if
there be any virtue, and if there be any praise, think on these
things."    Philippians 4:8


[web2py] Re: Commenting system - Disqus/IntenseDebate

2010-07-13 Thread mdipierro
I do not know about them but I have these

http://web2py.com/plugins/default/comments
http://web2py.com/plugins/default/simple_comments

Other users have other systems

On 13 Lug, 03:11, Narendran  wrote:
> Hi,
> I'm about to add commenting system to my site I've developed using
> web2py. I'd like to hear opinions regarding integrating Disqus, or
> IntenseDebate, if someone has already done this.
> If there is some native web2py widget, I'd like to try that as well. I
> could not hit any on googling for one.
>
> --
> Thanks
> Narendran


[web2py] Commenting system - Disqus/IntenseDebate

2010-07-13 Thread Narendran
Hi,
I'm about to add commenting system to my site I've developed using
web2py. I'd like to hear opinions regarding integrating Disqus, or
IntenseDebate, if someone has already done this.
If there is some native web2py widget, I'd like to try that as well. I
could not hit any on googling for one.

--
Thanks
Narendran


[web2py] Re: loop generated forms

2010-07-13 Thread JmiXIII
Try to use :
return dict (a=b)

Maybe you need to have a look there :
http://docs.python.org/library/stdtypes.html#dict

On 13 juil, 00:19, Jonathan Lundell  wrote:
> On Jul 12, 2010, at 3:04 PM, Rick wrote:
>
> > Thanks for your inspiring answer,
>
> > After I found this page:
> >http://code.activestate.com/recipes/440502-a-dictionary-with-multiple...
> > ...I tried with:
> > return dict['form'].append([x])
> > ...but my new code doesn't work neither. I just get "TypeError: 'type'
> > object is unsubscriptable".
>
> Don't use the word 'dict'.
>
> > Though I think this code is nearer the
> > solution.
>
> > On Jul 12, 10:44 pm, JmiXIII  wrote:
> >> Hello ,
>
> >> I've used something like this :
> >> def listform():
> >>   listf=[]
> >>   thing = [one two three]
> >>   for x in thing:
> >>      form=FORM(':', INPUT(_name="name"))
> >>      listf.append(form)
> >> return dict(listf=listf)
>
> >> Yet I usually use SQLFORM and add a submit button
>
> >> As this is my firts answer to a coding question, do not hesitate to
> >> tell if I'm wrong
>
> >> On 12 juil, 22:26, Rick  wrote:
>
> >>> Hi,
>
> >>> How to generate multiple forms with a loop?
>
> >>> In my controller file there are forms generated with this loop:
>
> >>> thing=[one, two, three]
> >>> def theFunction():
> >>>         for thing1  in varibale1:
> >>>                 form=FORM(':',
> >>>                                 INPUT(_name='name')
> >>>                         )
> >>>                 return dict(form=form)
>
> >>> ...but this code doesn't work. I just get the message "invalid view".
> >>> I suppose the reason that I get this message is that all the forms
> >>> have the same name in the view file. Therefor I also tried with:
> >>>         return dict(form=[thing])
> >>> ...but got:
> >>> SyntaxError: keyword can't be an expression
>
> >>> I've tried with this code in the view file:
>
> >>>         {{extend 'layout.html'}}
> >>>         {{=form}}
>
> >>> ...and also with this:
>
> >>>         {{extend 'layout.html'}}
> >>>         
> >>>         {{thing=[one, two, three]}}
> >>>         {{for thing1  in varibale1:}}
> >>>                 {{=form}}
> >>>         
>
> >>> ...but none of them worked.
>
> >>> Thanks in advance for help


[web2py] Re: Best way for a config file

2010-07-13 Thread mdipierro
This is what I do. I create a model called 0.py and in it I put

from gluon.storage import Storage
settings=Storage()
settings.production=False
settings.email_sender=...'
settings.email_hostname=''
# any other parameter I need



On 13 Lug, 02:06, Narendran  wrote:
> Hi,
> I have been trying to work without a config file, but it is a little
> difficult to work across multiple (dev, test and prod) envs. I'd like
> to know the solution if this has been already discussed:
> 1. The db configuration in db.py changes in dev, test and prod env.
> 2. App name changes in different env.
> 3. Other global variables that can change in different envs.
>
> --
> Thanks
> Narendran


[web2py] Best way for a config file

2010-07-13 Thread Narendran
Hi,
I have been trying to work without a config file, but it is a little
difficult to work across multiple (dev, test and prod) envs. I'd like
to know the solution if this has been already discussed:
1. The db configuration in db.py changes in dev, test and prod env.
2. App name changes in different env.
3. Other global variables that can change in different envs.

--
Thanks
Narendran


[web2py] Re: Can web2py be used as a node in a P2P app or store data in a DHT?

2010-07-13 Thread mdipierro
This can be done. I am very much interested in having this done. My
idea is building a distributed news delivery network. Anybody can run
and advertise a news web site. Every local installation would have
local ads and the right to post news and vote for news. But news are
not stored locally (only a copy) so the news network cannot be shut
down.

Massimo

On 12 Lug, 22:43, xenfasa  wrote:
> Can web2py be used as a node in a P2P app or store data in a DHT?
>
> For example, a user wishing to run a web2py P2P app node would install
> web2py then the application file(s).  Access the application through a
> web interface but then in the backend, instead of storing data just
> locally, have the P2P back-end application share and manage data in
> the form of encrypted Distributed Hash Table  (DHT) amoung other
> web2py nodes?
>
> For example something like Khashmir (http://khashmir.sourceforge.net/)
>  be integrated with web2py?
> if so how?
>
> thanks,
> xen


[web2py] Re: Minor bug?

2010-07-13 Thread Massimo Di Pierro

Please check if this is fixed in trunk.

On Jul 13, 2010, at 1:11 AM, Rāma wrote:


Hi Massimo,

I got this error when trying to rename a field from  
enrollable_by_Guest to enrollable_by_guest
I am not sure wether it's suppose to behave that way. But, now it  
seems I can't rename it to the one I want (smallcaps) anymore.


Regards,
Ranjeev

Traceback (most recent call last):
File "C:\web2py\gluon\restricted.py", line 178, in restricted
exec ccode in environment
File "c:/web2py/applications/alpha/models/db.py", line 80, in 
Field('enrollment_closes', 'date'))
File "C:\web2py\gluon\sql.py", line 1309, in define_table
t._create(migrate=migrate, fake_migrate=fake_migrate)
File "C:\web2py\gluon\sql.py", line 1775, in _create
fake_migrate=fake_migrate)
File "C:\web2py\gluon\sql.py", line 1840, in _migrate
self._db._execute(sub_query)
File "C:\web2py\gluon\sql.py", line 897, in 
self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
OperationalError: duplicate column name: enrollable_by_guest