[web2py] I just discovered this

2010-12-23 Thread mdipierro
http://reia-lang.org/



[web2py] Re: ajax polling with web2py

2010-12-23 Thread mdipierro
Do you have an ajax generated by code inside another ajax request?
I believe SCRIPT(...) is returned but never executed for the same
reason as in your code at the beginning of the thread: ... inside ajax content are ignored by the browser.

On Dec 24, 12:16 am, weheh  wrote:
> Problem with my example above is that the setInterval is not being
> executed after the callback.


Re: [web2py] Re: form.accepts = False. How to find out why

2010-12-23 Thread Johann Spies
On 23 December 2010 16:42, DenesL  wrote:

>
> Two things to check:
> 1) you might have session.forget() in the controller, maybe outside
> the action.
> 2) you might be using a custom form and it is missing the hidden
> fields,
>   if you don't have the _formkey then the form will not be accepted.


I have it working now and it seems that the main thing I have changed to
make it work was to change the name of the field (from 'id' to something
else).  I did not check afterwards in the documentation but I suspect that
SQLFORM.factory uses an 'id' field (hidden).

What I could not understand was that when I the normal crud form in the html
there were two identical fields('id') although I had only one in my
definition.  Changing the name of the field corrected that and the
redirection took place as expected.

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


Re: [web2py] Re: The stability of web2py releases

2010-12-23 Thread Luis Díaz
+1

2010/12/24 ron_m 

> I for one am happy with the current release cycle. It is a good balance
> between new features and the ultimate stability of release 1.XX.N  where N
> is the last version before XX+1 for example. The nightly build is a bit of a
> misnomer, many projects (C or C++ mostly) have some automated process that
> takes trunk and compiles it to produce a .tar.gz labelled nightly which
> "might" work. For web2py we should just hg pull; hg update to achieve that
> result. The nightly for web2py is more like a beta because Massimo hand
> picks code from trunk that will or will not be in the nightly which could
> really be a weekly.
>
> I am currently developing the application I am working on and testing is
> easy enough that I test trunk at least daily. The web2py server is quite
> easy to use but the code in some places is complicated and has many possible
> use cases. It is only through exposure out to the user base that a large
> number of use cases of the code get tested. I have even seen problems
> reported where something was fixed but used by maybe one person in a way
> that should not have worked resulting in the dreaded bug that worked and
> became a useful feature for someone.
>
> Once I go to production I will probably move the releases a lot slower
> through the installed base. In fact I have 2 beta production systems up now
> and only push a new web2py when I push a new version of the application to
> the stakeholders to look at.
>
> Massimo provides a fantastic service with the web2py project and I would
> not like to see him stifled by a load of process. Anyone that has time to
> test will definitely help the quality, if you don't have time, that is okay
> too. I personally don't mind doing some release management between where
> Massimo is burning the midnight oil and what I let out into the production
> systems I have/will manage. The product is alive with new features and bug
> fixes sometimes occur in minutes once reported. That is worth a lot.
>
> Ron
>
>
>


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

http://web2pyfacil.blogspot.com/
Facultad de 
Odontología


[web2py] Re: Merry Christmas

2010-12-23 Thread Kostas M
def best_wishes(web2py):
for i in web2py.users:
print "Dear %s I wish you Merry Christmas \
 and a Happy New Year!!" % i


[web2py] Re: The stability of web2py releases

2010-12-23 Thread ron_m
I for one am happy with the current release cycle. It is a good balance 
between new features and the ultimate stability of release 1.XX.N  where N 
is the last version before XX+1 for example. The nightly build is a bit of a 
misnomer, many projects (C or C++ mostly) have some automated process that 
takes trunk and compiles it to produce a .tar.gz labelled nightly which 
"might" work. For web2py we should just hg pull; hg update to achieve that 
result. The nightly for web2py is more like a beta because Massimo hand 
picks code from trunk that will or will not be in the nightly which could 
really be a weekly.

I am currently developing the application I am working on and testing is 
easy enough that I test trunk at least daily. The web2py server is quite 
easy to use but the code in some places is complicated and has many possible 
use cases. It is only through exposure out to the user base that a large 
number of use cases of the code get tested. I have even seen problems 
reported where something was fixed but used by maybe one person in a way 
that should not have worked resulting in the dreaded bug that worked and 
became a useful feature for someone.

Once I go to production I will probably move the releases a lot slower 
through the installed base. In fact I have 2 beta production systems up now 
and only push a new web2py when I push a new version of the application to 
the stakeholders to look at.

Massimo provides a fantastic service with the web2py project and I would not 
like to see him stifled by a load of process. Anyone that has time to test 
will definitely help the quality, if you don't have time, that is okay too. 
I personally don't mind doing some release management between where Massimo 
is burning the midnight oil and what I let out into the production systems I 
have/will manage. The product is alive with new features and bug fixes 
sometimes occur in minutes once reported. That is worth a lot.

Ron




[web2py] Re: ajax polling with web2py

2010-12-23 Thread weheh
Problem with my example above is that the setInterval is not being
executed after the callback.


[web2py] Re: ajax polling with web2py

2010-12-23 Thread weheh
OK, I think I see what you're doing, but when I apply it to my
ultimate app as opposed to the test case, it doesn't work. Here's an
example that's practically identical to what I'm trying to do (some
names have been changed):

#view
def poll(job_id):
 
filename=db(db.mytable.job==job_id).select(db.mytable.filename).first()
  if filename:
return show_job_results(job_id,filename)
  else:
return show_wait_icon(job_id)

def show_job_results(job_id,filename):
  ... # this displays OK ... no need to discuss here

def show_wait_icon(job_id):
  return DIV(
IMG(_src=URL(...path to wait icon .gif...),_alt='waiting'),
SCRIPT("""
  function update_job_status() {
ajax('refresh/%(id)d',['job-%(id)d'],':eval');
return false;
  }
  setInterval('update_job_status()',5000);
  """%dict(id=job_id)
),
_id='job-%(id)d'%job_id
  )

# controller
def refresh():
  if not len(request.args): return 'false'
  try: id=int(request.args(0))
  except: return 'false'
  return """
jQuery("#job-%(id)d").html("%(poll)s");
setInterval("update_job_status()",5000);
"""%dict(id=id,poll=poll(id))

The idea being, that as long as the job output file is missing, then
keep polling every 5 sec.


[web2py] Re: ajax polling with web2py

2010-12-23 Thread mdipierro
yes and no. First you missed a return false. Without that the page may
get reloaded.

#view
DIV(A('click me',_href='#',_id='parent',_onclick("ajax('clickback',
['parent'],':eval');return false")))

#controller
def clickback():
  return 'jQuery("#parent").html("%s");' %\
 SCRIPT("alert('hello world');")


now the jQuery returned by clickback will be executed on ajax but the
second the SCRIPT inside the html will never be executed. But you can
do:

#view
DIV(A('click me',_href='#',_id='parent',_onclick("ajax('clickback',
['parent'],':eval');return false")))

#controller
def clickback():
  return 'jQuery("#parent").html("whatever");alert("hello world");'

and now the alert will be executed.

Did this answer your problem?

the JS returned by the clickback

On Dec 23, 11:32 pm, weheh  wrote:
> Massimo, I appreciate the response, but am finding your answer very
> difficult to understand. In particular, I don't have a clue as to what
> your callback is doing. What is response.js? Why are you returning
> "hello world" when response.js is outputting "hello!". Is there any
> chance you can rewrite the original example at the top of this thread
> so that it would work? Thanks. - RG
>
> On Dec 24, 12:09 am, mdipierro  wrote:
>
> > It depends on how you do the ajax call:
>
> > I suggest you can use the web2py_ajax.html function:
>
> >    web2py_ajax_page(method,action,data,target)
>
> > For example in view
>
> >  > onclick="web2py_ajax_page('POST','{{=URL('callback'}}}',null,'target');">click
> > me
> > 
>
> > and in controller
>
> > def callback():
> >     response.js = "jQuery('.flash').html('hello!').fadeIn();"
> >     return "hello world"
>
> > Massimo
>
> > On Dec 23, 7:19 pm, weheh  wrote:
>
> > > Let me try to state this more succinctly:
>
> > > How do I get a jQuery, which is created by a controller in response to
> > > an ajax call, to execute when loaded into it's target div?
>
>


[web2py] Re: ajax polling with web2py

2010-12-23 Thread weheh
Massimo, I appreciate the response, but am finding your answer very
difficult to understand. In particular, I don't have a clue as to what
your callback is doing. What is response.js? Why are you returning
"hello world" when response.js is outputting "hello!". Is there any
chance you can rewrite the original example at the top of this thread
so that it would work? Thanks. - RG

On Dec 24, 12:09 am, mdipierro  wrote:
> It depends on how you do the ajax call:
>
> I suggest you can use the web2py_ajax.html function:
>
>    web2py_ajax_page(method,action,data,target)
>
> For example in view
>
>  onclick="web2py_ajax_page('POST','{{=URL('callback'}}}',null,'target');">click
> me
> 
>
> and in controller
>
> def callback():
>     response.js = "jQuery('.flash').html('hello!').fadeIn();"
>     return "hello world"
>
> Massimo
>
> On Dec 23, 7:19 pm, weheh  wrote:
>
> > Let me try to state this more succinctly:
>
> > How do I get a jQuery, which is created by a controller in response to
> > an ajax call, to execute when loaded into it's target div?
>
>


[web2py] Re: wiki-meta-header, meta-footer, etc.... edit "layout.html"

2010-12-23 Thread mdipierro
edit the default view layout.html as follows

[...]
left_sidebar_enabled = globals().get('left_sidebar_enabled',true); //
<<< was false
[...]
 
  {{block header}} 
 {{=plugin_wiki.embed_page('meta-header') or 'header'}}
  {{end}}

[...]
  

  {{block left_sidebar}}
{{=plugin_wiki.embed_page('meta-sidebar') or
'sidebar'}}
  {{end}}

  
[...]

  {{block footer}} 
 {{=plugin_wiki.embed_page('meta-footer') or 'footer'}}
  {{end}}

[...]


On Dec 23, 10:04 pm, cadrentes  wrote:
> Can you provide some more details on the plugin_wiki layout feature.
> I'm afraid the "appropriate places" are not obvious to me.
>
> "meta-header, meta-footer, meta-sidebar are not used by the default
> layout in "welcome/views/layout.html". If you want to use them edit
> "layout.html" using admin (or the shell) and place the following tags
> in the appropriate places:"
>
> Thanks!


[web2py] Re: ajax polling with web2py

2010-12-23 Thread mdipierro
It depends on how you do the ajax call:

I suggest you can use the web2py_ajax.html function:

   web2py_ajax_page(method,action,data,target)

For example in view

click
me


and in controller

def callback():
response.js = "jQuery('.flash').html('hello!').fadeIn();"
return "hello world"


Massimo

On Dec 23, 7:19 pm, weheh  wrote:
> Let me try to state this more succinctly:
>
> How do I get a jQuery, which is created by a controller in response to
> an ajax call, to execute when loaded into it's target div?


[web2py] Re: ajax polling with web2py

2010-12-23 Thread weheh
Hi Kuba - I believe it is the same or similar issue. I posted a
similar issue a few months ago and never got a response. Anyway, this
is mission critical for my app. I have a background queue that's
generating data for display. While it's running, I have a javascript
that should be polling the queue to see if the job is done. If done,
it should display the job results. Otherwise, it should show a wait
icon. Problem is, the queue is launched via an ajax. After launching
the queue, the controller then writes an ajax script to a target div
for the purpose of polling the queue. However, this newly generated
ajax never gets executed, so the polling doesn't work. I know of no
other way to do this other than to refresh the entire page, which is a
kludge. I know refreshing the whole page would work because the
polling routine runs if it is loaded at the time the page is loaded.

I'm stuck and need some help here. Has anyone ever gotten something
like this to work?

On Dec 23, 9:19 pm, Kuba Kucharski  wrote:
> hi,
>
> that is a very good question. April, f.e:
>
> http://www.mail-archive.com/web2py@googlegroups.com/msg34855.html
>
> --
> Kuba


[web2py] wiki-meta-header, meta-footer, etc.... edit "layout.html"

2010-12-23 Thread cadrentes
Can you provide some more details on the plugin_wiki layout feature.
I'm afraid the "appropriate places" are not obvious to me.

"meta-header, meta-footer, meta-sidebar are not used by the default
layout in "welcome/views/layout.html". If you want to use them edit
"layout.html" using admin (or the shell) and place the following tags
in the appropriate places:"

Thanks!



[web2py] Re: GAE shows problem.

2010-12-23 Thread mdipierro
for now do this instead:

db(db.languages).select(cache=(cache.ram,3600)).sort(lambda a:
a.full)]*

mind that unless you redefined cache.ram as GAE memcache the caching
will not work.

On Dec 23, 1:41 pm, "Arun K.Rajeevan"  wrote:
> see GAE error message. (it runs perfectly fine, if web2py run stand alone)
> And was running ok, till previos hour.
> What I can track is *init/controllers/default.py:index", line 5, in 
>
> *and that line is perfect (given below) and runs ok in web2py stand alone.
> *options = [OPTION(row.full + '  - ' + row.short, _value=row.id) for row in
> db().select(db.languages.ALL, cache=(cache.ram,3600)).sort(lambda a:
> a.full)]*
>
> --
> I:\Evolve\Work\web2py_src_downloaded\google_appengine\google\appengine\tools\dev
> _appserver.py:1798: DeprecationWarning: google.appengine.api.labs.taskqueue
> is d
> eprecated, please use google.appengine.api.taskqueue
>   description)
> ERROR    2010-12-23 19:24:43,640 restricted.py:151] Traceback (most recent
> call
> last):
>   File
> "I:\Evolve\Work\web2py_src_downloaded\google_appengine\visuallingua\gluon
> \restricted.py", line 188, in restricted
>     exec ccode in environment
>   File
> "I:\Evolve\Work\web2py_src_downloaded\google_appengine\visuallingua\appli
> cations\*init/controllers/default.py:index", line 5, in *
>   File
> "I:\Evolve\Work\web2py_src_downloaded\google_appengine\visuallingua\gluon
> \dal.py", line 4388, in select
>     return self.db._adapter.select(self.query,fields,attributes)
>   File
> "I:\Evolve\Work\web2py_src_downloaded\google_appengine\visuallingua\gluon
> \dal.py", line 2654, in select
>     (items, tablename, fields) = self.select_raw(query,fields,attributes)
>   File
> "I:\Evolve\Work\web2py_src_downloaded\google_appengine\visuallingua\gluon
> \dal.py", line 2611, in select_raw
>     tablename = self.get_table(query)
>   File
> "I:\Evolve\Work\web2py_src_downloaded\google_appengine\visuallingua\gluon
> \dal.py", line 894, in get_table
>     raise RuntimeError, "No table selected"
> RuntimeError: No table selected


[web2py] job

2010-12-23 Thread mdipierro
I found this:

http://www.i-freelancer.org/php/python-developerqa-odesk/


[web2py] Re: GAE shows problem.

2010-12-23 Thread mdipierro
The problem is that the query is missing.
Do you know if this worked in 1.89.x?

On Dec 23, 1:41 pm, "Arun K.Rajeevan"  wrote:
> see GAE error message. (it runs perfectly fine, if web2py run stand alone)
> And was running ok, till previos hour.
> What I can track is *init/controllers/default.py:index", line 5, in 
>
> *and that line is perfect (given below) and runs ok in web2py stand alone.
> *options = [OPTION(row.full + '  - ' + row.short, _value=row.id) for row in
> db().select(db.languages.ALL, cache=(cache.ram,3600)).sort(lambda a:
> a.full)]*
>
> --
> I:\Evolve\Work\web2py_src_downloaded\google_appengine\google\appengine\tools\dev
> _appserver.py:1798: DeprecationWarning: google.appengine.api.labs.taskqueue
> is d
> eprecated, please use google.appengine.api.taskqueue
>   description)
> ERROR    2010-12-23 19:24:43,640 restricted.py:151] Traceback (most recent
> call
> last):
>   File
> "I:\Evolve\Work\web2py_src_downloaded\google_appengine\visuallingua\gluon
> \restricted.py", line 188, in restricted
>     exec ccode in environment
>   File
> "I:\Evolve\Work\web2py_src_downloaded\google_appengine\visuallingua\appli
> cations\*init/controllers/default.py:index", line 5, in *
>   File
> "I:\Evolve\Work\web2py_src_downloaded\google_appengine\visuallingua\gluon
> \dal.py", line 4388, in select
>     return self.db._adapter.select(self.query,fields,attributes)
>   File
> "I:\Evolve\Work\web2py_src_downloaded\google_appengine\visuallingua\gluon
> \dal.py", line 2654, in select
>     (items, tablename, fields) = self.select_raw(query,fields,attributes)
>   File
> "I:\Evolve\Work\web2py_src_downloaded\google_appengine\visuallingua\gluon
> \dal.py", line 2611, in select_raw
>     tablename = self.get_table(query)
>   File
> "I:\Evolve\Work\web2py_src_downloaded\google_appengine\visuallingua\gluon
> \dal.py", line 894, in get_table
>     raise RuntimeError, "No table selected"
> RuntimeError: No table selected


