Re: [web2py] Re: MARKMIN indentation

2011-12-17 Thread Vasile Ermicioi
aha, ok
thank you


Re: [web2py] Re: Add placeholder to password field in web2py login form

2011-12-17 Thread Abhishek Gupta
Sorry, I got the error. Correct thing to be done was :

{{register_form.element('input#auth_user_username')['_placeholder'] =
'Username'}}

On 17 December 2011 12:48, Abhishek Gupta abhishekgupta.i...@gmail.comwrote:

 Thanks, it worked.

 But surprisingly
 form.element('input.username')['_placeholder'] = 'Username'

 doesn't work and instead gives the error

   Traceback (most recent call last):

   File /home/www-data/web2py/gluon/restricted.py, line 194, in restricted

 exec ccode in environment

   File /home/www-data/web2py/applications/chat/views/default/login.html, 
 line 109, in module
 TypeError: 'NoneType' object does not support item assignment


 On 17 December 2011 12:04, Anthony abasta...@gmail.com wrote:

 Assuming the standard user() function:

 form = auth()
 if request.args(0) == 'login':
 form.element('input.password')['_placeholder'] = 'Password'

 Not sure placeholders will show in plain text in all browsers -- may need
 a JS workaround for that (change the field type dynamically to text on
 blur).

 Anthony


 On Saturday, December 17, 2011 1:20:21 AM UTC-5, Abhishek Gupta wrote:

 Hello

 I am customizing web2py login form, but appear to stuck with this one.

 In a normal HTML5 form, for password I can do following:
input type=password name=cpassword
 id=cpassword placeholder=Re-password /

 But how can i add a similar placeholder field to the web2py login form
 for the password field. I was able to do the same for the username field
 using the following function :

 $('#auth_user_username').each(**function() {

var default_value = Username;
$(this).focus(function(){
if(this.value == default_value) {
this.value = '';
}
});

$(this).blur(function(){
if(this.value == '') {
this.value = default_value;
}
});
 });





[web2py] Re: Solidform: key-error

2011-12-17 Thread kenji4569
Hi Johann,
I've just investigated the problem.

Do you use virtual fields for computing the article_eq and ltitle?

If so, SOLIDFORM as well as SQLFORM need to know the filed properties
of the virtual fields, such as labels and representation. Then, one
solution would be to define a virtual table in which the Fields of
the virtual fields are defined, and pass it to the SOLIDFORM as
follows:

form = SOLIDFORM(
DAL(None).define_table('no_table',
db.akb_articles,
*[Field('article_eq', label='xxx'),
  Field('ltitle', represent=yyy)]),
record=rekord,
fields=fields_read,
showid=False,
readonly=True)

If it didn't work, please let me know more details.

Regards,
Kenji

On 12月16日, 午後9:46, luismurciano luismurci...@gmail.com wrote:
 may be you should as Hosoda Kenji himself, he's a kind guy, and solve
 a bug i found in just few days. you can ask him in the comments
 section in the plugin page.

 On 15 dic, 11:17, Johann Spies johann.sp...@gmail.com wrote:







  I get

    table = self.createform(xfields)
    File applications/init/modules/plugin_solidform.py, line 96, in 
  createform
      n = len(self.flat_fields)
  KeyError: 'article_eq'

  when I use the following code:

  fields = ['id',
                'title',
                'primaryauthor',
                'authors',
                'rp_author',
                'journal',
                'bib_id',
                'bib_pages',
                'doctype',
                'language',
                'abstract',
                'bib_vol',
                'bib_date',
                'url',
                'pubyear',
                'ut',
                'scopus_id',
                'sabinet_id',
                'isap_id',
                'ltitle',
                'article_eq',
                'uuid',
                'created_on',
                'created_by',
                'updated_on',
                'updated_by']

      fields_read = [['id', None],
                     'title',
                     ['primaryauthor', None],
                     'authors',
                     ['rp_author', 'journal'],
                     ['bib_id', 'bib_pages' ],
                     ['doctype', 'language' ],
                     'abstract',
                     ['bib_vol', 'bib_date'],
                     'url',
                     ['pubyear', 'ut' ],
                     ['scopus_id', 'sabinet_id', 'isap_id' ],
                     'ltitle',
                     ['article_eq', 'uuid' ] ,
                     ['created_on', 'created_by'],
                     ['updated_on', 'updated_by']
                     ]

        form = SOLIDFORM(db.akb_articles, rekord, fields = fields, showid =
  False, readonly = True)

  The error occurs when I use fields = fields as well as the original one I
  have tried: fields = fields_read.

  The list as in 'fields'  is the result of db[table].fields().  So the
  fieldnames are correct.

  The following fields are computed fields: article_eq and ltitle.

  Any idea what is causing the key-error?

  The version of solidtable is one I downloaded today 
  fromhttp://dev.s-cubism.com/web2py_plugins/pack_plugin/solidform

  Regards
  Johann
  --
  Because experiencing your loyal love is better than life itself,
  my lips will praise you.  (Psalm 63:3)