Re: [web2py] Re: Merry Christmas

2010-12-23 Thread Luis Díaz
+1


2010/12/24 Albert Abril 

> Happy Holidays, happy winter solstice, and happy new year.
>
> No doubt we have a great community!
>
> Kind Regards!
>
> --
> Albert Abril,
> @desmondo
>
>


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

http://web2pyfacil.blogspot.com/
Facultad de 
Odontología


Re: [web2py] Re: ajax polling with web2py

2010-12-23 Thread Kuba Kucharski
hi,

that is a very good question. April, f.e:

http://www.mail-archive.com/web2py@googlegroups.com/msg34855.html


-- 
Kuba


[web2py] Re: Encountering problem with a computer field

2010-12-23 Thread mdipierro
For now I have a simple try except. I will see if that you suggest is
possible.

Massimo

On Dec 23, 11:33 am, Magnitus  wrote:
> I've thought about the dependencies problem a little bit.
>
> Maybe add some kind of hook so that the user can define the
> dependencies of the computed field himself.
>
> If he doesn't define them, the current behavior occurs.
>
> If he defines them, the behavior could be as follow:
>
> 1) All the dependencies are present in the input
>
> The field is updated from the input
>
> 2) Part of the dependencies are present in the input
>
> The current behavior occurs. Alternatively, try to read the missing
> dependencies from the DB (for an update) or from the default values
> (for an insert), but I'm not sure how complicated that would be.
>
> 3) None of the dependencies are present in the input
>
> The computed field is not updated.
>
> From the above, you'd get the best of all worlds.
>
> 1) User friendliness: The user doesn't have to define dependencies if
> he doesn't want to and he'd get the current behavior.
>
> 2) Flexibility: The user can define dependencies in which case the
> computed field doesn't restrict updates that don't include the
> dependencies on the field.
>
> 3) Correctness: Exceptions due to mistyping variables are not caught
> and properly raised.
>
> On Dec 23, 9:11 am, mdipierro  wrote:
>
> > Need to think about it.
>
> > On Dec 23, 3:51 am, cjrh  wrote:
>
> > > On Dec 23, 2:04 am, mdipierro  wrote:
>
> > > > I can add a try except so that web2py does not tries to compute fields
> > > > when there is not enough information. The downside is that a typo will
> > > > result in a silent failure to compute. Perhaps we should do this
> > > > anyway.
>
> > > If you're going to be doing work in the area of compute anyway, is
> > > there a posssibility of making another change that the current value
> > > of the compute-ed field can be passed to the compute method?- Hide quoted 
> > > text -
>
> > - Show quoted text -
>
>


[web2py] Re: Left Join with aliased table and the new DAL

2010-12-23 Thread mdipierro
I took a second look. The first problem is indeed fixed. The second
problem is not a new dal issue. It is just that aliased tables in
INNER JOINs never worked well. I will continue to look into it. This
may take a while so could you open a ticket on google code? Thanks.

On Dec 22, 2:52 am, HaM  wrote:
> Ok in order to simplify the problem I have changed my code to this:
> Domain = db.domain
> Client = db.client
> Manager = db.contact.with_alias('manager')
>
> sql = db((Domain.id==1)&(Client.id==Domain.client_id))._select(
>                 Domain.name, Client.name, Manager.name,
>                 left=[Manager.on(Manager.id==Client.manager_id)])
> print sql
>
> The result is:
> SELECT  domain.name, client.name, contact.name FROM domain, client,
> contact LEFT JOIN contact AS manager ON (contact.id =
> client.manager_id) WHERE ((domain.id = 1) AND (client.id =
> domain.client_id));
>
> And this request is not correct for PostgreSQL. I think that it should
> be :
> SELECT  domain.name, client.name, manager.name FROM domain, client
> LEFT JOIN contact as manager ON (manager.id = client.manager_id) WHERE
> ((domain.id = 1) AND (client.id = domain.client_id));
>
> Which works well.
>
> In order to push research further I also tried to do only INNER JOIN
> with an aliased table and it partially works:
> Domain = db.domain
> Client = db.client
> Manager = db.contact.with_alias('manager')
> sql = db((Domain.id==1)&
>         (Client.id==Domain.client_id)&
>         (Manager.id==Client.manager_id))._select(
>         Domain.name, Client.name, Manager.name)
> print sql
>
> Result:
> SELECT  domain.name, client.name, contact.name FROM domain, client,
> contact WHERE (((domain.id = 1) AND (client.id = domain.client_id))
> AND (contact.id = client.manager_id));
>
> It works but it doesn't use the alias name for the table contact. Thus
> the resulting dict() doesn't contains the key "manager" but the key
> "contact".
>
> Thank you for investigating this problem so quickly.
>
> On Dec 21, 10:57 pm, mdipierro  wrote:
>
> > hmm...
>
> > I am trying your select and it now generates the same sql as the old
> > dal. please try this:
>
> > Domain = db.domain
> > Client = db.client
> > Manager = db.contact.with_alias('manager')
> > sql = db(Domain.id==1)._select(
> >     Domain.ALL, Client.ALL,Manager.ALL,
> >     left=[Client.on(Client.id==Domain.client_id),
> >           Manager.on(Manager.id==Client.manager_id)])
> > print sql
>
> > what do you get?
> > I get
>
> > SELECT  domain.id, domain.name, domain.client_id, client.id,
> > client.name, client.manager_id, manager.id, manager.name FROM domain
> > LEFT JOIN client ON (client.id = domain.client_id) LEFT JOIN contact
> > AS manager ON (manager.id = client.manager_id) WHERE (domain.id = 1);
>
> > On Dec 21, 2:55 pm, HaM  wrote:
>
> > > I just tried with the last revision (1414:da25156addab) and the
> > > problem stills the same.
>
>


[web2py] Re: The stability of web2py releases

2010-12-23 Thread mdipierro
I think the issue can be solved by labeling releases and posting older
- more stable - releases.

This is what I do now:
- I always work on trunk - trunk is very unstable
- Once in a while when trunk is stable I post a "nightly build" which
is more like a release candidate. It does not change nightly, but more
likely weekly as more and more features are added.
- When I have no open issues AND I am happy about the nightly built, I
post it as stable.
- The first stable is usually 1.xx.1 - this is when problems usually
starts...
  1) one problem is occasionally build errors that may affect GAE,
Windows or Mac
  2) one problem may be bug in new features that were not very well
tested
  3) one problem may be that new feature break something that use to
work (thisis the thing I am mostly concerned about. It happens for
very obscure features that few users are using and hard to discover
until a major release) Anyway...
- the 1.xx.1 is followed by 1.xx.2 and 1.xx.3 and ... 1.xx.N during a
short period of time (within 48hrs). These are all bug fixed releases
and no new features are added. They usually fix 3) completely in
<48hrs. Usually is there is only open ticket remaining it is about a
new experimental feature OR a pre-existing issue.
- keep all previous 1.XX.N versions that had a relatively long life in
http://web2py.com/examples/static/1.XX.N/web2py_src.zip
- I delete the 1.XX.m with m wrote:
> Massimo, good news. Web2py is successfully being adopted by more and
> more developers who are using it for very serious purposes. It's going
> viral. Therefore, there need to be at most a few major releases a year
> and a bunch of incrementals in-between.
>
> I anticipated a challenging release with the latest DAL changes. At
> enterprises where I've worked in the past, changes to the db layer
> were always considered major releases. That's when the troops were
> mustered to test en-mass before pushing the product out the door.
>
> Web2py quality must always be of paramount importance. In the absence
> of a delegate, we look to you to lead this issue. It almost goes
> without saying that doing it right will ultimately have a larger
> impact on web2py's credibility than upgrading the documentation did.
> But, doing it wrong will have immediate disastrous consequences.


[web2py] Re: ajax polling with web2py

2010-12-23 Thread weheh
Let me try to state this more succinctly:

How do I get a jQuery, which is created by a controller in response to
an ajax call, to execute when loaded into it's target div?


Re: [web2py] Re: Merry Christmas

2010-12-23 Thread Albert Abril
Happy Holidays, happy winter solstice, and happy new year.

No doubt we have a great community!

Kind Regards!

-- 
Albert Abril,
@desmondo


[web2py] Re: ajax polling with web2py

2010-12-23 Thread weheh
Sorry, I'm sure I wasn't clear. The routine I posted does not work.
The parent div is properly updated, however the alert is not executed.
I want the alert to be executed without further action by the user.


On Dec 23, 7:02 pm, Michele Comitini 
wrote:
> I do not know what criteria you would use to understand if #parent is
> acceptable or not but you
> can pass as many other ids as you need:
>
> DIV(A('click me',_href='#',_id='parent',_onclick("ajax('clickback',
>  ['parent', '2nd', '3rd', ... 'nth'],':eval');")))
>
> #controller
> def clickback():
>  for t in args:
>    if kosher(t):
>      target = t
>  return 'jQuery("#" + target).html("%s");' %\
>     SCRIPT("alert('hello world');")
>
> 2010/12/24 weheh :
>
> > How would I do this?
> > #view
> > DIV(A('click me',_href='#',_id='parent',_onclick("ajax('clickback',
> > ['parent'],':eval');")))
>
> > #controller
> > def clickback():
> >  return 'jQuery("#parent").html("%s");' %\
> >     SCRIPT("alert('hello world');")
>
> > So that when I click on "click me" it calls the clickback, which
> > inserts the alert on top of the same parent. If overwriting one's
> > calling div isn't kosher, then I'm OK targeting a second div.
>
>


[web2py] Re: The stability of web2py releases

2010-12-23 Thread weheh
Massimo, good news. Web2py is successfully being adopted by more and
more developers who are using it for very serious purposes. It's going
viral. Therefore, there need to be at most a few major releases a year
and a bunch of incrementals in-between.

I anticipated a challenging release with the latest DAL changes. At
enterprises where I've worked in the past, changes to the db layer
were always considered major releases. That's when the troops were
mustered to test en-mass before pushing the product out the door.

Web2py quality must always be of paramount importance. In the absence
of a delegate, we look to you to lead this issue. It almost goes
without saying that doing it right will ultimately have a larger
impact on web2py's credibility than upgrading the documentation did.
But, doing it wrong will have immediate disastrous consequences.


Re: [web2py] ajax polling with web2py

2010-12-23 Thread Michele Comitini
I do not know what criteria you would use to understand if #parent is
acceptable or not but you
can pass as many other ids as you need:

DIV(A('click me',_href='#',_id='parent',_onclick("ajax('clickback',
 ['parent', '2nd', '3rd', ... 'nth'],':eval');")))


#controller
def clickback():
 for t in args:
   if kosher(t):
 target = t
 return 'jQuery("#" + target).html("%s");' %\
    SCRIPT("alert('hello world');")

2010/12/24 weheh :
> How would I do this?
> #view
> DIV(A('click me',_href='#',_id='parent',_onclick("ajax('clickback',
> ['parent'],':eval');")))
>
> #controller
> def clickback():
>  return 'jQuery("#parent").html("%s");' %\
>     SCRIPT("alert('hello world');")
>
> So that when I click on "click me" it calls the clickback, which
> inserts the alert on top of the same parent. If overwriting one's
> calling div isn't kosher, then I'm OK targeting a second div.


[web2py] Re: ajax polling with web2py

2010-12-23 Thread weheh
Continued ... oops, I hit "send" ...

of course, I want the alert to be triggered after writing "parent" div.


Re: [web2py] Re: Great summary of web2py

2010-12-23 Thread Michele Comitini
Maybe we should keep a comparison just on web2py.com.  Pay attention
to framework lists around and putting a sane description there.
It is useless and even counterproductive starting flame wars in
threaded discussions.  It is more importante that googlers find web2py
when
they search a good framework to work with.


2010/12/24 JmiXIII :
> Just to give a pleased newbie feed-back :
>
> _I'm newbie to web2py (well a couple of month)
> _I've never studied informatics nor did I have an informatic job
>
> BUT I needed something to handle database easely + human interface +
> network for my job
> I tried a crack access => beurk => begin to learn python
> I tried Zope/Plone => too heavy
> I tried Django => not enough efficient for what I wanted
>
> THEN
> I've seen some comparaison made by Massimo between Django and web2py
> 'do not remember the url)
> AND This is these comparisons which decided me to try web2py
> I'm very pleased because it is so efficient
>
> you are right VP , it's a waste of time to fuel the fire. But a short
> comparison would help newbies to make their choice and choose to try
> web2py. Yet I'm speaking of comparison showing the efficientness of
> web2py not long long debates/war.
>
>
>
> On 23 déc, 23:51, VP  wrote:
>> On Dec 23, 3:44 am, Branko Vukelić  wrote:
>>
>> > Or am I missing something?
>>
>> > In the summary, also no mention of Django or Flask.
>>
>> My comment is not just about that specific thread of discussion, but
>> about a general PR strategy of web2py.   My suggestion to Massimo
>> still stands.   Forget about Flask and Django !!!  Don't talk about
>> them at all.  None. Nothing.
>>
>> People who think that Django/Flask are superior to web2py, and/or
>> web2py is deeply flawed, aren't changing their minds.  There's no
>> point to debate, justify, etc.
>>
>> I do not see much benefit for web2py when Massimo discusses Django/
>> Flask.   On the other hand, the (serious) newbies will get lost in hot
>> exchanges between the web2py folks and the Django/Flask folks.
>> Occasionally, this dude Armin will come around the proclaim web2py to
>> be the worst thing there is.  And my suggestion to Massimo is that he
>> will have to live with that, and instead of spending energy to justify
>> him, turn that energy into making web2py to be a great platform.
>>
>> Specifically, to attract newbies, I would recommend making Chapter 3
>> of the book to be better than it currently is.   Right now, it's very
>> good.  But I think there are places that can be improved.  This
>> chapter is where web2py can be/should be showcased to attract the
>> newbies.   This comes from my experience when I first learned about
>> web2py.


[web2py] ajax polling with web2py

2010-12-23 Thread weheh
How would I do this?
#view
DIV(A('click me',_href='#',_id='parent',_onclick("ajax('clickback',
['parent'],':eval');")))

#controller
def clickback():
  return 'jQuery("#parent").html("%s");' %\
 SCRIPT("alert('hello world');")

So that when I click on "click me" it calls the clickback, which
inserts the alert on top of the same parent. If overwriting one's
calling div isn't kosher, then I'm OK targeting a second div.


[web2py] Re: Great summary of web2py

2010-12-23 Thread JmiXIII
Just to give a pleased newbie feed-back :

_I'm newbie to web2py (well a couple of month)
_I've never studied informatics nor did I have an informatic job

BUT I needed something to handle database easely + human interface +
network for my job
I tried a crack access => beurk => begin to learn python
I tried Zope/Plone => too heavy
I tried Django => not enough efficient for what I wanted

THEN
I've seen some comparaison made by Massimo between Django and web2py
'do not remember the url)
AND This is these comparisons which decided me to try web2py
I'm very pleased because it is so efficient

you are right VP , it's a waste of time to fuel the fire. But a short
comparison would help newbies to make their choice and choose to try
web2py. Yet I'm speaking of comparison showing the efficientness of
web2py not long long debates/war.



On 23 déc, 23:51, VP  wrote:
> On Dec 23, 3:44 am, Branko Vukelić  wrote:
>
> > Or am I missing something?
>
> > In the summary, also no mention of Django or Flask.
>
> My comment is not just about that specific thread of discussion, but
> about a general PR strategy of web2py.   My suggestion to Massimo
> still stands.   Forget about Flask and Django !!!  Don't talk about
> them at all.  None. Nothing.
>
> People who think that Django/Flask are superior to web2py, and/or
> web2py is deeply flawed, aren't changing their minds.  There's no
> point to debate, justify, etc.
>
> I do not see much benefit for web2py when Massimo discusses Django/
> Flask.   On the other hand, the (serious) newbies will get lost in hot
> exchanges between the web2py folks and the Django/Flask folks.
> Occasionally, this dude Armin will come around the proclaim web2py to
> be the worst thing there is.  And my suggestion to Massimo is that he
> will have to live with that, and instead of spending energy to justify
> him, turn that energy into making web2py to be a great platform.
>
> Specifically, to attract newbies, I would recommend making Chapter 3
> of the book to be better than it currently is.   Right now, it's very
> good.  But I think there are places that can be improved.  This
> chapter is where web2py can be/should be showcased to attract the
> newbies.   This comes from my experience when I first learned about
> web2py.


[web2py] Re: Great summary of web2py

2010-12-23 Thread mdipierro
Flask is nice and I am not complaining about it. Yet, if I needed
something small where web2py was too much overhead (and it can be I
guess), I would go with bottle.py+dal.py. The bottle source code is
beautiful and the routing mechanism seems similar to flask.

Massimo

On Dec 23, 5:12 pm, Branko Vukelić  wrote:
> 2010/12/23 VP :
>
> > People who think that Django/Flask are superior to web2py, and/or
> > web2py is deeply flawed, aren't changing their minds.  There's no
> > point to debate, justify, etc.
>
> True.
>
> 
>
> I've recently tested Flask briefly. I didn't like it's way of routing.
> But then I realized something (and Flask docs confirm that as well).
> Flask and web2py are not even in the same league. Flask was developed
> to handle small stuff, where having routing stuff dispersed around the
> code base is acceptable, because the codebase itself tends to be small
> in such projects. But that sucks for larger projects. In contrast,
> web2py is geared towards far more organized code, and therefore larger
> projects. At least to some extent. I'm not sure about globals, but I
> don't develop large projects myself, so it's fine for me.
>
> So I don't even understand how Flask can be compared to web2py at all.
> Two different things, with two different design goals.
>
> 
>
> --
> Branko Vukelic
>
> stu...@brankovukelic.comhttp://www.brankovukelic.com/


[web2py] executing code from db

2010-12-23 Thread mattynoce
hi all. i know this doesn't sound like a superb idea, but i may have
to do something like it.

i have data coming from the db and being displayed to the user as
instructions. "do this," "go there," etc.

i'd like to have that data executed in the environment, so i could say
"do this, {{=user.first_name}}." but when i say
{{=XML(instruction.step)}} it spits out the raw text but doesn't
execute it.

this only happens for db info that we put in, no user data. is there a
way to run it through the web2py interpreter before displaying it to
the user?

thanks, and happy holidays.

matt


Re: [web2py] Re: Great summary of web2py

2010-12-23 Thread Branko Vukelić
2010/12/23 VP :
> People who think that Django/Flask are superior to web2py, and/or
> web2py is deeply flawed, aren't changing their minds.  There's no
> point to debate, justify, etc.

True.



I've recently tested Flask briefly. I didn't like it's way of routing.
But then I realized something (and Flask docs confirm that as well).
Flask and web2py are not even in the same league. Flask was developed
to handle small stuff, where having routing stuff dispersed around the
code base is acceptable, because the codebase itself tends to be small
in such projects. But that sucks for larger projects. In contrast,
web2py is geared towards far more organized code, and therefore larger
projects. At least to some extent. I'm not sure about globals, but I
don't develop large projects myself, so it's fine for me.

So I don't even understand how Flask can be compared to web2py at all.
Two different things, with two different design goals.



-- 
Branko Vukelic

stu...@brankovukelic.com
http://www.brankovukelic.com/


Re: [web2py] Re: The stability of web2py releases

2010-12-23 Thread Thadeus Burgess
Good. Now this thread can go into the list of many archived threads about
this topic.

Nothing will happen and things will continue as they have been, which isn't
so bad because nobody is forcing you to upgrade your web2py version each
time a new release comes out.

However, Branko, part of the problem that nobody else can even perform basic
release management. Nobody but Massimo has access to trunk, and therefore
nobody but Massimo can make releases, create branches, maintain stable etc.
This leaves the project in a odd state that the only thing that can be done
is to complain.

Its free software, if you don't like it, fork it and manage it yourself.

--
Thadeus




2010/12/23 Branko Vukelić 

> On Thu, Dec 23, 2010 at 11:21 PM, Jonathan Lundell 
> wrote:
> > I suspect that we're talking at cross purposes.
>
> I have nothing more to say in this ridiculous thread.
>
> --
> Branko Vukelic
>
> stu...@brankovukelic.com
> http://www.brankovukelic.com/
>


[web2py] Re: Great summary of web2py

2010-12-23 Thread VP


On Dec 23, 3:44 am, Branko Vukelić  wrote:
> Or am I missing something?
>
> In the summary, also no mention of Django or Flask.
>

My comment is not just about that specific thread of discussion, but
about a general PR strategy of web2py.   My suggestion to Massimo
still stands.   Forget about Flask and Django !!!  Don't talk about
them at all.  None. Nothing.

People who think that Django/Flask are superior to web2py, and/or
web2py is deeply flawed, aren't changing their minds.  There's no
point to debate, justify, etc.

I do not see much benefit for web2py when Massimo discusses Django/
Flask.   On the other hand, the (serious) newbies will get lost in hot
exchanges between the web2py folks and the Django/Flask folks.
Occasionally, this dude Armin will come around the proclaim web2py to
be the worst thing there is.  And my suggestion to Massimo is that he
will have to live with that, and instead of spending energy to justify
him, turn that energy into making web2py to be a great platform.




Specifically, to attract newbies, I would recommend making Chapter 3
of the book to be better than it currently is.   Right now, it's very
good.  But I think there are places that can be improved.  This
chapter is where web2py can be/should be showcased to attract the
newbies.   This comes from my experience when I first learned about
web2py.






Re: [web2py] Re: The stability of web2py releases

2010-12-23 Thread Thadeus Burgess
Kinda of joking, but also kinda serious. It cost time and money to have to
test something just because a decision was made to upgrade the library (in
this case, web2py).

--
Thadeus




2010/12/23 Branko Vukelić 

> On Thu, Dec 23, 2010 at 10:29 PM, Thadeus Burgess 
> wrote:
> > Seriously: no.
> >
> > I have way to many new features to add to the site and too little time to
> > worry about testing each time I upgrade.
>
> I really hope you're just joking, and I'm just too stupid to get the
> funny part. :P
>
> --
> Branko Vukelic
>
> stu...@brankovukelic.com
> http://www.brankovukelic.com/
>


Re: [web2py] Re: Unable to detect your browser

2010-12-23 Thread Branko Vukelić
2010/12/23 greenpoise :
> brilliant!! THANKS SO MUCH!

You're welcome. It also helps if you build a virtual environment for
developing your apps. Keeps things clean.

First you get virtualenv package with:

$ easy_install-2.7 virtualenv

Then you just run this:

$ virtualenv --no-site-packages /path/to/my/env
$ cd /path/to/my/env
$ source bin/activate
(env) $ python

You'll notice that the interpreter version is now 2.7.x within the
env, and that '(env)' is printed before your prompt. As far as I know,
you cannot exit the environment other than by exiting the shell
altogether.

The environment is sealed off from your local Python install, so
anything that you install within your environment is available only
within the environment and if you use the ``--no-site-packages`` flag,
no packages installed in your local Python path will not be accessible
within the environment. Now, to develop with web2py within the
virtualenv, you just copy web2py dir into the virtualenv dir, and
that's it. Now you can run ``./web2py.py`` normally and web2py will
use the interpreter installed in the env.


-- 
Branko Vukelic

stu...@brankovukelic.com
http://www.brankovukelic.com/


Re: [web2py] Re: The stability of web2py releases

2010-12-23 Thread Branko Vukelić
On Thu, Dec 23, 2010 at 11:21 PM, Jonathan Lundell  wrote:
> I suspect that we're talking at cross purposes.

I have nothing more to say in this ridiculous thread.

-- 
Branko Vukelic

stu...@brankovukelic.com
http://www.brankovukelic.com/


[web2py] Re: Unable to detect your browser

2010-12-23 Thread greenpoise
brilliant!! THANKS SO MUCH!




On Dec 23, 1:33 pm, Branko Vukelić  wrote:
> On Thu, Dec 23, 2010 at 10:22 PM, greenpoise  wrote:
> > when I issue echo $BROWSER I get firefox. I have not used web2py in a
> > long time, since I have ArchLinux because of this problem. Is there a
> > way to change web2py as to where it does not launches any browser
> > I have no plans of changing my system distribution.
>
> Arch is defaulting to Py3k. Just run into this minutes ago. :D
>
> Try this:
>
> $ export PYTHON='/usr/bin/python2'; python2 ./web2py
>
> You can add an alias for this in your ~/.bashrc
>
> --
> Branko Vukelic
>
> stu...@brankovukelic.comhttp://www.brankovukelic.com/


Re: [web2py] Re: The stability of web2py releases

2010-12-23 Thread Jonathan Lundell
On Dec 23, 2010, at 2:17 PM, Branko Vukelić wrote:
> 
> You keep babbling about your selfish needs, not even considering that
> there are actual people who have THEIR OWN needs and yet make time to
> listen to you, and implement shit in record time. And again, it has to
> be said, that saves you your valuable time. Is that not enough for
> you? Doesn't that make you happy? Is that ENOUGH?

I suspect that we're talking at cross purposes.

Re: [web2py] Re: The stability of web2py releases

2010-12-23 Thread Branko Vukelić
On Thu, Dec 23, 2010 at 10:40 PM, pbreit  wrote:
> Part of the value of a framework is being able to count on its stability.
> For now, we can upgrade more slowly and pay attention to stability reports
> of new releases.

Yes, yes. Sit around and wait. For what reports again? Based on what
bug reports again? Everyone was sitting and waiting for Massimo to
actually label it as stable release. How wonderful. I'm sure that's
the BEST strategy to ensure web2py is bug free in future releases. Oh,
and what happens if Massimo's stable release turns out to be not that
stable after all? Well, this thread happens.

Last I've heard, Massimo was a single person. I don't know if he can
multiply like amoebae, but I'm sure it'd help if we all just dug into
release candidates or even trunk and _at least_ poked around. Even
better, why not deploy your latest awesome project on the new release
and give it a spin?

All in all, some of you guys are just... I dunno. Irrational. (Or
retarded, but I hope not.) You take far too many things for granted.
FAR too many things. And you fight any notion that doesn't match that
vision. So you don't see the beauty of free software, fine. But what's
this?! Even free as in beer isn't enough for you! You want it ALL. And
what IS the 'all'? Even you don't know. I'll tell you what you want.
You want open-source projects to submit to YOUR selfish and
self-centered vision. Instead of talking about contribution (of your
valuable time to the project that SAVES your valuable time), you
demand, and demand, and demand.

You keep babbling about your selfish needs, not even considering that
there are actual people who have THEIR OWN needs and yet make time to
listen to you, and implement shit in record time. And again, it has to
be said, that saves you your valuable time. Is that not enough for
you? Doesn't that make you happy? Is that ENOUGH?

Well, you know what. You should all be ashamed. You have absolutely NO
RIGHT to demand anything from Massimo or any other contributor. And
don't tell me about how you love web2py but you just wanted X or Y.
You OWE web2py X and Y, so if you want it, just do it yourself. YOU
label releases as stable, and YOU implement stuff. If Massimo does
that for you, it's a BIG FAT favor, and you should keep that in mind.

-- 
Branko Vukelic

stu...@brankovukelic.com
http://www.brankovukelic.com/


Re: [web2py] Re: The stability of web2py releases

2010-12-23 Thread pbreit
I think it's definitely a worthwhile goal to evolve the release schedule 
into stable and feature branches with bugs getting back-ported but suspect 
it will take some time to get there.

Part of the value of a framework is being able to count on its stability. 
For now, we can upgrade more slowly and pay attention to stability reports 
of new releases.


Re: [web2py] Re: Unable to detect your browser

2010-12-23 Thread Branko Vukelić
On Thu, Dec 23, 2010 at 10:22 PM, greenpoise  wrote:
> when I issue echo $BROWSER I get firefox. I have not used web2py in a
> long time, since I have ArchLinux because of this problem. Is there a
> way to change web2py as to where it does not launches any browser
> I have no plans of changing my system distribution.

Arch is defaulting to Py3k. Just run into this minutes ago. :D

Try this:

$ export PYTHON='/usr/bin/python2'; python2 ./web2py

You can add an alias for this in your ~/.bashrc


-- 
Branko Vukelic

stu...@brankovukelic.com
http://www.brankovukelic.com/


Re: [web2py] Re: The stability of web2py releases

2010-12-23 Thread Branko Vukelić
On Thu, Dec 23, 2010 at 10:29 PM, Thadeus Burgess  wrote:
> Seriously: no.
>
> I have way to many new features to add to the site and too little time to
> worry about testing each time I upgrade.

I really hope you're just joking, and I'm just too stupid to get the
funny part. :P

-- 
Branko Vukelic

stu...@brankovukelic.com
http://www.brankovukelic.com/


Re: [web2py] Re: The stability of web2py releases

2010-12-23 Thread Thadeus Burgess
Seriously: no.

I have way to many new features to add to the site and too little time to
worry about testing each time I upgrade.

--
Thadeus




On Thu, Dec 23, 2010 at 3:16 PM, Jonathan Lundell wrote:

> On Dec 23, 2010, at 1:11 PM, Branko Vukelić wrote:
> >
> > On Thu, Dec 23, 2010 at 6:19 PM, Jonathan Lundell 
> wrote:
> >> Seriously: no.
> >
> > Seriously: yes. Why? Because it's YOUR work that is going to suffer if
> > you don't. Why WOULDN'T you test something you are going to deploy?
> > I've just tested dozen frameworks and even PHP before starting a
> > project, and I'm a hobbyist. Are you telling me professional
> > developers aren't expected to make an informed choice about their
> > platform? If that's the case, "professional developers" are people I
> > would NEVER trust to do their job right.
>
> Because I'm not deploying it (the current version, that is).
>
> For the same reason we don't tell users that they *must* use Python 2.7.1,
> and re-test their 2.4-based code for compatibility: it works.
>
> Not me personally; I use the latest versions of stuff, pretty much. But I
> understand the reason for not wanting to, or at least not wanting to have
> to.
>
> >
> >> That is, if I'm using a release from six months ago, and all I need is a
> point fix,
> >
> > Then you can dig around the commits and make yourself a patch. At
> > least that's what I'd do.
>
> It's what I'd do too. But it makes web2py less friendly than it could be.


[web2py] Re: Unable to detect your browser

2010-12-23 Thread greenpoise
Funny cuz when I try this: webbrowser.get()  I get 'webbrowser' is not
defined


agh





On Dec 23, 1:22 pm, greenpoise  wrote:
> when I issue echo $BROWSER I get firefox. I have not used web2py in a
> long time, since I have ArchLinux because of this problem. Is there a
> way to change web2py as to where it does not launches any browser
> I have no plans of changing my system distribution.
>
> THanks
>
> dan
>
> On Dec 18, 9:57 pm, sushanth  wrote:
>
>
>
> > On ubuntu you can change your defualt browser with below steps
>
> > susha...@ubuntu:~$ sudo update-alternatives --config x-www-browser
> > [sudo] password for sushanth:
> > There are 2 choices for the alternative x-www-browser (providing
> > /usr/bin/x-www-browser).
>
> >   Selection    Path                    Priority   Status
> > 
> > * 0            /usr/bin/google-chrome   150       auto mode
> >   1            /usr/bin/firefox         40        manual mode
> >   2            /usr/bin/google-chrome   150       manual mode
>
> > Press enter to keep the current choice[*], or type selection number:


Re: [web2py] Url variable's problem

2010-12-23 Thread Jonathan Lundell
On Dec 23, 2010, at 12:32 PM, Arun K.Rajeevan wrote:
> Exactly,
> That's what confuses me.

I have a theory. Or at least a conjecture.

Try looking request.env.query_string. My guess is that, in the case where 
you're seeing a list, indx is showing up twice in the query string from your 
form. When that happens, web2py puts the values into a list. That's recent (but 
correct) behavior on web2py's part, though it's not handling the URL() case 
correctly yet.



[web2py] Re: Unable to detect your browser

2010-12-23 Thread greenpoise
when I issue echo $BROWSER I get firefox. I have not used web2py in a
long time, since I have ArchLinux because of this problem. Is there a
way to change web2py as to where it does not launches any browser
I have no plans of changing my system distribution.


THanks


dan




On Dec 18, 9:57 pm, sushanth  wrote:
> On ubuntu you can change your defualt browser with below steps
>
> susha...@ubuntu:~$ sudo update-alternatives --config x-www-browser
> [sudo] password for sushanth:
> There are 2 choices for the alternative x-www-browser (providing
> /usr/bin/x-www-browser).
>
>   Selection    Path                    Priority   Status
> 
> * 0            /usr/bin/google-chrome   150       auto mode
>   1            /usr/bin/firefox         40        manual mode
>   2            /usr/bin/google-chrome   150       manual mode
>
> Press enter to keep the current choice[*], or type selection number:


Re: [web2py] Re: The stability of web2py releases

2010-12-23 Thread Jonathan Lundell
On Dec 23, 2010, at 1:11 PM, Branko Vukelić wrote:
> 
> On Thu, Dec 23, 2010 at 6:19 PM, Jonathan Lundell  wrote:
>> Seriously: no.
> 
> Seriously: yes. Why? Because it's YOUR work that is going to suffer if
> you don't. Why WOULDN'T you test something you are going to deploy?
> I've just tested dozen frameworks and even PHP before starting a
> project, and I'm a hobbyist. Are you telling me professional
> developers aren't expected to make an informed choice about their
> platform? If that's the case, "professional developers" are people I
> would NEVER trust to do their job right.

Because I'm not deploying it (the current version, that is). 

For the same reason we don't tell users that they *must* use Python 2.7.1, and 
re-test their 2.4-based code for compatibility: it works.

Not me personally; I use the latest versions of stuff, pretty much. But I 
understand the reason for not wanting to, or at least not wanting to have to.

> 
>> That is, if I'm using a release from six months ago, and all I need is a 
>> point fix,
> 
> Then you can dig around the commits and make yourself a patch. At
> least that's what I'd do.

It's what I'd do too. But it makes web2py less friendly than it could be.

Re: [web2py] Re: The stability of web2py releases

2010-12-23 Thread Branko Vukelić
On Thu, Dec 23, 2010 at 6:19 PM, Jonathan Lundell  wrote:
> Seriously: no.

Seriously: yes. Why? Because it's YOUR work that is going to suffer if
you don't. Why WOULDN'T you test something you are going to deploy?
I've just tested dozen frameworks and even PHP before starting a
project, and I'm a hobbyist. Are you telling me professional
developers aren't expected to make an informed choice about their
platform? If that's the case, "professional developers" are people I
would NEVER trust to do their job right.

> That is, if I'm using a release from six months ago, and all I need is a 
> point fix,

Then you can dig around the commits and make yourself a patch. At
least that's what I'd do.


-- 
Branko Vukelic

stu...@brankovukelic.com
http://www.brankovukelic.com/


[web2py] Re: App admin error

2010-12-23 Thread pbreit
Can you look at the db.pictures.word field using a SQLite browser to see if 
there's any corruption or the wrong type?

Re: [web2py] Re: Merry Christmas

2010-12-23 Thread Arun K.Rajeevan
Merry Christmas and Happy new Year for every single one in this community 
:-)


[web2py] Re: App admin error

2010-12-23 Thread Arun K.Rajeevan
Nope, 
I tried again, by removing all files in database directory and started 
again.
Problem is still there.
If table is empty, it renders form.
But, as soon as there's items in table, it'll cease to render anymore.

BTW., I'm not using this table as a single form, so it's not effecting me 
now. But I want it resolved. Who knows, someday I've to use this.

On Thursday, December 23, 2010 11:35:39 PM UTC+5:30, Arun K.Rajeevan wrote:
>
> Thank you for reply.
> I thought it's the case.
>
> But as far as I can remember, I removed database folder earlier and started 
> again.
> Anyway, I'll try again and see, if that's the problem.
>


Re: [web2py] Url variable's problem

2010-12-23 Thread Arun K.Rajeevan
Exactly,
That's what confuses me.


Re: [web2py] Url variable's problem

2010-12-23 Thread Jonathan Lundell
It's not a list in your logic, but somewhere it's getting turned into a list. 

On Dec 23, 2010, at 11:37 AM, "Arun K.Rajeevan"  wrote:

> It's not a list.
> Complete logic is given in the first post, where this index is forming.
> Hidden field's value is set when select box changes.
> and is retrieved in form.accepts() 
> that's all.
> 
> Each time, I select an item hidden field's value changes. (I tried with 
> firebug console.)
> And why this is happening? 
> I'm not getting any clue.


Re: [web2py] Re: Merry Christmas

2010-12-23 Thread Michele Comitini
Other web frameworks can compare with web2py, but no other  has such a
nice supporting community!

Buon Natale, Merry Christmas!


2010/12/23 Pepe Araya :
> Hey!
> Merry Christmas!!
> good vibes for all!


[web2py] Re: Merry Christmas

2010-12-23 Thread Niphlod
+1

On Dec 23, 8:51 pm, Pepe Araya  wrote:
> Hey!
>
> Merry Christmas!!
>
> good vibes for all!


[web2py] Re: Merry Christmas

2010-12-23 Thread Pepe Araya
Hey!

Merry Christmas!!

good vibes for all!


Re: [web2py] Url variable's problem

2010-12-23 Thread Arun K.Rajeevan
Currently , I get selected value, through form.accepts or request.vars.
I need to keep values in form unaltered. and this is the only way.

*That said, If I can get equivalent of selectedIndex in JS in server side, I 
can live without this problem( as of now).*

*But, I'm curious to know, why this is happening.*


[web2py] GAE shows problem.

2010-12-23 Thread Arun K.Rajeevan
see GAE error message. (it runs perfectly fine, if web2py run stand alone)
And was running ok, till previos hour.
What I can track is *init/controllers/default.py:index", line 5, in  

*and that line is perfect (given below) and runs ok in web2py stand alone.
*options = [OPTION(row.full + '  - ' + row.short, _value=row.id) for row in 
db().select(db.languages.ALL, cache=(cache.ram,3600)).sort(lambda a: 
a.full)]*

--
I:\Evolve\Work\web2py_src_downloaded\google_appengine\google\appengine\tools\dev
_appserver.py:1798: DeprecationWarning: google.appengine.api.labs.taskqueue 
is d
eprecated, please use google.appengine.api.taskqueue
  description)
ERROR2010-12-23 19:24:43,640 restricted.py:151] Traceback (most recent 
call
last):
  File 
"I:\Evolve\Work\web2py_src_downloaded\google_appengine\visuallingua\gluon
\restricted.py", line 188, in restricted
exec ccode in environment
  File 
"I:\Evolve\Work\web2py_src_downloaded\google_appengine\visuallingua\appli
cations\*init/controllers/default.py:index", line 5, in *
  File 
"I:\Evolve\Work\web2py_src_downloaded\google_appengine\visuallingua\gluon
\dal.py", line 4388, in select
return self.db._adapter.select(self.query,fields,attributes)
  File 
"I:\Evolve\Work\web2py_src_downloaded\google_appengine\visuallingua\gluon
\dal.py", line 2654, in select
(items, tablename, fields) = self.select_raw(query,fields,attributes)
  File 
"I:\Evolve\Work\web2py_src_downloaded\google_appengine\visuallingua\gluon
\dal.py", line 2611, in select_raw
tablename = self.get_table(query)
  File 
"I:\Evolve\Work\web2py_src_downloaded\google_appengine\visuallingua\gluon
\dal.py", line 894, in get_table
raise RuntimeError, "No table selected"
RuntimeError: No table selected


Re: [web2py] Url variable's problem

2010-12-23 Thread Arun K.Rajeevan
It's not a list.
Complete logic is given in the first post, where this index is forming.
Hidden field's value is set when select box changes.
and is retrieved in form.accepts() 
that's all.

Each time, I select an item hidden field's value changes. (I tried with 
firebug console.)
And why this is happening? 
I'm not getting any clue.


Re: [web2py] Url variable's problem

2010-12-23 Thread Jonathan Lundell
On Dec 23, 2010, at 10:15 AM, Arun K.Rajeevan wrote:
> See following code, 
> I expect it to redirect to a url 
> 1) if user don't touch dropdown: 
> http://127.0.0.1:8000/init/default/search//?indx=0
>but it shows http://127.0.0.1:8000/init/default/search//. Why 
> no vars?
> 2) if user altered dropdown: 
> http://127.0.0.1:8000/init/default/search//?indx=5
>  it's ok for first time. But if user select another item from select box 
> ?indx=['10'%2C+'5'] 
>  and if select another one ?indx=['19'%2C+"['10'%2C+'5']"]

Massimo:

Perhaps you can explain why indx is becoming a nested list, but setting that 
aside, if it *is* a list, I think the query string should be something like:

?indx=19&index=10&indx=5

That would require some additional logic in URL() for vars.

> 
> Where did I went wrong?
> 
> In controller, before all functions, I've following,
> 
> options = [OPTION(row.full + '  - ' + row.short, _value=row.id) 
> for row in db().select(db.languages.ALL, 
> cache=(cache.ram,3600)).sort(lambda a: a.full)]
> options.insert(0, OPTION('All Langauges', _value=0))
> search_form = FORM(LABEL('Search a word: ', _for='word', _id='word_label', 
> _name='word_label'),
> INPUT(_id='word', _name='word', requires=IS_NOT_EMPTY()), 
> SELECT(_onblur="var f = document.search_form; 
> f.indx.value = this.selectedIndex;", 
> _name='languages', _id='languages', 
> requires=IS_IN_DB(db,'languages.id'), *options),
> INPUT(_type='hidden', _name='indx', _id='indx', 
> value='0'),
> INPUT(_type="submit",_value="SEARCH"),
>  _name='search_form')
> 
> # form verficaion logic on submission
> if search_form.accepts(request.vars, formname='search_form', hideerror=True):
> lang = search_form.vars.languages
> word = search_form.vars.word
> indx = dict(indx = search_form.vars.indx)
> redirect(URL(r=request, f='search', args=[lang, word], vars=indx))
> elif search_form.errors: #adding an element in option out of the db braked 
> prev mechanism. (ie., showing a flash. now that's done by show() itself.
> lang = search_form.vars.languages
> word = search_form.vars.word
> redirect(URL(r=request, f='search', args=[lang, word]))
> else:
> #page loads first time
> pass
> 
> 




[web2py] Url variable's problem

2010-12-23 Thread Arun K.Rajeevan
See following code, 
I expect it to redirect to a url 
1) if user don't touch dropdown: 
http://127.0.0.1:8000/init/default/search//?indx=0
   but it shows http://127.0.0.1:8000/init/default/search//. *Why 
no vars?*
2) if user altered dropdown: 
http://127.0.0.1:8000/init/default/search//*?indx=5*
 it's ok for first time. But if user select another item from select box 
*?indx=['10'%2C+'5'] 
*
 and if select another one *?indx=['19'%2C+"['10'%2C+'5']"]

Where did I went wrong?
*

In controller, before all functions, I've following,

options = [OPTION(row.full + '  - ' + row.short, _value=row.id) 
for row in db().select(db.languages.ALL, 
cache=(cache.ram,3600)).sort(lambda a: a.full)]
options.insert(0, OPTION('All Langauges', _value=0))
search_form = FORM(LABEL('Search a word: ', _for='word', _id='word_label', 
_name='word_label'),
INPUT(_id='word', _name='word', 
requires=IS_NOT_EMPTY()), 
SELECT(_onblur="var f = document.search_form; 
f.indx.value = this.selectedIndex;", 
_name='languages', _id='languages', 
requires=IS_IN_DB(db,'languages.id'), *options),
INPUT(_type='hidden', _name='indx', _id='indx', 
value='0'),
INPUT(_type="submit",_value="SEARCH"),
 _name='search_form')

# form verficaion logic on submission
if search_form.accepts(request.vars, formname='search_form', 
hideerror=True):
lang = search_form.vars.languages
word = search_form.vars.word
indx = dict(indx = search_form.vars.indx)
redirect(URL(r=request, f='search', args=[lang, word], vars=indx))
elif search_form.errors: #adding an element in option out of the db braked 
prev mechanism. (ie., showing a flash. now that's done by show() itself.
lang = search_form.vars.languages
word = search_form.vars.word
redirect(URL(r=request, f='search', args=[lang, word]))
else:
#page loads first time
pass




[web2py] Re: App admin error

2010-12-23 Thread Arun K.Rajeevan
Thank you for reply.
I thought it's the case.

But as far as I can remember, I removed database folder earlier and started 
again.
Anyway, I'll try again and see, if that's the problem.


[web2py] Re: Possible bug in URL

2010-12-23 Thread mr.freeze
Thanks for confirming. I will send Massimo a patch.

On Dec 23, 11:56 am, Jonathan Lundell  wrote:
> On Dec 23, 2010, at 9:29 AM, Jonathan Lundell wrote:
>
>
>
>
>
>
>
>
>
>
>
> > On Dec 23, 2010, at 9:09 AM, mr.freeze wrote:
>
> >> Given this url:
> >> URL(args=1,vars=dict(v='yes'),anchor='end')
> >> It produces:
> >>http://server/app/default/index/1#end?v=yes
> >> Problem:
> >> request.vars is empty
>
> >> This url:
> >>http://server/app/default/index/1?v=yes#end
> >> request.vars is populated and the anchor works
>
> >> Shouldn't the anchor be at the end of the query string? I'm running
> >> the latest trunk.
>
> > Yes; that's an error, per RFC 3986.
>
> >      URI         = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
>
> > Not only that, but '?' is legal in a fragment identifier, as is '=', so in 
> > your first example, "end?v=yes" is itself the entire (legal) anchor.
>
> > I wouldn't be terribly surprised if some browsers treated this 
> > inconsistently, but we should be adhering to the RFC here.
>
> > The fix looks easy; change:
>
> >    if anchor:
> >        other += '#' + urllib.quote(str(anchor))
> >    if vars:
> >        other += '?%s' % m_vars
>
> > to:
>
> >    if vars:
> >        other += '?%s' % m_vars
> >    if anchor:
> >        other += '#' + urllib.quote(str(anchor))
>
> > ...and fix the doctest. Though I'm not sure that urllib.quote is right for 
> > an anchor.
>
> Following up: as I read the RFC, the quoting doesn't hurt.


Re: [web2py] Possible bug in URL

2010-12-23 Thread Jonathan Lundell
On Dec 23, 2010, at 9:29 AM, Jonathan Lundell wrote:
> 
> On Dec 23, 2010, at 9:09 AM, mr.freeze wrote:
>> 
>> Given this url:
>> URL(args=1,vars=dict(v='yes'),anchor='end')
>> It produces:
>> http://server/app/default/index/1#end?v=yes
>> Problem:
>> request.vars is empty
>> 
>> This url:
>> http://server/app/default/index/1?v=yes#end
>> request.vars is populated and the anchor works
>> 
>> Shouldn't the anchor be at the end of the query string? I'm running
>> the latest trunk.
> 
> Yes; that's an error, per RFC 3986.
> 
>  URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
> 
> 
> Not only that, but '?' is legal in a fragment identifier, as is '=', so in 
> your first example, "end?v=yes" is itself the entire (legal) anchor.
> 
> I wouldn't be terribly surprised if some browsers treated this 
> inconsistently, but we should be adhering to the RFC here.
> 
> The fix looks easy; change:
> 
>if anchor:
>other += '#' + urllib.quote(str(anchor))
>if vars:
>other += '?%s' % m_vars
> 
> to:
> 
>if vars:
>other += '?%s' % m_vars
>if anchor:
>other += '#' + urllib.quote(str(anchor))
> 
> ...and fix the doctest. Though I'm not sure that urllib.quote is right for an 
> anchor.

Following up: as I read the RFC, the quoting doesn't hurt.

[web2py] Re: Cache stored at request, does not sync with other threads until new request

2010-12-23 Thread Dragonfyre13
Nevermind, I wasn't clearing the cache in one place, so cache simply
didn't get updated with the right value when it needed to.

On Dec 23, 9:27 am, Dragonfyre13  wrote:
> So I've gone back and forth on this again and again. It looks like
> cache.ram being process bound (so even though I only have one web2py
> instance, it's running across multiple wsgi processes?) was the
> problem. The issue is, I'm having similar issues (in a very different
> location) using cache.disk. I though maybe it might be better to use
> memcache instead, but I get a keyerror when trying to use memcache to
> cache the DAL, since my key regularly exceeds 250 chars (relatively
> small query, but lists every field it looks like)
>
> On Dec 21, 5:54 pm, Tim Alexander  wrote:
>
> > It occurs to me, I'm using uwsgi. I'm assuming cache.ram is per process,
> > meaning that if my Ajax side and xmlrpc side are not on the same process,
> > this will completely not work properly. I'll try flipping over to cache.disk
> > tomorrow morning to verify.
> > On Dec 21, 2010 5:20 PM, "Dragonfyre13"  wrote:
>
> > > At least I think the subject seems to define the behavior.
>
> > > I have a function that exposes as an XMLRPC service. It puts something
> > > in a DB, and then polls to see if there is a response to it from
> > > another system talking to that same DB. (yes I realize that polling a
> > > DB is a "bad thing" but necessary for various reasons in this case)
>
> > > The difficulty is, there's an xmlrpc side, and an ajax side. The ajax
> > > side is a longpoll (simulated server side push) with a loop like this:
>
> > > while endtime > datetime.datetime.now():
> > > # This keeps finding a cached value, even when it's cleared
> > > by
> > > # another request.
> > > #for k in cache.ram.storage.keys():
> > > #logging.debug(k,v)
> > > #if k.find("next_action.ccid=" + str(ccid)) != -1:
> > > # logging.debug(str(ccid) + "found cached value")
> > > actionrow = localdb(localdb.next_action.ccid == ccid).select(
> > > cache=(cache.ram,600)).first()
> > > if actionrow and len(actionrow) and actionrow.action_str !=
> > > None and \
> > > actionrow.return_str == None:
> > > return dict(action_xml=actionrow.action_str,
> > > ccid=ccid)
> > > time.sleep(.5)
>
> > > The XMLRPC side is much the same. ccid is a unique key for the
> > > "conversation" for both of them to use. The action string is where the
> > > XMLRPC side pushes information, and return_str is data that is handed
> > > back after the ajax longpoll fulfills the action string's needs.
>
> > > My problem in all of this is the comments above. Even though when I do
> > > an update on the XMLRPC side, I clear cache for this select statement
> > > (via setting timeout to 0 for that select statement in cache) it still
> > > maintains the value pulled from cache in the ajax request above. So I
> > > don't pull out the actual value in the DB until cache expires in this
> > > function, even though I've cleared the cache via setting timeout to 0
> > > in the other function:
> > > localdb(localdb.next_action.ccid == ccid).select(cache=(cache.ram, 0))
>
> > > Any ideas? For now, I really don't know what I'm looking at for an
> > > issue or resolution, but even a "yep, makes a copy when your request
> > > object is created" would work if someone knows. Or "you're an idiot,
> > > do it like this" would be even better!


[web2py] Re: Encountering problem with a computer field

2010-12-23 Thread Magnitus
I've thought about the dependencies problem a little bit.

Maybe add some kind of hook so that the user can define the
dependencies of the computed field himself.

If he doesn't define them, the current behavior occurs.

If he defines them, the behavior could be as follow:

1) All the dependencies are present in the input

The field is updated from the input

2) Part of the dependencies are present in the input