[web2py] Re: book 4th edition in PDF

2011-12-17 Thread puercoespin
Massimo, why not use paypal or google cart for payment?

I dont know what is stripes..

 BTW. This uses stripes for payment I do not store any client info.
 I do store your email, name and order so that, in the future you will
 be able to download new version without paying again.


Re: [web2py] book 4th edition in PDF

2011-12-17 Thread Randolph Chaves
Worked for me!

On Fri, Dec 16, 2011 at 10:51 PM, Massimo Di Pierro 
massimo.dipie...@gmail.com wrote:

 I apologize posting the electronic version of the book 4th ed in html
 and pdf is taking longer than expected but truly I am almost done. The
 delay was due to these facts:

 1) complete rewrite of the online book app
 2) do not use lulu for the pdf download but use the web app itself in
 order to
   a) lower the price
   b) make the process simpler and painless
   c) watermark every copy of the book (so I know who posts it online)
   d) allow users to download future new version without paying again
 3) allow the system to sell multiple books (by me and other people).

 I need a tester.

 If you plan to buy the PDF book:

 - post on this list a message saying: I am trying
 - try buy it here: https://web2py.com/pdfbuy
 - post on this list a message saying whether is worked or did not work
 or you gave up.
 - do not try download is somebody else is an has not reported back.

 I am trying avoid too many downloads as I do not know how many I can
 handle concurrently because of ram.

 If this works well I will merge this app and the new html/book app
 (which is also done).




-- 

  *´¨)
 ¸.•´ ¸.•*´¨)  ¸.•*¨) ¸.•*¨)
 (¸.•´ *+Randolph Chaves http://goo.gl/2dobB*  (¸.•
  (¸.•`(¸.•`


[web2py] Re: book 4th edition in PDF

2011-12-17 Thread Alan Etkin
I am trying

On Dec 16, 9:51 pm, Massimo Di Pierro massimo.dipie...@gmail.com
wrote:
 I apologize posting the electronic version of the book 4th ed in html
 and pdf is taking longer than expected but truly I am almost done. The
 delay was due to these facts:

 1) complete rewrite of the online book app
 2) do not use lulu for the pdf download but use the web app itself in
 order to
    a) lower the price
    b) make the process simpler and painless
    c) watermark every copy of the book (so I know who posts it online)
    d) allow users to download future new version without paying again
 3) allow the system to sell multiple books (by me and other people).

 I need a tester.

 If you plan to buy the PDF book:

 - post on this list a message saying: I am trying
 - try buy it here:https://web2py.com/pdfbuy
 - post on this list a message saying whether is worked or did not work
 or you gave up.
 - do not try download is somebody else is an has not reported back.

 I am trying avoid too many downloads as I do not know how many I can
 handle concurrently because of ram.

 If this works well I will merge this app and the new html/book app
 (which is also done).


Re: [web2py] Web Resources

2011-12-17 Thread Javier Quarite
Thanks everyone for the information, I'll try to read the documentation of
pythonfiddle because its FOSS, and try to do one using web2py hope it
works =)


Javier Q


[web2py] Re: Having multiple layouts (themes) and choosing from one

2011-12-17 Thread Alan Etkin
I think you could put conditional blocks inside a view included by the
default layout:
Then it should be possible to customize the views with user input or
values stored in the database

The view must have the {{ extend layout.html }} line

And you can override the layout blocks with {{ block ...}} sentences

The online book covers the use of layout and extending views:

See Customizing the default layouts in the Views chapter

It is possible to modify the layout.html view also

On Dec 17, 2:32 am, Joseph Jude ceph...@gmail.com wrote:
 What are the ways in which such multiple layouts and choosing one at the
 run time work? Something like wordpress themes? Modifying views/layout fix
 the layout to the one that was deployed. But as in wordpress, if more
 themes are installed how can a different one be chosen?

 Thank you,
 Joseph


[web2py] Record Versioning

2011-12-17 Thread Ron McOuat
Might not be a problem but the table mpn has a field with the same name mpn and 
the problem goes away if the archive portion of onaccept is removed.


[web2py] Re: Cron on FluxFlex

2011-12-17 Thread John Oliva
Thanks Alan.

[web2py] Re: book 4th edition in PDF

2011-12-17 Thread Alan Etkin
 I did not understand that point. What did you mean?

Ok, now i get it:

Do not download if other customer has not reported back yet

And the watermark has to be the text in the footer.


[web2py] Re: SQLFORM.grid custom labels in edit form for each row

2011-12-17 Thread brushek
But...

LABEL have some bug:

http://code.google.com/p/web2py/issues/detail?id=566