The current behavior occurs. Alternatively, try to read the missing
dependencies from the DB (for an update) or from the default values
(for an insert), but I'm not sure how complicated that would be.

3) None of the dependencies are present in the input

The computed field is not updated.

>From the above, you'd get the best of all worlds.

1) User friendliness: The user doesn't have to define dependencies if
he doesn't want to and he'd get the current behavior.

2) Flexibility: The user can define dependencies in which case the
computed field doesn't restrict updates that don't include the
dependencies on the field.

3) Correctness: Exceptions due to mistyping variables are not caught
and properly raised.

On Dec 23, 9:11 am, mdipierro  wrote:
> Need to think about it.
>
> On Dec 23, 3:51 am, cjrh  wrote:
>
>
>
> > On Dec 23, 2:04 am, mdipierro  wrote:
>
> > > I can add a try except so that web2py does not tries to compute fields
> > > when there is not enough information. The downside is that a typo will
> > > result in a silent failure to compute. Perhaps we should do this
> > > anyway.
>
> > If you're going to be doing work in the area of compute anyway, is
> > there a posssibility of making another change that the current value
> > of the compute-ed field can be passed to the compute method?- Hide quoted 
> > text -
>
> - Show quoted text -


Re: [web2py] Possible bug in URL

2010-12-23 Thread Jonathan Lundell
On Dec 23, 2010, at 9:09 AM, mr.freeze wrote:
> 
> Given this url:
> URL(args=1,vars=dict(v='yes'),anchor='end')
> It produces:
> http://server/app/default/index/1#end?v=yes
> Problem:
> request.vars is empty
> 
> This url:
> http://server/app/default/index/1?v=yes#end
> request.vars is populated and the anchor works
> 
> Shouldn't the anchor be at the end of the query string? I'm running
> the latest trunk.

Yes; that's an error, per RFC 3986.

  URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]


Not only that, but '?' is legal in a fragment identifier, as is '=', so in your 
first example, "end?v=yes" is itself the entire (legal) anchor.

I wouldn't be terribly surprised if some browsers treated this inconsistently, 
but we should be adhering to the RFC here.

The fix looks easy; change:

if anchor:
other += '#' + urllib.quote(str(anchor))
if vars:
other += '?%s' % m_vars

to:

if vars:
other += '?%s' % m_vars
if anchor:
other += '#' + urllib.quote(str(anchor))

...and fix the doctest. Though I'm not sure that urllib.quote is right for an 
anchor.

Re: [web2py] Re: The stability of web2py releases

2010-12-23 Thread Jonathan Lundell
On Dec 23, 2010, at 8:58 AM, Branko Vukelić wrote:
> 
> On Thu, Dec 23, 2010 at 5:37 PM, Jonathan Lundell  wrote:
>> On Dec 23, 2010, at 1:04 AM, cjrh wrote:
>>> 
>>> On Dec 22, 6:05 pm, Thadeus Burgess  wrote:
 What I do is if my app works with a certain version, I don't ever upgrade
 the web2py unless I need a brand new feature or bugfix that effects me.
>>> 
>>> +1.  If you don't need anything new, no point in upgrading.
>> 
>> The problem is that if you *do* need a bugfix, you ordinarily can't get it 
>> without adopting all the changes since the version you're currently using 
>> (unless you do your own patching).
> 
> That's another reason why you want to help test the 'release
> candidate', right? :)