On 16 Gru, 23:32, Anthony abasta...@gmail.com wrote:
 In your table definition, you can specify a 'label' argument for each
 field, and I think that can be whatever you want (e.g., an IMG tag, etc.).

 db.define_table('mytable', Field('myfield',
 label=IMG(_src=URL('static','img/myimage.png'

 Haven't tried it, but hopefully should work.

 Anthony







 On Friday, December 16, 2011 5:10:53 PM UTC-5, brushek wrote:

  Hello,

  I would like to have images instead of text (or text AND image) in
  each label for row, when I click edit in form generated by
  SQLFORM.grid. How to do this in easiest way ?

  Regards
  brushek


Re: [web2py] Web Resources

2011-12-17 Thread chandrakant kumar
Hi Javier

I'm working on same, let me know if we can collaborate.

On Sat, Dec 17, 2011 at 5:34 PM, Javier Quarite jquari...@gmail.com wrote:

 Thanks everyone for the information, I'll try to read the documentation of
 pythonfiddle because its FOSS, and try to do one using web2py hope it
 works =)


 Javier Q



[web2py] Re: SQLFORM.grid custom labels in edit form for each row

2011-12-17 Thread Anthony
The bug isn't with LABEL, it's with SQLFORM.search_menu, which tries to 
translate field.label without first converting to a string in case the 
label is an HTML helper.

Should be an easy fix, but for now, you can do:

label=str(IMG(...))

or

label=IMG(...).xml()

either of which will convert the HTML helper to a string, so it won't cause 
an error with the translator.

Also, note that you shouldn't need the LABEL wrapper -- in SQLFORMs, the 
labels are automatically wrapped in a LABEL().

Anthony

On Saturday, December 17, 2011 10:32:36 AM UTC-5, brushek wrote:

 But...

 LABEL have some bug:

 http://code.google.com/p/web2py/issues/detail?id=566

 On 16 Gru, 23:32, Anthony abas...@gmail.com wrote:
  In your table definition, you can specify a 'label' argument for each
  field, and I think that can be whatever you want (e.g., an IMG tag, 
 etc.).
 
  db.define_table('mytable', Field('myfield',
  label=IMG(_src=URL('static','img/myimage.png'
 
  Haven't tried it, but hopefully should work.
 
  Anthony
 
 
 
 
 
 
 
  On Friday, December 16, 2011 5:10:53 PM UTC-5, brushek wrote:
 
   Hello,
 
   I would like to have images instead of text (or text AND image) in
   each label for row, when I click edit in form generated by
   SQLFORM.grid. How to do this in easiest way ?
 
   Regards
   brushek



Re: [web2py] Web Resources

2011-12-17 Thread Javier Quarite
On Sat, Dec 17, 2011 at 10:51 AM, chandrakant kumar
k.03chan...@gmail.comwrote:

 Hi Javier

 I'm working on same, let me know if we can collaborate.



Really? Well I'm actually beginning with web2py, It just came as an idea
this project because I've seen others and also I was wondering how to do
something like that... if there's some questions... I hope you can help me
:)

Javier


[web2py] Re: the Set class should be deprecated

2011-12-17 Thread lyn2py
I'm new to web2py and python, but if this argument is purely
syntactic, I thought it would be
db(table.id  0).select()
rather than
(db.table.id  0).select()

Nonetheless, I'm good with what we have now, especially the ample
examples in the web2py book to help me get up to speed. DAL is great!


Re: [web2py] Re: book 4th edition in PDF

2011-12-17 Thread Angelo Compagnucci
I bought it!

Wonderful!

2011/12/17 Alan Etkin spame...@gmail.com

  I did not understand that point. What did you mean?

 Ok, now i get it:

 Do not download if other customer has not reported back yet

 And the watermark has to be the text in the footer.




-- 
Profile: http://www.gild.com/compagnucciangelo
Register on Gild: http://www.gild.com/referral/compagnucciangelo


[web2py] Re: book 4th edition in PDF

2011-12-17 Thread greenpoise
I get invalid expression in the card number...American express is the
card..I tried no spaces between numbers  - but is a no go.






On Dec 17, 8:43 am, Angelo Compagnucci angelo.compagnu...@gmail.com
wrote:
 I bought it!

 Wonderful!

 2011/12/17 Alan Etkin spame...@gmail.com

   I did not understand that point. What did you mean?

  Ok, now i get it:

  Do not download if other customer has not reported back yet

  And the watermark has to be the text in the footer.

 --
 Profile:http://www.gild.com/compagnucciangelo
 Register on Gild:http://www.gild.com/referral/compagnucciangelo


Re: [web2py] Re: book 4th edition in PDF

2011-12-17 Thread Günter Kolousek


No problems with Mastercard!

Cheers,
Günter

Am 2011-12-17 17:53, schrieb greenpoise:

I get invalid expression in the card number...American express is the
card..I tried no spaces between numbers  - but is a no go.






On Dec 17, 8:43 am, Angelo Compagnucciangelo.compagnu...@gmail.com
wrote:

I bought it!

Wonderful!

2011/12/17 Alan Etkinspame...@gmail.com


I did not understand that point. What did you mean?

Ok, now i get it:
Do not download if other customer has not reported back yet
And the watermark has to be the text in the footer.

--
Profile:http://www.gild.com/compagnucciangelo
Register on Gild:http://www.gild.com/referral/compagnucciangelo




[web2py] Re: the Set class should be deprecated

2011-12-17 Thread Alan Etkin
 @Alan Etkin
 Actually, (db.mytable.id == 3) is neither a tuple or a bool. The ==
 operator used on a field returns a Query object.

Yes, you are right, what i was trying to say is that this:

(a == b).select()

is more confusing to me than the normal web2py instruction because in
a python program the above sentence should call a method of a bool
object:

...Comparisons yield boolean values: True or False...


[web2py] Re: book 4th edition in PDF

2011-12-17 Thread Pepe Araya
Work for me.

thanks.


[web2py] Re: book 4th edition in PDF

2011-12-17 Thread Massimo Di Pierro
Good I think we can close this thread.

I may change the app link as I merge with the html version.
Possibly later today if I manage to dodge the holiday shopping.

Massimo



On Dec 17, 12:50 pm, Pepe Araya pepea...@gmail.com wrote:
 Work for me.

 thanks.


[web2py] Re: the Set class should be deprecated

2011-12-17 Thread Massimo Di Pierro
I am reading this over and over... a == b is a boolean. I know what
you mean but it may be confusing to other users so I will clarify.
It is a boolean when a and b have values, else it is just an
expression. In dal, a==b is a query (an expression) that is
evaluated on every record and if it returns true the record is
selected (not unlike SQL).

So in

db(a == b).select() or the proposed (a==b).select()

(a==b) does not return a boolean.

Massimo

On Dec 17, 11:36 am, Alan Etkin spame...@gmail.com wrote:
  @Alan Etkin
  Actually, (db.mytable.id == 3) is neither a tuple or a bool. The ==
  operator used on a field returns a Query object.

 Yes, you are right, what i was trying to say is that this:

 (a == b).select()

 is more confusing to me than the normal web2py instruction because in
 a python program the above sentence should call a method of a bool
 object:

 ...Comparisons yield boolean values: True or False...


[web2py] Re: smartgrid - still not resolving a problem

2011-12-17 Thread Adi
Thanks Anthony, delegate works perfectly fine :) I just saw somewhere too 
that live is being retired.. 

On top of everything I wanted to use the autocomplete feature instead of 
dropdown, but have to figure out the ways around when user selects the 
item, how to combine autocomplete events and this delegate... I'm not there 
yet. Struggle, at it's best :) 

Otherwise, Massimo and other contributors, I truly think this is the best 
web framework! 

Adi


[web2py] Re: book 4th edition in PDF

2011-12-17 Thread Adi
amex - invalid expression. should i wait, or to use other card? 

[web2py] how to set the id of a textarea of a SQLFORM?

2011-12-17 Thread Pepe Araya
Hello!

is possible to set the id of a textarea of a SQLFORM?

I have 2 forms on the same page but the textarea of both have the same 
id... 

thanks


[web2py] Re: smartgrid - still not resolving a problem

2011-12-17 Thread Massimo Di Pierro
We have this line in web2py.js:

jQuery(input[type='checkbox'].delete, target).live('click',function()
{ if(this.checked) if(!confirm(confirm_message))
this.checked=false; });

what should be change it into?

On Dec 16, 8:57 pm, Anthony abasta...@gmail.com wrote:
 On Friday, December 16, 2011 5:54:54 PM UTC-5, Cliff wrote:

  Adi,

      $(#po_sku_sku_id).change(function(event){

  could also be

      $(#po_sku_sku_id).live('change', function(event){

  In case the user changes it a second or third time.

 I'm not a jQuery expert, but I think the .change() handler will trigger on
 every change event. The purpose of .live() is to allow the handler to be
 added to elements that are not originally in the DOM at the time the
 handler is defined but added dynamically at a later time (which I don't
 think applies in this case). In any case, jQuery now recommends using .on()
 instead of .live() as of 1.7, and .delegate() rather than .live() in older
 versions (in other words, avoid .live).

 Anthony


[web2py] Re: book 4th edition in PDF

2011-12-17 Thread Massimo Di Pierro
I forgot amex has 15 digits cc numbers. I do not have ssh connection
at this time. I will fix this tonight.

On Dec 17, 1:46 pm, Adi adnan.smajlo...@gmail.com wrote:
 amex - invalid expression. should i wait, or to use other card?


[web2py] Re: smartgrid - still not resolving a problem

2011-12-17 Thread Anthony
On Saturday, December 17, 2011 3:36:59 PM UTC-5, Massimo Di Pierro wrote:

 We have this line in web2py.js:

 jQuery(input[type='checkbox'].delete, target).live('click',function()
 { if(this.checked) if(!confirm(confirm_message))
 this.checked=false; });

Actually, in this case (as with the other event handlers in web2py.js), we 
don't want to use .live, .delegate, or .on. If we use any of those, when 
Ajax components load in the page, they will get two versions of the event 
handler (one from the parent document, and one from their target div). So, 
instead, we should just use:

.click(function() ...

Anthony 


[web2py] Re: SQLFORM.grid custom labels in edit form for each row

2011-12-17 Thread brushek
 The bug isn't with LABEL, it's with SQLFORM.search_menu, which tries to
 translate field.label without first converting to a string in case the
 label is an HTML helper.

 Should be an easy fix, but for now, you can do:

 label=str(IMG(...))

 or

 label=IMG(...).xml()

None of this soulutions works :(. I mean, the app doesn't crash, but I
can see the text:

img alt=Woda src=/sdadmin/static/img_towary/1.png /

in label of row, but no image, it isn't that what I want.

I tried:
Field('tw1','integer',label=str(IMG(_alt='Woda',_src=URL('static','img_towary/
1.png',
and:
Field('tw1','integer',label=IMG(_alt='Woda',_src=URL('static','img_towary/
1.png')).xml()),



 either of which will convert the HTML helper to a string, so it won't cause
 an error with the translator.


Indeed, but as You can see above, the output isn't image.

 Also, note that you shouldn't need the LABEL wrapper -- in SQLFORMs, the
 labels are automatically wrapped in a LABEL().


I need LABEL to make label with text AND image, and it works in:

/app/default/planetysurowce/edit/gk_planety/1

but not in:

/app/default/planetysurowce

where grid is computed.

Anyway, thanks Anthony, I think (as You said) it will be quick fix,
and all the stuff will work :)

regards
brushek


[web2py] Re: book 4th edition in PDF

2011-12-17 Thread davidjensen
I buy ebooks from the internet commonly. Amazon, Barnes and Noble and
book publishers put table of contents, index, sample chapters,
surprise me, etc.  I did not see any of those on the site. Also, it
appears that many ebooks are going to epub.  I am experimenting with
NLP, the semantic web and others on my ebooks and I have tried only
epubs and not pdf because I assume I do not have the ability to
analyze pdfs the way I can analyze with epubs (in Python). Also, $10
is a low enough price so that people would not worry about the cost. I
do not know what the problems of using epub are from a publishers
point of view.

On Dec 17, 4:41 pm, Massimo Di Pierro massimo.dipie...@gmail.com
wrote:
 I forgot amex has 15 digits cc numbers. I do not have ssh connection
 at this time. I will fix this tonight.

 On Dec 17, 1:46 pm, Adi adnan.smajlo...@gmail.com wrote:







  amex - invalid expression. should i wait, or to use other card?


[web2py] Re: book 4th edition in PDF

2011-12-17 Thread davidjensen
Addendum: It would be nice to see it on Safari.

On Dec 17, 4:41 pm, Massimo Di Pierro massimo.dipie...@gmail.com
wrote:
 I forgot amex has 15 digits cc numbers. I do not have ssh connection
 at this time. I will fix this tonight.

 On Dec 17, 1:46 pm, Adi adnan.smajlo...@gmail.com wrote:







  amex - invalid expression. should i wait, or to use other card?


[web2py] Re: book 4th edition in PDF

2011-12-17 Thread Adi
got it w visa :) Thanks Massimo!

[web2py] application can't find modules on fluxflex.com

2011-12-17 Thread ma...@rockiger.com
Hi I have a strange error:

I uploaded the web2py-book application via git to my fluxflex account and I 
get the following error message:

type 'exceptions.ImportError' No module named plugin_notemptymarker


If I look in the app admin indeed the  plugin_notemptymarker.py file is not 
shown under modules. So I uploaded
the file manually. The upload workd, but I still can't see the file in the 
app-admin. (see. pic 
http://imageshack.us/photo/my-images/836/auswahl001m.jpg/)

http://img836.imageshack.us/img836/3372/auswahl001m.jpg


Then I tested the following commands in the web2py shell:


In [8] : print commands
module 'commands' from '/usr/lib/python2.7/commands.pyc'

In [9] : print commands.getoutput('ls applications/book/modules')
plugin_notemptymarker.py

It seems the file is there.

web2py version is 1.99.4.

Does anybode have an idea where the problem could be?

Any help would be very appreciated.


Regards
Marco


[web2py] Re: how to set the id of a textarea of a SQLFORM?

2011-12-17 Thread Alan Etkin
Once you have the object returned by SQLFORM(..), it can be explored
with the method elements() wich returns a list of objects contained in
the form. So you could iterate trough the list, and if the element is
of type gluon.html.TEXTAREA, customize it with something like this:

sub-element.attributes[_id] = number

or

sub_element.update(_id=number)

Note the use of a _ character before the attribute name, used to set
tag attributes

Not sure if this is the simpler approach but should work

On 17 dic, 17:36, Pepe Araya pepea...@gmail.com wrote:
 Hello!

 is possible to set the id of a textarea of a SQLFORM?

 I have 2 forms on the same page but the textarea of both have the same
 id...

 thanks


[web2py] Re: book 4th edition in PDF

2011-12-17 Thread Massimo Di Pierro
generating epubs is next on the list. The plan is to allow to download
you different formars once you buy one... work in progress

On Dec 17, 4:10 pm, davidjensen davidjensen...@gmail.com wrote:
 I buy ebooks from the internet commonly. Amazon, Barnes and Noble and
 book publishers put table of contents, index, sample chapters,
 surprise me, etc.  I did not see any of those on the site. Also, it
 appears that many ebooks are going to epub.  I am experimenting with
 NLP, the semantic web and others on my ebooks and I have tried only
 epubs and not pdf because I assume I do not have the ability to
 analyze pdfs the way I can analyze with epubs (in Python). Also, $10
 is a low enough price so that people would not worry about the cost. I
 do not know what the problems of using epub are from a publishers
 point of view.

 On Dec 17, 4:41 pm, Massimo Di Pierro massimo.dipie...@gmail.com
 wrote:







  I forgot amex has 15 digits cc numbers. I do not have ssh connection
  at this time. I will fix this tonight.

  On Dec 17, 1:46 pm, Adi adnan.smajlo...@gmail.com wrote:

   amex - invalid expression. should i wait, or to use other card?


[web2py] Re: book 4th edition in PDF

2011-12-17 Thread Massimo Di Pierro
Should now work with Amex.

On Dec 17, 1:46 pm, Adi adnan.smajlo...@gmail.com wrote:
 amex - invalid expression. should i wait, or to use other card?


[web2py] Re: smartgrid - still not resolving a problem

2011-12-17 Thread Massimo Di Pierro
It was click. I switched to live because click broke
jquery.checkboxes.js plugin which I found very useful for something I
am building.

On Dec 17, 3:05 pm, Anthony abasta...@gmail.com wrote:
 On Saturday, December 17, 2011 3:36:59 PM UTC-5, Massimo Di Pierro wrote:

  We have this line in web2py.js:

  jQuery(input[type='checkbox'].delete, target).live('click',function()
  { if(this.checked) if(!confirm(confirm_message))
  this.checked=false; });

 Actually, in this case (as with the other event handlers in web2py.js), we
 don't want to use .live, .delegate, or .on. If we use any of those, when
 Ajax components load in the page, they will get two versions of the event
 handler (one from the parent document, and one from their target div). So,
 instead, we should just use:

 .click(function() ...

 Anthony


[web2py] bug in changeset # d027fbf7601d http://code.google.com/p/web2py/issues/detail?id=355

2011-12-17 Thread Carlos
Hi,

I'm getting the following traceback after applying changeset # d027fbf7601d 
 http://code.google.com/p/web2py/issues/detail?id=355 ...

Traceback (most recent call last):
  File C:\web2py\gluon\main.py, line 523, in wsgibase
session._try_store_on_disk(request, response)
  File C:\web2py\gluon\globals.py, line 591, in _try_store_on_disk
cPickle.dump(dict(self), response.session_file)
  File C:\Python26\lib\copy_reg.py, line 74, in _reduce_ex
getstate = self.__getstate__
  File C:\web2py\gluon\dal.py, line 5542, in __getattr__
return self[key]
  File C:\web2py\gluon\dal.py, line 5482, in __getitem__
return dict.__getitem__(self, str(key))
KeyError: '__getstate__'

This occurs at login, is this a bug or should I change something in my 
configuration?.

I'm using latest trunk, with postgresql on win 7.

Thanks,

   Carlos



[web2py] question about google app engine blob property

2011-12-17 Thread chawk
I am trying to build an app for google app engine.  I currently use
the auth_user for website registration.   I added some extra fields to
the registration.  I was trying to add an additional auth_user field
for avatar file upload.  it appears that this will conflict with
google blob property.  Does anybody have a suggestion on how I could
go about having a user upload a profile image through auth_user
without causing problems with app engine db?


chawk


[web2py] Re: SQLFORM.grid custom labels in edit form for each row

2011-12-17 Thread Anthony
Sorry, forgot that the label will get escaped. Anyway, there is now a fix 
in trunk.

On Saturday, December 17, 2011 4:58:49 PM UTC-5, brushek wrote:

  The bug isn't with LABEL, it's with SQLFORM.search_menu, which tries to
  translate field.label without first converting to a string in case the
  label is an HTML helper.
 
  Should be an easy fix, but for now, you can do:
 
  label=str(IMG(...))
 
  or
 
  label=IMG(...).xml()

 None of this soulutions works :(. I mean, the app doesn't crash, but I
 can see the text:

 img alt=Woda src=/sdadmin/static/img_towary/1.png /

 in label of row, but no image, it isn't that what I want.

 I tried:

 Field('tw1','integer',label=str(IMG(_alt='Woda',_src=URL('static','img_towary/
 1.png',
 and:
 Field('tw1','integer',label=IMG(_alt='Woda',_src=URL('static','img_towary/
 1.png')).xml()),


 
  either of which will convert the HTML helper to a string, so it won't 
 cause
  an error with the translator.
 

 Indeed, but as You can see above, the output isn't image.

  Also, note that you shouldn't need the LABEL wrapper -- in SQLFORMs, the
  labels are automatically wrapped in a LABEL().
 

 I need LABEL to make label with text AND image, and it works in:

 /app/default/planetysurowce/edit/gk_planety/1

 but not in:

 /app/default/planetysurowce

 where grid is computed.

 Anyway, thanks Anthony, I think (as You said) it will be quick fix,
 and all the stuff will work :)

 regards
 brushek



[web2py] Re: smartgrid - still not resolving a problem

2011-12-17 Thread Anthony
On Saturday, December 17, 2011 7:46:51 PM UTC-5, Massimo Di Pierro wrote:

 It was click. I switched to live because click broke
 jquery.checkboxes.js plugin which I found very useful for something I
 am building.


How did it break? Do you need the event handler to attach to elements that 
are dynamically added to the DOM after the initial page load? In that case, 
we may need a more sophisticated solution.

Anthony



[web2py] Problem with form submission in nested components

2011-12-17 Thread monotasker
I have a SQLFORM in a component that works smoothly. I'm placing another 
component inside that form, which loads just fine. But with that nested 
component present the form is no longer processed properly. The POST values 
(visible in Firebug) are all identical, whether or not the nested component 
is there. But the form just doesn't process properly. I always get a 
form.error thrown. So the problem is not in collecting the values from the 
form fields. It's on the processing side. Can anyone think of a reason this 
would happen?




[web2py] Re: Problem with form submission in nested components

2011-12-17 Thread monotasker
I thought some code might help. Here's the class that creates the LOAD 
helper to hold a form field widget:

class AjaxSelect:

def __init__(self, field, value, linktable):
self.field = field
self.value = value
self.linktable = linktable

def widget(self):
# initialize LOAD helper
environment = {
'request': current.request,
'response': current.response}
LOAD = LoadFactory(environment)

#get field and tablenames for element id's
fieldset = str(self.field).split('.')
tablename = fieldset[0]
fieldname = fieldset[1]

loadname = '%s_%s_loader' %(tablename, fieldname)

#create component wrapper with ajax loading helper
wrapper = LOAD('plugin_ajaxselect', 'set_widget.load',
args=[tablename, fieldname, self.value, self.linktable, 
loadname], ajax=True, target=loadname)

return wrapper



And here's the controller that actually builds the widget:

table = request.args[0]
field = request.args[1]
value = request.args[2]
linktable = request.args[3]
loadname = request.args[4]

the_table = db[table]
the_field = the_table[field]
the_linktable = db[linktable]

w = OptionsWidget.widget(the_field, value)

#create button to refresh component
bid = table + '_' + field + '_refresher'
comp_url = URL('plugin_ajaxselect', 'set_widget.load', args=[table, 
field, value, linktable, loadname])
button = A('refresh', _href=comp_url, cid=request.cid)

return dict(widget = w, button = button) 


[web2py] Re: question about google app engine blob property

2011-12-17 Thread Massimo Di Pierro
Can you shows us exactly which extra field causes the conflict?

Massimo

On Dec 17, 8:09 pm, chawk chrshawke...@gmail.com wrote:
 I am trying to build an app for google app engine.  I currently use
 the auth_user for website registration.   I added some extra fields to
 the registration.  I was trying to add an additional auth_user field
 for avatar file upload.  it appears that this will conflict with
 google blob property.  Does anybody have a suggestion on how I could
 go about having a user upload a profile image through auth_user
 without causing problems with app engine db?

 chawk


[web2py] Re: smartgrid - still not resolving a problem

2011-12-17 Thread Massimo Di Pierro
The jquery.checkbox plugin replaces the usual checkbox with a [yes]/
[no] slider. If I replace 'slide' with 'click' the [yes]/[no] behaves
the opposite way (yes for unchecked and no for checked). weird.

On Dec 17, 8:17 pm, Anthony abasta...@gmail.com wrote:
 On Saturday, December 17, 2011 7:46:51 PM UTC-5, Massimo Di Pierro wrote:

  It was click. I switched to live because click broke
  jquery.checkboxes.js plugin which I found very useful for something I
  am building.

 How did it break? Do you need the event handler to attach to elements that
 are dynamically added to the DOM after the initial page load? In that case,
 we may need a more sophisticated solution.

 Anthony


[web2py] Re: bug in changeset # d027fbf7601d http://code.google.com/p/web2py/issues/detail?id=355

2011-12-17 Thread Massimo Di Pierro
I reverted the change until it is tested more.

On Dec 17, 7:32 pm, Carlos carlosgali...@gmail.com wrote:
 Hi,

 I'm getting the following traceback after applying changeset # d027fbf7601d

 http://code.google.com/p/web2py/issues/detail?id=355...

 Traceback (most recent call last):
   File C:\web2py\gluon\main.py, line 523, in wsgibase
     session._try_store_on_disk(request, response)
   File C:\web2py\gluon\globals.py, line 591, in _try_store_on_disk
     cPickle.dump(dict(self), response.session_file)
   File C:\Python26\lib\copy_reg.py, line 74, in _reduce_ex
     getstate = self.__getstate__
   File C:\web2py\gluon\dal.py, line 5542, in __getattr__
     return self[key]
   File C:\web2py\gluon\dal.py, line 5482, in __getitem__
     return dict.__getitem__(self, str(key))
 KeyError: '__getstate__'

 This occurs at login, is this a bug or should I change something in my
 configuration?.

 I'm using latest trunk, with postgresql on win 7.

 Thanks,

    Carlos


[web2py] Re: bug in changeset # d027fbf7601d http://code.google.com/p/web2py/issues/detail?id=355

2011-12-17 Thread Massimo Di Pierro
Are you using virtual fields or storing functions in auth.user?

Massimo

On Dec 17, 7:32 pm, Carlos carlosgali...@gmail.com wrote:
 Hi,

 I'm getting the following traceback after applying changeset # d027fbf7601d

 http://code.google.com/p/web2py/issues/detail?id=355...

 Traceback (most recent call last):
   File C:\web2py\gluon\main.py, line 523, in wsgibase
     session._try_store_on_disk(request, response)
   File C:\web2py\gluon\globals.py, line 591, in _try_store_on_disk
     cPickle.dump(dict(self), response.session_file)
   File C:\Python26\lib\copy_reg.py, line 74, in _reduce_ex
     getstate = self.__getstate__
   File C:\web2py\gluon\dal.py, line 5542, in __getattr__
     return self[key]
   File C:\web2py\gluon\dal.py, line 5482, in __getitem__
     return dict.__getitem__(self, str(key))
 KeyError: '__getstate__'

 This occurs at login, is this a bug or should I change something in my
 configuration?.

 I'm using latest trunk, with postgresql on win 7.

 Thanks,

    Carlos


[web2py] Re: bug in changeset # d027fbf7601d http://code.google.com/p/web2py/issues/detail?id=355

2011-12-17 Thread Carlos
Hi Massimo,

Yes I'm using virtual lazy fields in the user table.

   Carlos



[web2py] nice article on web2py

2011-12-17 Thread Massimo Di Pierro
http://pixelturf.com/2011/12/15/if-python/

:-)


[web2py] Postgres LIKE case sensitive

2011-12-17 Thread Floyd
Hello everybody,
I found that using .like() method with Postgresql actually perform a case 
insensitive search (it uses ILIKE not LIKE). I read an old thread stating 
that this is for compatibility issues with mySql. I have a very big table 
with text field in upper-case so I don't need ILIKE but any searche with 
.like() takes at least 8 time longer than it should with LIKE. 
Obviously I can change the ILIKE with LIKE in dal.py code to make it works 
or make a custom SELECT with .executlsql(). But would be possible to add an 
optional parameter in the .like() method to choose case-sensitive search 
(something like casesensitive=True)? This would not break compatibility or 
portability because the default would remain case-insensitive.

Bye,
Giovanni



[web2py] Re: Postgres LIKE case sensitive

2011-12-17 Thread Massimo Di Pierro
Not very easy because the dal does implement a mechanism to pass
parameters to adapter when delegating a function. Let me think about
this... meanwhile please open an issue so your propose will be
tracked.

massimo

On Dec 17, 11:58 pm, Floyd canna...@gmail.com wrote:
 Hello everybody,
 I found that using .like() method with Postgresql actually perform a case
 insensitive search (it uses ILIKE not LIKE). I read an old thread stating
 that this is for compatibility issues with mySql. I have a very big table
 with text field in upper-case so I don't need ILIKE but any searche with
 .like() takes at least 8 time longer than it should with LIKE.
 Obviously I can change the ILIKE with LIKE in dal.py code to make it works
 or make a custom SELECT with .executlsql(). But would be possible to add an
 optional parameter in the .like() method to choose case-sensitive search
 (something like casesensitive=True)? This would not break compatibility or
 portability because the default would remain case-insensitive.

 Bye,
 Giovanni