Seriously: no.

That is, if I'm using a release from six months ago, and all I need is a point 
fix, there's no reason for me to spend any time testing new release candidates. 
The bulk of web2py users, presumably, are not focused on web2py development; 
they're simply using web2py as a (very effective) tool to get their real work 
done. And there's nothing wrong with that.

[web2py] Possible bug in URL

2010-12-23 Thread mr.freeze
Given this url:
URL(args=1,vars=dict(v='yes'),anchor='end')
It produces:
http://server/app/default/index/1#end?v=yes
Problem:
request.vars is empty

This url:
http://server/app/default/index/1?v=yes#end
request.vars is populated and the anchor works

Shouldn't the anchor be at the end of the query string? I'm running
the latest trunk.


Re: [web2py] Re: The stability of web2py releases

2010-12-23 Thread Branko Vukelić
On Thu, Dec 23, 2010 at 5:37 PM, Jonathan Lundell  wrote:
> On Dec 23, 2010, at 1:04 AM, cjrh wrote:
>>
>> On Dec 22, 6:05 pm, Thadeus Burgess  wrote:
>>> What I do is if my app works with a certain version, I don't ever upgrade
>>> the web2py unless I need a brand new feature or bugfix that effects me.
>>
>> +1.  If you don't need anything new, no point in upgrading.
>
> The problem is that if you *do* need a bugfix, you ordinarily can't get it 
> without adopting all the changes since the version you're currently using 
> (unless you do your own patching).

That's another reason why you want to help test the 'release
candidate', right? :)

-- 
Branko Vukelic

stu...@brankovukelic.com
http://www.brankovukelic.com/


Re: [web2py] Re: translation dict name

2010-12-23 Thread Richard Vézina
Bingo!

Richard

On Thu, Dec 23, 2010 at 11:37 AM, Richard Vézina <
ml.richard.vez...@gmail.com> wrote:

> Ok, everything seems to be in languages.py...
>
> I didn't noticed at first read that the code I was seeking for was there...
>
> I will see if I get what I want... [?]
>
> Richard
>
>
> On Thu, Dec 23, 2010 at 11:31 AM, Richard Vézina <
> ml.richard.vez...@gmail.com> wrote:
>
>> Find it!
>>
>> My only remaning problem is the # coding: utf8 at the top of translation
>> file... I don't see how dal.py manage it... I could made a readline and
>> remove it in a other instance of the open file or something like that, but
>> should have a simpler way to manage it.
>>
>> Richard
>>
>>
>> On Thu, Dec 23, 2010 at 11:06 AM, ron_m  wrote:
>>
>>> web2py uses portalocker.py look under gluon. There are many examples of
>>> use such as locking the session file in globals.py
>>>
>>>
>>
>
<<32F.gif>>

[web2py] web2py_utils bug

2010-12-23 Thread Francisco Feijoo
Hello everybody,

this is my first post in the group. THANKS for this great web
framework.

I want to include tests in my project. Searching I found web2py_utils
(web2py_utils-0.0.13dev) and test_runner as the best tool for web2py
and unit test.

Running the tests I have this error:

File "/usr/lib/python2.4/site-packages/web2py_utils-0.0.13dev-
py2.4.egg/web2py_utils/test_runner.py", line 193
test_db.define_table(tablename, *table_copy, migrate=True)
   ^
SyntaxError: invalid syntax


I have replaced the line with:
 test_db.define_table(tablename, migrate=True, *table_copy)


Is web2py_utils a good tool for testing web2py applications? Is
someone resposible for utils project to update the code?

Cheers


Re: [web2py] Re: The stability of web2py releases

2010-12-23 Thread Jonathan Lundell
On Dec 23, 2010, at 1:04 AM, cjrh wrote:
> 
> On Dec 22, 6:05 pm, Thadeus Burgess  wrote:
>> What I do is if my app works with a certain version, I don't ever upgrade
>> the web2py unless I need a brand new feature or bugfix that effects me.
> 
> +1.  If you don't need anything new, no point in upgrading.

The problem is that if you *do* need a bugfix, you ordinarily can't get it 
without adopting all the changes since the version you're currently using 
(unless you do your own patching).

Re: [web2py] Re: translation dict name

2010-12-23 Thread Richard Vézina
Ok, everything seems to be in languages.py...

I didn't noticed at first read that the code I was seeking for was there...

I will see if I get what I want... [?]

Richard

On Thu, Dec 23, 2010 at 11:31 AM, Richard Vézina <
ml.richard.vez...@gmail.com> wrote:

> Find it!
>
> My only remaning problem is the # coding: utf8 at the top of translation
> file... I don't see how dal.py manage it... I could made a readline and
> remove it in a other instance of the open file or something like that, but
> should have a simpler way to manage it.
>
> Richard
>
>
> On Thu, Dec 23, 2010 at 11:06 AM, ron_m  wrote:
>
>> web2py uses portalocker.py look under gluon. There are many examples of
>> use such as locking the session file in globals.py
>>
>>
>
<<32F.gif>>

Re: [web2py] Re: form.accepts = False. How to find out why

2010-12-23 Thread Jonathan Lundell
On Dec 23, 2010, at 6:42 AM, DenesL wrote:
> 
> 
> Two things to check:
> 1) you might have session.forget() in the controller, maybe outside
> the action.
> 2) you might be using a custom form and it is missing the hidden
> fields,
>   if you don't have the _formkey then the form will not be accepted.

Also, if the submit results in a database insert, and the insert fails. I think.

And if there's a formname mismatch.

It seems to me that if accepts() fails, there always ought to be a reason 
reported. Would it break compatibility to report these errors in form.errors? 
If so, how about creating form.formerrors and guaranteeing that if accepts 
returns False, formerrors will say why.

> The Form docstring says:
> 
> form has one important method::
> 
> form.accepts(request.vars, session)
> 
> if form is accepted (and all validators pass) form.vars contains the
> accepted vars, otherwise form.errors contains the errors.
> in case of errors the form is modified to present the errors to the user.
> 
...but that's not really true. There are several reasons for failure that are 
not reported in form.errors.

(One of them is that the form has not been submitted yet. I find that logic 
really confusing: what's the path, exactly?)

> 
> 
> On Dec 23, 2:39 am, Johann Spies  wrote:
>> On 22 December 2010 22:36, Jonathan Lundell  wrote:
>> 
>> 
>> 
>>> When accepts() returns False, look at form.errors. It's a dict (Storage,
>>> actually, but you can treat it as a dict) that is keyed, typically, by field
>>> names, with error messages as values.
>> 
>>> (accepts() will also return False before the form has been submitted, but
>>> in that case form.errors is empty.)
>> 
>> Thanks.  I have tried that before also but it just reports Storage{}
>> 
>> So why is that empty?
>> 
>> Regards
>> Johann
>> 
>> --
>>  May grace and peace be yours in abundance through the full knowledge of God
>> and of Jesus our Lord!  His divine power has given us everything we need for
>> life and godliness through the full knowledge of the one who called us by
>> his own glory and excellence.
>> 2 Pet. 1:2b,3a




Re: [web2py] Re: translation dict name

2010-12-23 Thread Richard Vézina
Find it!

My only remaning problem is the # coding: utf8 at the top of translation
file... I don't see how dal.py manage it... I could made a readline and
remove it in a other instance of the open file or something like that, but
should have a simpler way to manage it.

Richard

On Thu, Dec 23, 2010 at 11:06 AM, ron_m  wrote:

> web2py uses portalocker.py look under gluon. There are many examples of use
> such as locking the session file in globals.py
>
>


Re: [web2py] Re: translation dict name

2010-12-23 Thread ron_m
web2py uses portalocker.py look under gluon. There are many examples of use 
such as locking the session file in globals.py



Re: [web2py] Re: translation dict name

2010-12-23 Thread Richard Vézina
Ok, I think I found what you do :

>From the DAL.py

Version 1.88.2

tfile = open(self._dbt, 'w')
portalocker.lock(tfile, portalocker.LOCK_EX)
cPickle.dump(sql_fields, tfile)
portalocker.unlock(tfile)
tfile.close()
if self._dbt:
if fake_migrate:
logfile.write('faked!\n')
else:
logfile.write('success!\n')
else:
tfile = open(self._dbt, 'r')
portalocker.lock(tfile, portalocker.LOCK_SH)
sql_fields_old = cPickle.load(tfile)
portalocker.unlock(tfile)
tfile.close()

Richard

On Thu, Dec 23, 2010 at 10:36 AM, Richard Vézina <
ml.richard.vez...@gmail.com> wrote:

> There is also this lib :
>
> http://pypi.python.org/pypi/lockfile/
>
> http://www.mail-archive.com/spambayes-dev@python.org/msg00727.html
>
>
> Richard
>
>
> On Thu, Dec 23, 2010 at 10:13 AM, Richard Vézina <
> ml.richard.vez...@gmail.com> wrote:
>
>> Hello Massimo,
>>
>> I have one more question about the process of pickle the translation
>> file...
>> Do you lock file with "flock"? Or just open the file and close it after
>> the pickling and applying transformation to the dict is enough to lock the
>> file during the process?
>>
>> Is this code correct to not having concurent access problem?? :
>>
>> f = open("file.dat","wb")
>> pickle.dump(x,f)
>> f.close()
>>
>> f = open("file.dat","rb")
>> y = pickle.load(f)
>> f.close()
>>
>>
>> Thank you
>>
>> Richard
>>
>> On Tue, Dec 7, 2010 at 12:17 PM, mdipierro 
>> wrote:
>> >
>> > The language files are just python pickles of
>> > {'original':'translation',...} where original and translation are UTF8
>> > strings.
>> > You can open, lock, unpickle, do whatever you need to do, re-pickle,
>> > unlock, close.
>> >
>> > On Dec 7, 11:03 am, Richard Vézina 
>> > wrote:
>> > > Hello,
>> > >
>> > > I would like to update the different language file for certain entry
>> with
>> > > translation contained in database...
>> > >
>> > > So I would do something like that :
>> > >
>> > > fr-ca.py dict.update(translate_ui_tables_names)
>> > > or
>> > > fr-fr.py dict.update(translate_ui_tables_names)
>> > >
>> > > But I don't know the name of the the variable name of the different
>> dict
>> > > that are contained in language files...
>> > >
>> > > And since those file are automatically generated I can't just do :
>> > >
>> > > fr-ca.py file dict : {key:vaule}.update(translate_ui_tables_names)
>> > >
>> > > Where could I add my update to the regular process of web2py?
>> > >
>> > > Or trigger a function...
>> > >
>> > > Richard
>> > >
>> > > On Mon, Dec 6, 2010 at 12:30 PM, Richard Vézina <
>> ml.richard.vez...@gmail.com
>> > >
>> > > > wrote:
>> > > > Hello,
>> > >
>> > > > I come with that solution... I would have comment...
>> > >
>> > > > I get my translations like this :
>> > >
>> > > >
>> translate_ui_tables_names=dict((r.table_name_en_ui,r.table_name_fr_ui)\
>> > > > for r in db().select(db.dict_database.ALL))
>> > >
>> > > > Then I just have to :
>> > >
>> > > > language translation dict*.append(translate_ui_tables_names)
>> > >
>> > > > * Still searching for the name of the dict of the differents
>> language file
>> > > > (ex.: fr-ca.py or fr-fr.py)
>> > >
>> > > > ;-)
>> > >
>> > > > Richard
>> > >
>> > >
>>
>
>


[web2py] Re: couchdb support again

2010-12-23 Thread ron_m
ii  python-couchdb  
0.6-1   
from Ubuntu 10.04.1 dpkg -l
I have to go visit a customer site today so will look again tonight. I think 
it is probably time for me to update direct from Apache. This may be a 
problem since the rest of the release actually uses CouchDb. I am very 
interested in getting this going so will do what I can - this I am thinking 
would be a good database for me to store configuration data in since it has 
a multi-master disconnect model that still resolves replication issues. I 
would have to go into it a lot deeper to explain why but will skip it for 
now.

Merry Christmas and all the best for the New Year.
Ron


[web2py] Re: Merry Christmas

2010-12-23 Thread ron_m
+1


[web2py] Re: Cache stored at request, does not sync with other threads until new request

2010-12-23 Thread Dragonfyre13
So I've gone back and forth on this again and again. It looks like
cache.ram being process bound (so even though I only have one web2py
instance, it's running across multiple wsgi processes?) was the
problem. The issue is, I'm having similar issues (in a very different
location) using cache.disk. I though maybe it might be better to use
memcache instead, but I get a keyerror when trying to use memcache to
cache the DAL, since my key regularly exceeds 250 chars (relatively
small query, but lists every field it looks like)

On Dec 21, 5:54 pm, Tim Alexander  wrote:
> It occurs to me, I'm using uwsgi. I'm assuming cache.ram is per process,
> meaning that if my Ajax side and xmlrpc side are not on the same process,
> this will completely not work properly. I'll try flipping over to cache.disk
> tomorrow morning to verify.
> On Dec 21, 2010 5:20 PM, "Dragonfyre13"  wrote:
>
> > At least I think the subject seems to define the behavior.
>
> > I have a function that exposes as an XMLRPC service. It puts something
> > in a DB, and then polls to see if there is a response to it from
> > another system talking to that same DB. (yes I realize that polling a
> > DB is a "bad thing" but necessary for various reasons in this case)
>
> > The difficulty is, there's an xmlrpc side, and an ajax side. The ajax
> > side is a longpoll (simulated server side push) with a loop like this:
>
> > while endtime > datetime.datetime.now():
> > # This keeps finding a cached value, even when it's cleared
> > by
> > # another request.
> > #for k in cache.ram.storage.keys():
> > #logging.debug(k,v)
> > #if k.find("next_action.ccid=" + str(ccid)) != -1:
> > # logging.debug(str(ccid) + "found cached value")
> > actionrow = localdb(localdb.next_action.ccid == ccid).select(
> > cache=(cache.ram,600)).first()
> > if actionrow and len(actionrow) and actionrow.action_str !=
> > None and \
> > actionrow.return_str == None:
> > return dict(action_xml=actionrow.action_str,
> > ccid=ccid)
> > time.sleep(.5)
>
> > The XMLRPC side is much the same. ccid is a unique key for the
> > "conversation" for both of them to use. The action string is where the
> > XMLRPC side pushes information, and return_str is data that is handed
> > back after the ajax longpoll fulfills the action string's needs.
>
> > My problem in all of this is the comments above. Even though when I do
> > an update on the XMLRPC side, I clear cache for this select statement
> > (via setting timeout to 0 for that select statement in cache) it still
> > maintains the value pulled from cache in the ajax request above. So I
> > don't pull out the actual value in the DB until cache expires in this
> > function, even though I've cleared the cache via setting timeout to 0
> > in the other function:
> > localdb(localdb.next_action.ccid == ccid).select(cache=(cache.ram, 0))
>
> > Any ideas? For now, I really don't know what I'm looking at for an
> > issue or resolution, but even a "yep, makes a copy when your request
> > object is created" would work if someone knows. Or "you're an idiot,
> > do it like this" would be even better!


Re: [web2py] Re: translation dict name

2010-12-23 Thread Richard Vézina
There is also this lib :

http://pypi.python.org/pypi/lockfile/

http://www.mail-archive.com/spambayes-dev@python.org/msg00727.html


Richard


On Thu, Dec 23, 2010 at 10:13 AM, Richard Vézina <
ml.richard.vez...@gmail.com> wrote:

> Hello Massimo,
>
> I have one more question about the process of pickle the translation
> file...
> Do you lock file with "flock"? Or just open the file and close it after the
> pickling and applying transformation to the dict is enough to lock the file
> during the process?
>
> Is this code correct to not having concurent access problem?? :
>
> f = open("file.dat","wb")
> pickle.dump(x,f)
> f.close()
>
> f = open("file.dat","rb")
> y = pickle.load(f)
> f.close()
>
>
> Thank you
>
> Richard
>
> On Tue, Dec 7, 2010 at 12:17 PM, mdipierro 
> wrote:
> >
> > The language files are just python pickles of
> > {'original':'translation',...} where original and translation are UTF8
> > strings.
> > You can open, lock, unpickle, do whatever you need to do, re-pickle,
> > unlock, close.
> >
> > On Dec 7, 11:03 am, Richard Vézina 
> > wrote:
> > > Hello,
> > >
> > > I would like to update the different language file for certain entry
> with
> > > translation contained in database...
> > >
> > > So I would do something like that :
> > >
> > > fr-ca.py dict.update(translate_ui_tables_names)
> > > or
> > > fr-fr.py dict.update(translate_ui_tables_names)
> > >
> > > But I don't know the name of the the variable name of the different
> dict
> > > that are contained in language files...
> > >
> > > And since those file are automatically generated I can't just do :
> > >
> > > fr-ca.py file dict : {key:vaule}.update(translate_ui_tables_names)
> > >
> > > Where could I add my update to the regular process of web2py?
> > >
> > > Or trigger a function...
> > >
> > > Richard
> > >
> > > On Mon, Dec 6, 2010 at 12:30 PM, Richard Vézina <
> ml.richard.vez...@gmail.com
> > >
> > > > wrote:
> > > > Hello,
> > >
> > > > I come with that solution... I would have comment...
> > >
> > > > I get my translations like this :
> > >
> > > >
> translate_ui_tables_names=dict((r.table_name_en_ui,r.table_name_fr_ui)\
> > > > for r in db().select(db.dict_database.ALL))
> > >
> > > > Then I just have to :
> > >
> > > > language translation dict*.append(translate_ui_tables_names)
> > >
> > > > * Still searching for the name of the dict of the differents language
> file
> > > > (ex.: fr-ca.py or fr-fr.py)
> > >
> > > > ;-)
> > >
> > > > Richard
> > >
> > >
>


Re: [web2py] export_to_csv_file and colnames

2010-12-23 Thread Thadeus Burgess
that would be a bug for sure :p

--
Thadeus




On Thu, Dec 23, 2010 at 6:59 AM, howesc  wrote:

> Massimo and crew,
>
> I am trying to use export_to_csv_file() on a rows object with the colnames
> parameter on google app engine.  it turns out that the method (in both
> sql.py and the new dal.py) outputs the proper column names, but then outputs
> data for every column in the table.
>
> the culprit is on line 4741 of dal.py (from trunk):
> for col in self.colnames:
> should be
> for col in colnames:
>
> and then, so long as the user's colnames are in the format
> '.' it works as desired (at least from my
> perspective).
>
> does this sounds correct?  if so, do you mind adding it to trunk?
>
> thanks!
>
> christian
>
>


Re: [web2py] customizing size of form fields created using field.custom.widget

2010-12-23 Thread Sahil Arora
thanks...that worked

On 12/23/10, Martín Mulone  wrote:
> Add to your css definition or in /static/CSS/base.css this rule and
> tell if this is working:
>
> #task_estimated_time_unit {width: 80px;}
>
> 2010/12/23 Sahil Arora :
>> Create a new task
>> 
>> 
>>
>> 
>> Type :> id="task_type" name="type">> value="2">CodingDesigning> value="3">Testing
>> 
>> Title :> name="title" type="text" value="" />
>> 
>> Description :> id="task_description" name="description"
>> rows="10">
>> 
>> Estimated Time :> id="task_estimated_time" name="estimated_time" type="text" value=""
>> />> name="estimated_time_unit">> selected="selected" value="days">days> value="hours">hours 
>>
>> 
>> 
>> > />
>> 
>> 
>>
>>
>> On 12/23/10, Martín Mulone  wrote:
>>> Can you show me the source html of this form generated?
>>>
>>> 2010/12/23 Sahil Arora :
 I used the following code to generate a form in attached image.
 Is it possible to change the size of the fields in the form.
 I want to decrease size of input field of Estimated time and the dropbox
 field to the right of it


 {{=form.custom.begin}}
 

 
 Type :{{=form.custom.widget.type}}
 
 Title :{{=form.custom.widget.title}}
 
 Description
 :{{=form.custom.widget.description}}
 
 Estimated Time
 :{{=form.custom.widget.estimated_time}}{{=form.custom.widget.estimated_time_unit}}
 
 
 
 {{=form.custom.submit}}
 
 

 {{=form.custom.end}}

 --
 Sahil Arora
 B.Tech 2nd year
 Computer Science and Engineering
 IIT Delhi
 Contact No: +91 9871491046

>>>
>>>
>>>
>>> --
>>> My blog: http://martin.tecnodoc.com.ar
>>> My portfolio *spanish*: http://www.tecnodoc.com.ar
>>> Checkout my last proyect instant-press: http://www.instant2press.com
>>>
>>
>>
>> --
>> Sahil Arora
>> B.Tech 2nd year
>> Computer Science and Engineering
>> IIT Delhi
>> Contact No: +91 9871491046
>>
>
>
>
> --
> My blog: http://martin.tecnodoc.com.ar
> My portfolio *spanish*: http://www.tecnodoc.com.ar
> Checkout my last proyect instant-press: http://www.instant2press.com
>


-- 
Sahil Arora
B.Tech 2nd year
Computer Science and Engineering
IIT Delhi
Contact No: +91 9871491046


Re: [web2py] Re: translation dict name

2010-12-23 Thread Richard Vézina
Hello Massimo,

I have one more question about the process of pickle the translation
file...
Do you lock file with "flock"? Or just open the file and close it after the
pickling and applying transformation to the dict is enough to lock the file
during the process?

Is this code correct to not having concurent access problem?? :

f = open("file.dat","wb")
pickle.dump(x,f)
f.close()

f = open("file.dat","rb")
y = pickle.load(f)
f.close()


Thank you

Richard

On Tue, Dec 7, 2010 at 12:17 PM, mdipierro  wrote:
>
> The language files are just python pickles of
> {'original':'translation',...} where original and translation are UTF8
> strings.
> You can open, lock, unpickle, do whatever you need to do, re-pickle,
> unlock, close.
>
> On Dec 7, 11:03 am, Richard Vézina 
> wrote:
> > Hello,
> >
> > I would like to update the different language file for certain entry
with
> > translation contained in database...
> >
> > So I would do something like that :
> >
> > fr-ca.py dict.update(translate_ui_tables_names)
> > or
> > fr-fr.py dict.update(translate_ui_tables_names)
> >
> > But I don't know the name of the the variable name of the different dict
> > that are contained in language files...
> >
> > And since those file are automatically generated I can't just do :
> >
> > fr-ca.py file dict : {key:vaule}.update(translate_ui_tables_names)
> >
> > Where could I add my update to the regular process of web2py?
> >
> > Or trigger a function...
> >
> > Richard
> >
> > On Mon, Dec 6, 2010 at 12:30 PM, Richard Vézina <
ml.richard.vez...@gmail.com
> >
> > > wrote:
> > > Hello,
> >
> > > I come with that solution... I would have comment...
> >
> > > I get my translations like this :
> >
> > >
translate_ui_tables_names=dict((r.table_name_en_ui,r.table_name_fr_ui)\
> > > for r in db().select(db.dict_database.ALL))
> >
> > > Then I just have to :
> >
> > > language translation dict*.append(translate_ui_tables_names)
> >
> > > * Still searching for the name of the dict of the differents language
file
> > > (ex.: fr-ca.py or fr-fr.py)
> >
> > > ;-)
> >
> > > Richard
> >
> >


Re: [web2py] customizing size of form fields created using field.custom.widget

2010-12-23 Thread Martín Mulone
Add to your css definition or in /static/CSS/base.css this rule and
tell if this is working:

#task_estimated_time_unit {width: 80px;}

2010/12/23 Sahil Arora :
> Create a new task
> 
> 
>
> 
> Type : id="task_type" name="type"> value="2">CodingDesigning value="3">Testing
> 
> Title : name="title" type="text" value="" />
> 
> Description : id="task_description" name="description"
> rows="10">
> 
> Estimated Time : id="task_estimated_time" name="estimated_time" type="text" value=""
> /> name="estimated_time_unit"> selected="selected" value="days">days value="hours">hours 
>
> 
> 
>  />
> 
> 
>
>
> On 12/23/10, Martín Mulone  wrote:
>> Can you show me the source html of this form generated?
>>
>> 2010/12/23 Sahil Arora :
>>> I used the following code to generate a form in attached image.
>>> Is it possible to change the size of the fields in the form.
>>> I want to decrease size of input field of Estimated time and the dropbox
>>> field to the right of it
>>>
>>>
>>> {{=form.custom.begin}}
>>> 
>>>
>>> 
>>> Type :{{=form.custom.widget.type}}
>>> 
>>> Title :{{=form.custom.widget.title}}
>>> 
>>> Description
>>> :{{=form.custom.widget.description}}
>>> 
>>> Estimated Time
>>> :{{=form.custom.widget.estimated_time}}{{=form.custom.widget.estimated_time_unit}}
>>> 
>>> 
>>> 
>>> {{=form.custom.submit}}
>>> 
>>> 
>>>
>>> {{=form.custom.end}}
>>>
>>> --
>>> Sahil Arora
>>> B.Tech 2nd year
>>> Computer Science and Engineering
>>> IIT Delhi
>>> Contact No: +91 9871491046
>>>
>>
>>
>>
>> --
>> My blog: http://martin.tecnodoc.com.ar
>> My portfolio *spanish*: http://www.tecnodoc.com.ar
>> Checkout my last proyect instant-press: http://www.instant2press.com
>>
>
>
> --
> Sahil Arora
> B.Tech 2nd year
> Computer Science and Engineering
> IIT Delhi
> Contact No: +91 9871491046
>



-- 
My blog: http://martin.tecnodoc.com.ar
My portfolio *spanish*: http://www.tecnodoc.com.ar
Checkout my last proyect instant-press: http://www.instant2press.com


Re: [web2py] Re: Merry Christmas

2010-12-23 Thread Bruno Rocha
I wish a happy new year to all of the group. and that 2011 will be a year of
achievements and more good developments for our dear web framework.

This year I were actively connected with the web2py development. I put aside
other technologies (kicked the ass of my bosses) and founded my own
small-company and we had a great year working with 100% of the projects
developed with free software and Python (almost all in web2py)

I thank Massimo and all group for everything that I learned here in 2010.

We hope 2011 to be a great year to everyone. (Let's kick asses creating
great open source systems with web2py in 2011)

(we are going to take a break, no internets or code until next year)

Happy new year to you all!.

-- 

Bruno Rocha
http://about.me/rochacbruno/bio


[web2py] Re: Merry Christmas

2010-12-23 Thread Anthony
Indeed, Merry Christmas and Happy New Year to all the fine folks here. :D
 
Anthony
 


Re: [web2py] customizing size of form fields created using field.custom.widget

2010-12-23 Thread Sahil Arora
Create a new task




Type :CodingDesigningTesting

Title :

Description :

Estimated Time :dayshours 








On 12/23/10, Martín Mulone  wrote:
> Can you show me the source html of this form generated?
>
> 2010/12/23 Sahil Arora :
>> I used the following code to generate a form in attached image.
>> Is it possible to change the size of the fields in the form.
>> I want to decrease size of input field of Estimated time and the dropbox
>> field to the right of it
>>
>>
>> {{=form.custom.begin}}
>> 
>>
>> 
>> Type :{{=form.custom.widget.type}}
>> 
>> Title :{{=form.custom.widget.title}}
>> 
>> Description
>> :{{=form.custom.widget.description}}
>> 
>> Estimated Time
>> :{{=form.custom.widget.estimated_time}}{{=form.custom.widget.estimated_time_unit}}
>> 
>> 
>> 
>> {{=form.custom.submit}}
>> 
>> 
>>
>> {{=form.custom.end}}
>>
>> --
>> Sahil Arora
>> B.Tech 2nd year
>> Computer Science and Engineering
>> IIT Delhi
>> Contact No: +91 9871491046
>>
>
>
>
> --
> My blog: http://martin.tecnodoc.com.ar
> My portfolio *spanish*: http://www.tecnodoc.com.ar
> Checkout my last proyect instant-press: http://www.instant2press.com
>


-- 
Sahil Arora
B.Tech 2nd year
Computer Science and Engineering
IIT Delhi
Contact No: +91 9871491046


[web2py] Re: Merry Christmas

2010-12-23 Thread DenesL
+1

On Dec 23, 9:20 am, mdipierro  wrote:
> same here to all of you!


[web2py] Re: form.accepts = False. How to find out why

2010-12-23 Thread DenesL

Two things to check:
1) you might have session.forget() in the controller, maybe outside
the action.
2) you might be using a custom form and it is missing the hidden
fields,
   if you don't have the _formkey then the form will not be accepted.


On Dec 23, 2:39 am, Johann Spies  wrote:
> On 22 December 2010 22:36, Jonathan Lundell  wrote:
>
>
>
> > When accepts() returns False, look at form.errors. It's a dict (Storage,
> > actually, but you can treat it as a dict) that is keyed, typically, by field
> > names, with error messages as values.
>
> > (accepts() will also return False before the form has been submitted, but
> > in that case form.errors is empty.)
>
> Thanks.  I have tried that before also but it just reports Storage{}
>
> So why is that empty?
>
> Regards
> Johann
>
> --
>  May grace and peace be yours in abundance through the full knowledge of God
> and of Jesus our Lord!  His divine power has given us everything we need for
> life and godliness through the full knowledge of the one who called us by
> his own glory and excellence.
>                                                     2 Pet. 1:2b,3a


[web2py] Re: Merry Christmas

2010-12-23 Thread mdipierro
same here to all of you!

On Dec 23, 7:24 am, Martín Mulone  wrote:
> Merry Christmas and a happy new to the group.
>
> 2010/12/23 Stef Mientki :
>
>
>
> > +1,
>
> > btw, what a nice signature !!
> > cheers,
> > Stef
> > On 23-12-2010 08:17, ⎝⏠⏝⏠⎠ Kuldeep Singh PHP FreeLancer Web Developer,SEO
> > Services wrote:
>
> > Marry Christmas to all of you ...From Kaysellers.com
>
> > On 23 December 2010 12:40, ma...@rockiger.com 
> > wrote:
>
> > Merry Christmas and a happy new your to all you web2py-contributors.
> > You do an awesome work - everyone.
>
> > Marco
>
> > --
> > Kuldeep Singh...
> > WebDeveloper And Freelancer Kay Sellers,
> > Owner:http://kaysellers.com
> > +9199142-41733,*+91-9501710226(Allways Switched On)*
> > Skype ID : kaydeveloper
> > Yahoo:deepulove123321
> > On Twitter:http://twitter.com/ruhisoftect
> > We Provide:-
> > Adobe AIR,E-Commerce PHP Web and Desktop Applications,Wordpress
> > Themes,Drupal Themes,Joomla Templates,Joomla Components Modules
> > Plugins,Java,ERP,MLM Development and Logic Design,Ajax,Jquery,RSS
> > Feeds,PhotoShop,Flex,Payment Solutions.
>
> --
> My blog: http://martin.tecnodoc.com.ar
> My portfolio *spanish*: http://www.tecnodoc.com.ar
> Checkout my last proyect instant-press:http://www.instant2press.com


[web2py] Re: App admin error

2010-12-23 Thread mdipierro
At some point in time you changed

Field('word', 'reference words', ...)

to

Field('word', 'list:reference words', ...)

and you had data in the database. SQLite let you do that (because
SQLite does not check field type and does not support alter table), so
now you have corrupted data in the table and you cannot select it any
more.

You need do delete your database

   rm applications/app/databases/*

and start clean.


On Dec 23, 4:54 am, "Arun K.Rajeevan"  wrote:
> I've following in model
>
> db.define_table('languages',
>                 Field 
> ('full', 'string', 
> length=30, notnull=True, required=True),
>                 Field 
> ('short', 'string', 
> length=10 , notnull=True, required=True),
>                 format='%(full)s - %(short)s')
>
> db.define_table('words',
>                 Field 
> ('word', 'string', 
> notnull=True, required=True),
>                 Field 
> ('lang', db.languages, 
> notnull=True, readable=False, writable=False),
>                 Field 
> ('entry_by', db.auth_user, 
> notnull=True, readable=False, writable=False))
>
> db.define_table('pictures',
>                 Field 
> ('image', 'upload', 
> notnull=True, required=True, label='Visual Lingua'),
>                 Field 
> ('word', 'list:reference 
> words', readable=False, writable=False, required=True),
>                 Field 
> ('total', 'integer', 
> notnull=True, readable=False, writable=False, default=2),
>                 Field 
> ('clicks', 'integer', 
> notnull=True, readable=False, writable=False, default=1),
>                 Field 
> ('rating', 'double', 
> notnull=True, readable=False, writable=False, compute=lambda row: 
> row['total']/row['clicks']),
>                 Field 
> ('entry_by', db.auth_user, 
> notnull=True, readable=False, writable=False))
> '''
> db.define_table('symbolize',
>                 Field('image', db.pictures, notnull=True, readable=False, 
> writable=False, required=True ),
>                 Field('word', db.words, notnull=True, readable=False, 
> writable=False, required=True))
> '''              
>
> I got following error when I select table '*pictures*' on appadmin.
> Isn't that an error?
> Other table's pages are rendered correct.
>
> Version  web2py™ Version 1.91.4 (2010-12-22 17:31:23)  Python Python 2.5.1:
> C:\Python25\python.exe  Traceback
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
> 10.
> 11.
>
> Traceback (most recent call last):
>   File 
> "I:\Evolve\Work\web2py_src_downloaded\google_appengine\visuallingua\gluon\restricted.py",
>  line 188, in restricted
>     exec ccode in environment
>   File 
> "I:/Evolve/Work/web2py_src_downloaded/google_appengine/visuallingua/applications/init/views/appadmin.html"
>  , line 
> 165, in 
>     
>   File 
> "I:\Evolve\Work\web2py_src_downloaded\google_appengine\visuallingua\gluon\sqlhtml.py",
>  line 1329, in __init__
>     r = field.represent(r)
>   File 
> "I:\Evolve\Work\web2py_src_downloaded\google_appengine\visuallingua\gluon\dal.py",
>  line 3012, in list_ref_repr
>     return (ids and ', '.join(f(r,ref.id) for ref in refs) or '')
> TypeError: sequence item 0: expected string, int found
>
>  Error snapshot [image: help] Detailed traceback description
>
> (sequence item 0: expected string, int found)
>
> Function argument list
>
> (ids=[2], r=, 'id':
> }>, f=)
>  Code listing
>
> 3007.
> 3008.
> 3009.
> 3010.
> 3011.
> 3012.
>
> 3013.
> 3014.
> 3015.
> 3016.
>
>             field_type.find('.') < 0 and \
>             field_type[15:] in field.db.tables:
>         referenced = field.db[field_type[15:]]
>         def list_ref_repr(ids, r=referenced, f=ff):
>             refs = r._db(r.id.belongs(ids)).select(r.id)
>             return (ids and ', '.join(f(r,ref.id) for ref in refs) or '')
>
>         field.represent = list_ref_repr
>         if hasattr(referenced, '_format') and referenced._format:
>             requires = validators.IS_IN_DB(field.db,referenced.id,
>                                            referenced._format,multiple=True)
>
>  Variables ', '.join undefined  f   refs 
>  object at 0x020A94D0>  ids [2]  r  0x021...>, 'id': }>  ref undefined


[web2py] Re: Encountering problem with a computer field

2010-12-23 Thread mdipierro
Need to think about it.

On Dec 23, 3:51 am, cjrh  wrote:
> On Dec 23, 2:04 am, mdipierro  wrote:
>
> > I can add a try except so that web2py does not tries to compute fields
> > when there is not enough information. The downside is that a typo will
> > result in a silent failure to compute. Perhaps we should do this
> > anyway.
>
> If you're going to be doing work in the area of compute anyway, is
> there a posssibility of making another change that the current value
> of the compute-ed field can be passed to the compute method?


[web2py] New to web2py

2010-12-23 Thread Monte Milanuk

Hello all,

New guy here... I've been looking all over the web for something that
meets all the needs of a couple projects I want to do, and it looks like
web2py will just about cover them!

I'm getting my feet wet with the examples, and got sidetracked ;) by the
gae sql designer - holy cow that thing is sweet, not too complicated,
just right!  I was noticing that it seems to use the old DAL language of
'SQLField' instead of 'Field' for the table definitions... is there an
update or change in the works for that?

Also... maybe my understanding of foreign keys as used in web2py (or at 
least the gae sql designer) is not up to snuff... it seems like this:


dbOBJECT.tbl_phone_numbers.id_tbl_members.requires=IS_IN_DB(dbOBJECT,
'tbl_members.id','tbl_members.title','tbl_members.first_name',
'tbl_members.mid_init','tbl_members.last_name','tbl_members.suffix',
'tbl_members.street1','tbl_members.street2','tbl_members.city','tbl_members.state',
'tbl_members.post_code','tbl_members.country','tbl_members.gender','tbl_members.nra_id')

should be just:

dbOBJECT.tbl_phone_numbers.id_tbl_members.requires=IS_IN_DB(dbOBJECT,'tbl_members.id')

since I'm just wanting to tie those two fields together, not the one 
field to the whole other table... yes/no/maybe?


TIA,

Monte



Re: [web2py] Merry Christmas

2010-12-23 Thread Martín Mulone
Merry Christmas and a happy new to the group.

2010/12/23 Stef Mientki :
> +1,
>
> btw, what a nice signature !!
> cheers,
> Stef
> On 23-12-2010 08:17, ⎝⏠⏝⏠⎠ Kuldeep Singh PHP FreeLancer Web Developer,SEO
> Services wrote:
>
> Marry Christmas to all of you ...From Kaysellers.com
>
> On 23 December 2010 12:40, ma...@rockiger.com 
> wrote:
>
> Merry Christmas and a happy new your to all you web2py-contributors.
> You do an awesome work - everyone.
>
> Marco
>
>
> --
> Kuldeep Singh...
> WebDeveloper And Freelancer Kay Sellers,
> Owner:http://kaysellers.com
> +9199142-41733,*+91-9501710226(Allways Switched On)*
> Skype ID : kaydeveloper
> Yahoo:deepulove123321
> On Twitter:http://twitter.com/ruhisoftect
> We Provide:-
> Adobe AIR,E-Commerce PHP Web and Desktop Applications,Wordpress
> Themes,Drupal Themes,Joomla Templates,Joomla Components Modules
> Plugins,Java,ERP,MLM Development and Logic Design,Ajax,Jquery,RSS
> Feeds,PhotoShop,Flex,Payment Solutions.
>
>
>
>



-- 
My blog: http://martin.tecnodoc.com.ar
My portfolio *spanish*: http://www.tecnodoc.com.ar
Checkout my last proyect instant-press: http://www.instant2press.com


Re: [web2py] customizing size of form fields created using field.custom.widget

2010-12-23 Thread Martín Mulone
Can you show me the source html of this form generated?

2010/12/23 Sahil Arora :
> I used the following code to generate a form in attached image.
> Is it possible to change the size of the fields in the form.
> I want to decrease size of input field of Estimated time and the dropbox
> field to the right of it
>
>
> {{=form.custom.begin}}
> 
>
> 
> Type :{{=form.custom.widget.type}}
> 
> Title :{{=form.custom.widget.title}}
> 
> Description
> :{{=form.custom.widget.description}}
> 
> Estimated Time
> :{{=form.custom.widget.estimated_time}}{{=form.custom.widget.estimated_time_unit}}
> 
> 
> 
> {{=form.custom.submit}}
> 
> 
>
> {{=form.custom.end}}
>
> --
> Sahil Arora
> B.Tech 2nd year
> Computer Science and Engineering
> IIT Delhi
> Contact No: +91 9871491046
>



-- 
My blog: http://martin.tecnodoc.com.ar
My portfolio *spanish*: http://www.tecnodoc.com.ar
Checkout my last proyect instant-press: http://www.instant2press.com


  1   2   >