Re: [web2py] Re: import_from_csv_file broken

2012-02-16 Thread Ron McOuat
Looked in the DAL section of the manual, looks like you need to open the 
file and supply the File object as the parameter to 
db.table.import_from_csv(...)

You can serialize a single table in CSV and store it in a file test.csv: 

1.

 open('test.csv', 'w').write(str(db(db.person.id).select()))

and you can easily read it back with: 

1.

 db.person.import_from_csv_file(open('test.csv', 'r'))

Sorry I missed that first time.

Ron



[web2py] Re: Current status of adapting OrientDB for web2py

2012-02-16 Thread David Marko
I would also appreciate some hints on what libraries do you use to 
communicate with orientDB, or can you create some simple appliance as demo?

Thanks!
David


[web2py] Re: import_from_csv_file broken

2012-02-16 Thread Simon Lukell
not sure if there is a difference in the resulting file, but I usually
use db.category.export_to_csv_file(open(...))

On Feb 16, 3:24 pm, Richard Penman richar...@gmail.com wrote:
 I exported a table from sqlite with:
 open(filename, 'w').write(str(db(db.category.id).select()))

 Output file looks as expected.

 And then I tried importing into postgres with:
 db.category.import_from_csv_file(filename)

 Each row was inserted but all values are NULL.
 Any ideas?

 Version 1.99.4


[web2py] Re: sqlhtml.py - breadcrumbs exception when using smartgrid format + lambda

2012-02-16 Thread Roderick
Hi Massimo and Anthony

Created the following issue:
http://code.google.com/p/web2py/issues/detail?id=663

Unfortunately the fix doesn't work on the breadcrumbs - still getting
the index - although it does work on row data...

Thanks  regards,

Roderick

On Feb 14, 4:44 pm, Massimo Di Pierro massimo.dipie...@gmail.com
wrote:
 Thanks fixed in trunk now.

 On Feb 14, 6:18 am, Roderick roderick.m...@gmail.com wrote:







  Being a noob at Python and Web2py, this is the best I could come up with:

  In sqlhtml.py, insert the 2nd try block (below name = db[referee]._format
  % record) as follows:

                      try:
                          name = db[referee]._format % record
                      except TypeError:
                          try:
                              name = db[referee]._format(record)
                          except TypeError:
                              name = id

  This seems to work for format=%(name)s and format=lambda record:
  record.name formats.

  If anyone has a better/cleaner solution I'd like to hear it..

  Thanks!


[web2py] Re: Implementing task queue using web2py

2012-02-16 Thread Saurabh S
Now the task queue is working fine. I have another problem. I am
generating a csv file.. Now since its running at background there will
not be any popup so I want to attach the file as an attachment in mail
and send or store the file in blobstore and send the link to user.

This is my code:

def report_download(result, colnames):
import cStringIO
stream = cStringIO.StringIO()
logging.info('Before sending to render_report_csv')
render_report_csv(stream, result, colnames=colnames)
logging.info('After render_report_csv')
filename = '%s-%s-%s.csv' % (request.function, request.args(0),
request.now)
logging.info(filename)
response.headers['Content-Type'] = 'text/csv'
response.headers['Content-Disposition'] = 'attachment; filename=
%s' % filename
logging.info('print stream')
mail.send(to='rohit.agumbe.ram...@accenture.com', subject='Report
Download',message='')

return stream.getvalue()

please suggest me on how to attach the csv to mail or get the blob url
of file stored in blob

Thanks

On Feb 14, 9:08 pm, Christian Foster Howes how...@umich.edu wrote:
 what is the error in the logs when the task fails?  what is the URL
 shown in the task list?  something is either amok with the URL itself,
 or something is causing that function to fail when called via the task
 queue.

 On 2/13/12 20:05 , Saurabh S wrote:



  It worked when I passed a different controller in the url other than
  the one it is being called from.

  It is production.
  I checked the task queue it simply retries continuously if the same
  controller is provided.
  No params is not a mandatory argument to takqueue.add() I guess.
  Because it does not throw any syntax error if not provided.

  On Feb 10, 8:52 pm, howeschow...@umich.edu  wrote:
  some questions/thoughts:

    - local test server or production?
    - did you check the task queue?  in production go to the admin console 
  and
  find the task queues link.  in local test go to /_ah/admin and find the
  task queue link
    - is params a required argument to taskqueue.add()?  i don't know if i
  always use it cause i need it or cause it is required.


[web2py] mongrel2 + uwsgi + web2py

2012-02-16 Thread Anthon
I had some difficulty getting the mongrel2 + uwsgi + web2py to work because 
uwsgi was not setting all of the environment variables that web2py was 
expecting.

With uWSGI 1.1 some improvements will be made, but e.g. web2py logging is 
depending on REMOTE_ADDRESS and this is not set by uWSGI and web2py fails 
silently.

The attached diff should make things work with older versions of uWSGI as 
well ( I tested 1.0.2.1, 1.0.4 and 1.1-dev-1996)
diff -r 7f492ab789a9 gluon/main.py
--- a/gluon/main.py	Thu Feb 16 10:31:35 2012 +0100
+++ b/gluon/main.py	Thu Feb 16 10:36:42 2012 +0100
@@ -355,6 +355,7 @@
 try:
 try:
 # ##
+# handle uWSGI incorrect/missing environ vars
 # handle fcgi missing path_info and query_string
 # select rewrite parameters
 # rewrite incoming URL
@@ -362,6 +363,21 @@
 # parse rewritten URL
 # serve file if static
 # ##
+		uwsgi = environ.get('uwsgi.version')
+		if uwsgi:
+		uwsgi_version = []
+		for x in uwsgi.split('.'):
+			for y in x.split('-'):
+			if y == 'dev':
+y = -1
+			uwsgi_version.append(int(y))
+		if uwsgi and uwsgi_version  [1, 1, -1, 1996]:
+		# handles uWSGI broken path_info AND missing QUERY_STRING
+		environ['PATH_INFO'] = ''
+		if uwsgi and not environ.get('REMOTE_ADDR'):
+# REMOTE_ADDR is used for logging, which silently fails
+		environ['REMOTE_ADDR'] = environ.get('HTTP_X_FORWARDED_FOR',
+		 'address.unknown')
 
 if not environ.get('PATH_INFO',None) and \
 environ.get('REQUEST_URI',None):


[web2py] Video site : Should i use AWS cloudfront just web2py?

2012-02-16 Thread Anaconda
I need some advice, i notice that web2py has streaming by default,
therefore should i just use web2py to stream the video files or use
CloudFront? Which option would allow better scalability and pricing?

Thanks in advance as it is my first video site!


Re: [web2py] Re: OFF Topic - Business inteligence in Python, web2py?

2012-02-16 Thread Michele Comitini
This article even if old can be useful:
http://www.information-management.com/issues/20060601/1088417-1.html?zkPrintable=1nopagination=1

The python+R+postgesql combination is very powerful, but you are
expected to know very well the math+statistics behind your needs.

mic


2012/2/16 Adi adnan.smajlo...@gmail.com:
 QlikView is not written in python, but I see they talk about integration on
 their community pages:
 http://community.qlikview.com/community/development?view=tagstags=python




[web2py] ReportLab with StringIO

2012-02-16 Thread Martin Weissenboeck
This is the whole example for ReportLab using StringIO, chapter 10.3.3 in
the book:

# delete lines starting with #

from reportlab.platypus import *
from reportlab.lib.styles import getSampleStyleSheet
from reportlab.rl_config import defaultPageSize
from reportlab.lib.units import inch, mm
from reportlab.lib.enums import TA_LEFT, TA_RIGHT, TA_CENTER, TA_JUSTIFY
from reportlab.lib import colors
*# from uuid import uuid4*
from cgi import escape
*# import os*
*import StringIO*

def get_me_a_pdf():
*out = StringIO.StringIO()*
title = This The Doc Title
heading = First Paragraph
text = 'bla '* 1

styles = getSampleStyleSheet()
*# tmpfilename=os.path.join(request.folder,'private',str(uuid4()))
*doc = SimpleDocTemplate(*out*)
story = []
story.append(Paragraph(escape(title),styles[Title]))
story.append(Paragraph(escape(heading),styles[Heading2]))
story.append(Paragraph(escape(text),styles[Normal]))
story.append(Spacer(1,2*inch))
doc.build(story)
*# data = open(tmpfilename,rb).read()*
*data = out.getvalue()
#** os.unlink(tmpfilename)*
*out.close()*
response.headers['Content-Type']='application/pdf'
return data

Regards, Martin


[web2py] Re: jQuery UI multiselect

2012-02-16 Thread Alan Etkin
So it seems that you need to retrieve a select element with options
via ajax somewhere in the page's javascript, instead of a json data
payload, and place it in the document dinamically. I think that you
could modify the controller to return a select object with a .load
view and then append it to the document using the web2py.js javascript
function web2py_ajax_page('get',action,null,target)

action is the .load url that returns the raw html string
target is the id reference of the container tag.

the .load view should create the needed tags with helpers and the
database data with something like:

{{ =SELECT(*[OPTION(...) for option in options]) }}

On 15 feb, 13:37, Annet anneve...@googlemail.com wrote:
 Hi Alan,

 Thanks for your reply.

 .multiselect() and .autocomplete() are jQuery functions. .autocomplete
 works, the locality_autocomplete() function in the hubaddressbook
 controller provides a list: [Amsterdam, Rotterdam, Utrecht]
 which is alright for the jQuery UI autocomplete.

 .multiselect() needs this:

 select id=word name=word multiple=multiple
 option value=1Option 1/option
 option value=2Option 2/option
 option value=3Option 3/option
 option value=4Option 4/option
 option value=5Option 5/option
 /select

 See:http://www.erichynds.com/jquery/jquery-ui-multiselect-widget/

 ... which is what list:reference provides, however, list:reference
 needs a table and in my case the options are the fields of a multiple
 fields table.

 I hope I provided sufficient information to help me solve the problem.

 Kind regards,

 Annet


[web2py] Re: My new site powered by Web2Py

2012-02-16 Thread Matt Doiron
Thanks all!
Seems you found the site, even though I forgot to post an actual link! Here 
is a link just in case: http://queuebot.com


[web2py] Re: Instalação do badmin

2012-02-16 Thread CalBR
Mas foi exatamente isso que eu tinha feito e não funcionou:
- coloquei o controller badmin.py como plugin_badmin.py no diretório
\controllers
- coloquei as views no sub-diretório plugin_bandmin dentro de \views
- coloquei o subdiretório plugin_badmin em \static

Abs
Ciro


On 15 fev, 20:25, Bruno Rocha rochacbr...@gmail.com wrote:
 2012/2/15 Ciro cal...@gmail.com

  badmin/index

 se você renomeu para plugin_

 então tente

 plugin_badmin/index

 --

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


Re: [web2py] Re: How to Generate the effective report by using web2py

2012-02-16 Thread Ross Peoples
I had to write a lot of code to get FPDF to do proper headers, footers, and 
page numbers. Then about another 100 lines of code to get it to wrap long 
lines of text inside of a table. I'm also not using HTML to PDF conversion. 
I am using FPDF's methods to create PDFs. If I recall correctly, I tried to 
use paragraphs and even new line characters to force the line to break, but 
ended up having to use absolute positioning for the lines. It sounds 
terrible, I know, but I have been using this successfully for a little 
while. I basically wrote a module that takes a query (just like 
SQLFORM.grid) and generates a PDF with headers, footers, a logo, and can 
even group data into multiple tables, all while wrapping long text and 
repeating column headers on each new page. It was a lot of work, but the 
reports look pretty good.

Mariano, what about FPDF are you planning on updating? And are you planning 
to break backwards-compatibility?


[web2py] Re: Associative Table

2012-02-16 Thread Ross Peoples
Good practice says you should ALWAYS have an identity (ID) field, even if 
you don't use it.

Re: [web2py] Re: Instalação do badmin

2012-02-16 Thread Vinicius Assef
Ciro, eu instalei o plugin pela interface administrativa do admin do web2py.

Comigo funcionou.
Tente acessar como http://localhost:8000/sua_aplicacao/plugin_badmin/index



2012/2/15 Ciro cal...@gmail.com:
 Vinicius,

 Segui as instruções do manual:
 - Transferi os arquivos e diretórios, acrescentando o prefixo
 plugin_,
 - Criei o grupo e dei permissão para mim mesmo.

 Quando tento acesso recebo a seguinte msg de erro: invalid controller
 (badmin/index).

 Alguma sugestão?
 Ciro

 On 15 fev, 12:25, Vinicius Assef vinicius...@gmail.com wrote:
 Ciro,
 instale-o como um plugin. Qualquer dúvida, o manual do web2py te ajuda nisso.

 Para usar obadminvc precisa estar logado na aplicação. Siga as
 instruções que estão no README dele, dando permissão ao usuário que vc
 vai logar para usar obadmin.

 É só isso.

 --
 Vinicius Assef

 2012/2/14 CalBR calb...@gmail.com:







  Salve Pessoal

  Eu quero testar obadminmas não sei como instalar esse plugin na
  minha aplicação. Pedi ajuda ao desenvolvedor mas ele não respondeu.
  Alguém poderia me dar instruções tão detalhadas quanto possível pois
  será a primeira vez que farei esse tipo de instalação no web2py.

  Obrigado
  Ciro


[web2py] Web2py upload behind apache mod proxy

2012-02-16 Thread Álvaro J . Iradier
Hi,

I have a testing web2py environment running on a system on port 8000,
and then apache2 using mod_proxy to redirect requests to a virtual
host on port 80 to the web2py rocket server. This is the apache config
for the vhost:

---

VirtualHost *:80
 ...

  Proxy *
Order deny,allow
Allow from all
  /Proxy

  ProxyPass / http://127.0.0.1:8000/
  ProxyPassReverse / http://127.0.0.1:8000/

/VirtualHost

---

When I upload a file to a form, I get this error from the Framework:

Traceback (most recent call last):
  File /var/www/web2py_klnetcenter/gluon/main.py, line 447, in
wsgibase
parse_get_post_vars(request, environ)
  File /var/www/web2py_klnetcenter/gluon/main.py, line 275, in
parse_get_post_vars
request.body = copystream_progress(request) ### stores request
body
  File /var/www/web2py_klnetcenter/gluon/main.py, line 143, in
copystream_progress
copystream(source, dest, size, chunk_size)
  File /var/www/web2py_klnetcenter/gluon/fileutils.py, line 376, in
copystream
data = src.read(chunk_size)
  File /usr/lib/python2.6/socket.py, line 353, in read
data = self._sock.recv(left)
timeout: timed out

It seems to be happening even before my controler is run, just when
receiving the post variables. ¿Any idea what might be wrong?

Thanks very much.


[web2py] web2pyfied jQuery interfface

2012-02-16 Thread Alan Etkin
What if web2py provided an in-the-middle interface to web2pyify jQuery
features and, where possible, unify the usual server-side command
syntax of the web2py apps?

I am aware that web2py currently supports a set of javascript
functions that handle jQuery and other javascript-related stuff, but I
am talking about a more extensive set of javascript tools, as for
example.

-accessing safe data in storage objects client-side.
-query the database with a client pseudo DAL instance
-perhaps javascript helper and validator classes?
-cannot think of anything else by now, but surely there has to be
more.

Note that this not a enhancement request or defect report, I just
wanted to share the issue to know if this would be a good feature or
not, wheter this is or is not suited for the framework design, or if
this kind of features would follow good software practices or it
wouldn't.


Re: [web2py] Re: How to Generate the effective report by using web2py

2012-02-16 Thread Sanjeet Kumar
Ross Can you send me the CODE for that thanks in advance because i want to
generate the report properly through FPDF.

On Thu, Feb 16, 2012 at 6:31 PM, Ross Peoples ross.peop...@gmail.comwrote:

 I had to write a lot of code to get FPDF to do proper headers, footers,
 and page numbers. Then about another 100 lines of code to get it to wrap
 long lines of text inside of a table. I'm also not using HTML to PDF
 conversion. I am using FPDF's methods to create PDFs. If I recall
 correctly, I tried to use paragraphs and even new line characters to force
 the line to break, but ended up having to use absolute positioning for the
 lines. It sounds terrible, I know, but I have been using this successfully
 for a little while. I basically wrote a module that takes a query (just
 like SQLFORM.grid) and generates a PDF with headers, footers, a logo, and
 can even group data into multiple tables, all while wrapping long text and
 repeating column headers on each new page. It was a lot of work, but the
 reports look pretty good.

 Mariano, what about FPDF are you planning on updating? And are you
 planning to break backwards-compatibility?



[web2py] Re: jQuery UI multiselect

2012-02-16 Thread Alan Etkin
Wait, you mean you must return a field name option list?

Then you can query the DAL table to return the list of field names:

field_names = db.mytable.fields

On 15 feb, 13:37, Annet anneve...@googlemail.com wrote:
 Hi Alan,

 Thanks for your reply.

 .multiselect() and .autocomplete() are jQuery functions. .autocomplete
 works, the locality_autocomplete() function in the hubaddressbook
 controller provides a list: [Amsterdam, Rotterdam, Utrecht]
 which is alright for the jQuery UI autocomplete.

 .multiselect() needs this:

 select id=word name=word multiple=multiple
 option value=1Option 1/option
 option value=2Option 2/option
 option value=3Option 3/option
 option value=4Option 4/option
 option value=5Option 5/option
 /select

 See:http://www.erichynds.com/jquery/jquery-ui-multiselect-widget/

 ... which is what list:reference provides, however, list:reference
 needs a table and in my case the options are the fields of a multiple
 fields table.

 I hope I provided sufficient information to help me solve the problem.

 Kind regards,

 Annet


[web2py] Re: Video site : Should i use AWS cloudfront just web2py?

2012-02-16 Thread Anthony
On Thursday, February 16, 2012 4:47:52 AM UTC-5, Anaconda wrote:

 I need some advice, i notice that web2py has streaming by default, 
 therefore should i just use web2py to stream the video files or use 
 CloudFront? Which option would allow better scalability and pricing?


If you're already running web2py on an EC2 instance, it looks like 
CloudFront would be about the same price, but the point is that it should 
be faster (and I guess more scalable), so maybe not a bad idea to give it a 
try.

Anthony 


[web2py] Re: web2pyfied jQuery interfface

2012-02-16 Thread simon
I think it would be helpful too. I try to minimise the amount of
clientside script.

There are some tools I found here: 
http://www.web2pyslices.com/slices/take_slice/8

On Feb 16, 1:22 pm, Alan Etkin spame...@gmail.com wrote:
 What if web2py provided an in-the-middle interface to web2pyify jQuery
 features and, where possible, unify the usual server-side command
 syntax of the web2py apps?

 I am aware that web2py currently supports a set of javascript
 functions that handle jQuery and other javascript-related stuff, but I
 am talking about a more extensive set of javascript tools, as for
 example.

 -accessing safe data in storage objects client-side.
 -query the database with a client pseudo DAL instance
 -perhaps javascript helper and validator classes?
 -cannot think of anything else by now, but surely there has to be
 more.

 Note that this not a enhancement request or defect report, I just
 wanted to share the issue to know if this would be a good feature or
 not, wheter this is or is not suited for the framework design, or if
 this kind of features would follow good software practices or it
 wouldn't.


[web2py] Re: OFF Topic - Business inteligence in Python, web2py?

2012-02-16 Thread simon
http://orange.biolab.si/

On Feb 16, 10:26 am, Michele Comitini michele.comit...@gmail.com
wrote:
 This article even if old can be 
 useful:http://www.information-management.com/issues/20060601/1088417-1.html?...

 The python+R+postgesql combination is very powerful, but you are
 expected to know very well the math+statistics behind your needs.

 mic

 2012/2/16 Adi adnan.smajlo...@gmail.com:







  QlikView is not written in python, but I see they talk about integration on
  their community pages:
 http://community.qlikview.com/community/development?view=tagstags=py...


[web2py] Getting controller/function name in view

2012-02-16 Thread Yarin
Is there a way to get the controller and function name within a view-
i.e. the 'c' and 'f' parts of the current url?


[web2py] TR() unwanted extra cell - don't know what's happening

2012-02-16 Thread Cliff
Can somebody give me a clue?

This code produces an extra table cell in each row.

I have a screen shot showing the extra columns, but I don't know how
to post it.

***
Controller

  row_count = 0
product_total_quantity = Decimal('0')
for i, row in enumerate(rows):
product_total_quantity +=
row.product_lots.quantity_on_hand
if i + 1  len(rows):
next_row = rows[i+1]
else:
next_row = None
if not next_row or row.products.id !=
next_row.products.id:
arg = row.products.id
details_link = A( 'Lot details',
 _href=URL('lot_details', args=arg)
)
tbody.append(TR(
TD(row.products.name),
TD(row.products.internal_item_number),
TD(product_total_quantity), # EXTRA CELL comes up
here!!
TD(indexer.mk_links('Inventory', 'products', arg,
 leading_links = details_link)),
))
row_count += 1
product_total_quantity = 0
index_table = TABLE(thead, tbody)

*
Also,
def mk_links(application, controller, id, leading_links=None,
trailing_links=None):
view_link=A('View',
_href=URL(application, controller,'view', args = id),
_class='button'
   )
edit_link=A('Edit',
_href=URL(application, controller,'edit', args = id),
_class='button'
   )
trash_link=A('Trash',
 _href=URL(application, controller,'trash', args =
id),
 _class='button'
)
links = TD(view_link,' ',
   edit_link,' ',trash_link,
   _class='row_buttons',
   _style='text-align:right'
  )
if leading_links:
links.insert(0, leading_links)
pass
if trailing_links:
links.insert(-1, trailing_links)
pass

return links

Thank you,
Cliff Kachinske




[web2py] Re: Getting controller/function name in view

2012-02-16 Thread Cliff
request.controller
request.function

For more information:
http://web2py.com/books/default/chapter/29/4#request

On Feb 16, 9:41 am, Yarin ykess...@gmail.com wrote:
 Is there a way to get the controller and function name within a view-
 i.e. the 'c' and 'f' parts of the current url?


[web2py] Re: UnicodeEncodeError on GAE

2012-02-16 Thread sherdim
I Think it is a bug  as for 1.99.4
When a form tries to keep values w/ non ascii characters

if form.accepts(request.vars,session, formname=sP, keepvalues=True):
  File C:\a\w2p\gluon\html.py, line 1801, in accepts
status = self._traverse(status,hideerror)
  File C:\a\w2p\gluon\html.py, line 743, in _traverse
newstatus = c._traverse(status,hideerror) and newstatus
  File C:\a\w2p\gluon\html.py, line 751, in _traverse
self._postprocessing()
  File C:\a\w2p\gluon\html.py, line 1585, in _postprocessing
_value = str(self['_value'])
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-8: 
ordinal not in range(128)


Is str instruction ever needed? If yes -  additional check for unicodes 
with proper utf-8 conversion  is needed just before.

IMHO str at 1585 is excessive - all is fine  when deleted 



[web2py] Re: TR() unwanted extra cell - don't know what's happening

2012-02-16 Thread Anthony


 tbody.append(TR( 
 TD(row.products.name), 
 TD(row.products.internal_item_number), 
 TD(product_total_quantity), # EXTRA CELL comes up 
 here!! 
 TD(indexer.mk_links('Inventory', 'products', arg, 
  leading_links = details_link)), 
 )) 


It looks like the mk_links function returns a TD, so you have a TD nested 
inside another TD -- maybe that's the problem. Try:

  tbody.append(TR( 
TD(row.products.name), 
TD(row.products.internal_item_number), 
TD(product_total_quantity),
indexer.mk_links('Inventory', 'products', arg, 
 leading_links = details_link)
)) 

Anthony


[web2py] Re: Getting controller/function name in view

2012-02-16 Thread Yarin
awesome- (could've probably looked at the docs..)
Thanks

On Feb 16, 9:47 am, Cliff cjk...@gmail.com wrote:
 request.controller
 request.function

 For more information:http://web2py.com/books/default/chapter/29/4#request

 On Feb 16, 9:41 am, Yarin ykess...@gmail.com wrote:







  Is there a way to get the controller and function name within a view-
  i.e. the 'c' and 'f' parts of the current url?


Re: [web2py] Re: Anyone using Backbone.js?

2012-02-16 Thread Christian Foster Howes

i did this to use static files to contain my handlebars code:

$.get({{=URL(r=request, c='static', 
f='js/handlebars/views/popup.html')}}, function(data) {

popup_template = Handlebars.compile(data);
});


On 2/15/12 23:33 , David Marko wrote:

I'm also making decision right now and evaluating emberjs and backbone. The
emberjs is much clear form me but there is a problem with their template
engine  http://handlebarsjs.com/ which colide with web2py templates marks
{{ }}
HandleBars templates are placed inscript  tags so it would be great if I
can say somehow that web2py should skip parsing its content as web2py
template.

(also the ember data is claimed as not production ready, and thats
important for serious project)

Something like this: see 'data-web2py-skip='true''

script id=entry-template type=text/x-handlebars-template 
data-web2py-skip='true'   template content/script




[web2py] Re: menu problem when importing layout

2012-02-16 Thread Edward Shave
Has anyone an answer for this yet?

[web2py] Re: menu problem when importing layout

2012-02-16 Thread Anthony
Is the problem in all browsers, or just older versions of IE?

On Tuesday, November 15, 2011 4:24:23 AM UTC-5, thodoris wrote:

 Hello, 

 When i install any layout in my app, i always have the following 
 problem with the menu. Instead of the menu just expanding and covering 
 the text bellow, it pushes all the text under it. I know that it 
 should be a css problem but since i am new to css i would appreciate 
 the help. The layout i use is called Replenish (http://web2py.com/ 
 layouts/static/plugin_layouts/layouts/Replenish/index.htmlhttp://web2py.com/layouts/static/plugin_layouts/layouts/Replenish/index.html).
  


 Thodoris



[web2py] FORM.accepts fails on dev_appserver

2012-02-16 Thread Carl
I have the following code which runs fine on web2py but dev_appserver.py 
the call to greetform returns False not True

greetform = FORM( INPUT(_name='email', requires=IS_EMAIL()),
   LABEL(''),INPUT(_type='submit', _value=T('send')),
   _name='greetings')

if greetform.accepts(request.vars, session, formname='greetings', 
keepvalues=True):
fab=True
else:
fab=False

So... under dev_appserver.py, when a user submits the form, fab it set to 
False. Running straight Web2py, fab is set to True.

I'm baffled.


[web2py] Re: FORM.accepts fails on dev_appserver

2012-02-16 Thread Carl
in gluon/html.py in accepts()

formkey = self.session.get('_formkey[%s]' % self.formname, None)
# check if user tampering with form and void CSRF
if formkey != self.request_vars._formkey:
status = False

Under dev_appserver.py then status is set to False. Under Web2py then 
status remains True because the if check fails.

So, dev_appserver self.session.get() is failing to get the formkey.

Anyone have a clue to why?


[web2py] pyfpdf rendering bug

2012-02-16 Thread Bruce Wade
When using the examples provided for creating pdf's all whitespace between
words is removed.

IE: Testing Change is rendered as TestingChange

Some Address - somewhere - is rendered as SomeAddress-somewhere-

Is there a solution to this that someone else has found?

-- 
-- 
Regards,
Bruce Wade
http://ca.linkedin.com/in/brucelwade
http://www.wadecybertech.com
http://www.warplydesigned.com
http://www.fitnessfriendsfinder.com


[web2py] Re: Current status of adapting OrientDB for web2py

2012-02-16 Thread TheSweetlink
Hello all,

I do not have a patch as it is not for the DAL however I can show you
this handy module I hacked up.

It will add/remove edges to an OrientDB document-graph DB as well as
return the RID of a newly inserted record.

CRUD for now is project dependant on what if any schema you have
implemented in Orient and so not included.

It could use some try, except...to ensure that the transaction
completed but I did not include that as the test for successful insert
will likely rely on your schema if you have one.

NOTE: This is older code that was quickly abstracted from a project to
protect certain parts of code.  I'm certain there are several
abstractions/optimizations/fixes that can be applied to this code.
I'll leave it to you to please 2x check and tweak it to fit your
specific project.

The reason for lopping off the first character in some parts is
because RID's are actually strings that begin with a '#'.  Please see
http://code.google.com/p/orient/wiki/Concepts#Record and the rest of
the wiki for more details.  It is a good read.

@David Marko, I cannot build a whole application as that will take
some time to build an OrientDB instance which would exemplify all the
things you can do.

When I have more free time I may build an appliance because I want
more exposure to both projects.

I can certainly point you in the right direction though and once you
read the wiki everything will make much more sense.


Libs used:

re - to get RID from an INSERTed record
requests - http for humans...GREAT library,
ujson as json - fast moving of JSON data between OrientDB -- web2py,


Behold!  A simple module to add/remove in/out edges with OrientDB's
document-graph db as well as retrieving the RID of a newly inserted
record.  May it help you and many more.
http://paste.pocoo.org/show/552147/


-David Bloom


On Feb 16, 12:03 am, Massimo Di Pierro massimo.dipie...@gmail.com
wrote:
 You say you have been using it. Do you have a patch? I'll be happy to
 take a look and include it.

 On Feb 15, 2:48 pm, TheSweetlink yanosh...@gmail.com wrote:







  Hello,

  I have been using OrientDB and web2py quite successfully for some
  months now.

  While there are many great projects and efforts to combine these
  powerful programs, I do not know of the current status of the web2py
  --- OrientDB adapter.

  Bulbflow is a great project too but I could not use it due to OrientDB
  specific features that I needed for my project.

  Neo4j has had great progress as well.

  I ultimately chose OrientDB for several reasons which made it the best
  fit for my projects.  Here are some of those highlights:

  1) multi-master (as far as I know you must pay for commercial license
  to get multi-master in Neo4j)

  2) the Apache 2.0 license is very liberal.

  3) Luca and the OrientDB community are as turbo fast and helpful as
  the web2py community.  Luca can get patches out in hours to days, not
  months to years.

  4) SQL syntax + Gremlin graph traversal language = untold power to
  grow/analyze your graph dbs.

  5) Much more...for details see orienttechnologies.com and click Learn
  More.  Do read the entire wiki as there is good documentation and
  more coming frequently.

  As for getting OrientDB to work with web2py, I have had to write
  custom modules to do basic CRUD and used OrientDB's built-in console
  to create my schema/maintain the DB.

  I've experienced great success with using requests and ujson python
  libs to move data back and forth from web2py -- OrientDB

  For Auth I still use a db which will work with web2py's amazing DAL.
  I'm sure with enough time you could hack the two to work together but
  I prefer to use something proven for auth until such time OrientDB is
  included in the DAL.

  Massimo has expressed interest in including OrientDB within the DAL
  but I would assume that this will take quite some time as he has much
  higher priorities for web2py to get to first.

  I highly recommend the combination of web2py and OrientDB.  It will
  take some customization, but once running you will be able to do
  things that web2py + traditional RDBMS simply cannot do.

  Some of my apps have experienced 10-100x performance boost due to no
  longer using JOINS to get data but rather traversing my graph.

  Best of luck,
  David

  On Feb 13, 12:54 pm, Nolan Nichols nolan.nich...@gmail.com wrote:

   I'm researching the nosql and graph database landscape for a web2py
   application that will require the schema to evolve over time and
   provide network/graph analysis metrics.

   I started by looking at the Tinkerpop (http://tinkerpop.com/) stack
   and the Bulbflow (http://bulbflow.com/) python library for interacting
   with Tinkerpop graph databases like Neo4j and OrientDB.

   It looks like there was interest a few months back in adapting
   OrientDB's sql interface for web2py, and there is an open issue:

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

   A few questions:

   What is the current 

[web2py] Re: web2pyfied jQuery interfface

2012-02-16 Thread Alan Etkin
Well, the client-side web2py-like code is not as new as i thought.
I'll check the slice, it looks good. However, instead of a web2py-
slice, wouldn't be a good feature for web2py to expose script tools
like those by default?

On 16 feb, 11:21, simon simo...@gmail.com wrote:
 I think it would be helpful too. I try to minimise the amount of
 clientside script.

 There are some tools I found 
 here:http://www.web2pyslices.com/slices/take_slice/8

 On Feb 16, 1:22 pm, Alan Etkin spame...@gmail.com wrote:







  What if web2py provided an in-the-middle interface to web2pyify jQuery
  features and, where possible, unify the usual server-side command
  syntax of the web2py apps?

  I am aware that web2py currently supports a set of javascript
  functions that handle jQuery and other javascript-related stuff, but I
  am talking about a more extensive set of javascript tools, as for
  example.

  -accessing safe data in storage objects client-side.
  -query the database with a client pseudo DAL instance
  -perhaps javascript helper and validator classes?
  -cannot think of anything else by now, but surely there has to be
  more.

  Note that this not a enhancement request or defect report, I just
  wanted to share the issue to know if this would be a good feature or
  not, wheter this is or is not suited for the framework design, or if
  this kind of features would follow good software practices or it
  wouldn't.


[web2py] Forms not working with web2py in Chrome

2012-02-16 Thread Sameh Khalil


I'm new to web2py and following the book, I'm trying to follow along with 
the 3rd Chapter building the images application 
http://web2py.com/books/default/chapter/29/3#An-image-blog, I'm faced with 
a problem after building the model and trying to add uploads using the 
database administration, it doesn't work in chrome, after filling the form 
and clicking submit, the page refreshes with cleared inputs as new. The 
form works with other browsers as expected (Firefox, Opera, IE) I'm running 
on Windows 7.

Anybody knows what is causing such problem ??


Re: [web2py] Forms not working with web2py in Chrome

2012-02-16 Thread Bruno Rocha
check if you have any link with an empty href or any image with an empty src

a href='' and img src='' cause problems with form submission.

On Thu, Feb 16, 2012 at 3:52 PM, Sameh Khalil thebook...@gmail.com wrote:

 I'm new to web2py and following the book, I'm trying to follow along with
 the 3rd Chapter building the images application
 http://web2py.com/books/default/chapter/29/3#An-image-blog, I'm faced
 with a problem after building the model and trying to add uploads using the
 database administration, it doesn't work in chrome, after filling the form
 and clicking submit, the page refreshes with cleared inputs as new. The
 form works with other browsers as expected (Firefox, Opera, IE) I'm running
 on Windows 7.

 Anybody knows what is causing such problem ??




-- 

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


Re: [web2py] Re: How to Generate the effective report by using web2py

2012-02-16 Thread Mariano Reingart
Ross:

I'm planning a unicode patch and a better support to html rendering
using web2py helpers
They will not break compatibility.
If you want, you can sent me your changes, I could add it somewhere or
using as a base of a new reporting functions.

It would be great if you can fill an issue:

http://code.google.com/p/pyfpdf/

BTW, if you want, I can give you commit access.

Best regards

Mariano Reingart
http://www.sistemasagiles.com.ar
http://reingart.blogspot.com



On Thu, Feb 16, 2012 at 10:01 AM, Ross Peoples ross.peop...@gmail.com wrote:
 I had to write a lot of code to get FPDF to do proper headers, footers, and
 page numbers. Then about another 100 lines of code to get it to wrap long
 lines of text inside of a table. I'm also not using HTML to PDF conversion.
 I am using FPDF's methods to create PDFs. If I recall correctly, I tried to
 use paragraphs and even new line characters to force the line to break, but
 ended up having to use absolute positioning for the lines. It sounds
 terrible, I know, but I have been using this successfully for a little
 while. I basically wrote a module that takes a query (just like
 SQLFORM.grid) and generates a PDF with headers, footers, a logo, and can
 even group data into multiple tables, all while wrapping long text and
 repeating column headers on each new page. It was a lot of work, but the
 reports look pretty good.

 Mariano, what about FPDF are you planning on updating? And are you planning
 to break backwards-compatibility?


Re: [web2py] pyfpdf rendering bug

2012-02-16 Thread Mariano Reingart
What examples?

Mariano Reingart
http://www.sistemasagiles.com.ar
http://reingart.blogspot.com



On Thu, Feb 16, 2012 at 2:42 PM, Bruce Wade bruce.w...@gmail.com wrote:
 When using the examples provided for creating pdf's all whitespace between
 words is removed.

 IE: Testing Change is rendered as TestingChange

 Some Address - somewhere - is rendered as SomeAddress-somewhere-

 Is there a solution to this that someone else has found?

 --
 --
 Regards,
 Bruce Wade
 http://ca.linkedin.com/in/brucelwade
 http://www.wadecybertech.com
 http://www.warplydesigned.com
 http://www.fitnessfriendsfinder.com


Re: [web2py] pyfpdf rendering bug

2012-02-16 Thread Bruce Wade
web2py.app.fpdf.w2p

fpdfex application, controller default, action invoice.

When running python template.py directly the invoice is created as
expected. However when using the invoice action it is incorrect. I think it
is a problem when pulling from the database. I am replacing the database
call with a csv file to see if it corrects the problem.

On Thu, Feb 16, 2012 at 10:33 AM, Mariano Reingart reing...@gmail.comwrote:

 What examples?

 Mariano Reingart
 http://www.sistemasagiles.com.ar
 http://reingart.blogspot.com



 On Thu, Feb 16, 2012 at 2:42 PM, Bruce Wade bruce.w...@gmail.com wrote:
  When using the examples provided for creating pdf's all whitespace
 between
  words is removed.
 
  IE: Testing Change is rendered as TestingChange
 
  Some Address - somewhere - is rendered as SomeAddress-somewhere-
 
  Is there a solution to this that someone else has found?
 
  --
  --
  Regards,
  Bruce Wade
  http://ca.linkedin.com/in/brucelwade
  http://www.wadecybertech.com
  http://www.warplydesigned.com
  http://www.fitnessfriendsfinder.com




-- 
-- 
Regards,
Bruce Wade
http://ca.linkedin.com/in/brucelwade
http://www.wadecybertech.com
http://www.warplydesigned.com
http://www.fitnessfriendsfinder.com


Re: [web2py] pyfpdf rendering bug

2012-02-16 Thread Bruce Wade
Nope using the CSV like
if __name__ == __main__:
in the gluon/contrib/pyfpdf/template.py  did not fix it. For some reason
the rendering through web2py is breaking the display somewhere.

On Thu, Feb 16, 2012 at 10:41 AM, Bruce Wade bruce.w...@gmail.com wrote:

 web2py.app.fpdf.w2p

 fpdfex application, controller default, action invoice.

 When running python template.py directly the invoice is created as
 expected. However when using the invoice action it is incorrect. I think it
 is a problem when pulling from the database. I am replacing the database
 call with a csv file to see if it corrects the problem.


 On Thu, Feb 16, 2012 at 10:33 AM, Mariano Reingart reing...@gmail.comwrote:

 What examples?

 Mariano Reingart
 http://www.sistemasagiles.com.ar
 http://reingart.blogspot.com



 On Thu, Feb 16, 2012 at 2:42 PM, Bruce Wade bruce.w...@gmail.com wrote:
  When using the examples provided for creating pdf's all whitespace
 between
  words is removed.
 
  IE: Testing Change is rendered as TestingChange
 
  Some Address - somewhere - is rendered as SomeAddress-somewhere-
 
  Is there a solution to this that someone else has found?
 
  --
  --
  Regards,
  Bruce Wade
  http://ca.linkedin.com/in/brucelwade
  http://www.wadecybertech.com
  http://www.warplydesigned.com
  http://www.fitnessfriendsfinder.com




 --
 --
 Regards,
 Bruce Wade
 http://ca.linkedin.com/in/brucelwade
 http://www.wadecybertech.com
 http://www.warplydesigned.com
 http://www.fitnessfriendsfinder.com




-- 
-- 
Regards,
Bruce Wade
http://ca.linkedin.com/in/brucelwade
http://www.wadecybertech.com
http://www.warplydesigned.com
http://www.fitnessfriendsfinder.com


Re: [web2py] pyfpdf rendering bug

2012-02-16 Thread Mariano Reingart
Strange, are you using unicode?

Mariano Reingart
http://www.sistemasagiles.com.ar
http://reingart.blogspot.com



On Thu, Feb 16, 2012 at 3:45 PM, Bruce Wade bruce.w...@gmail.com wrote:
 Nope using the CSV like
 if __name__ == __main__:
 in the gluon/contrib/pyfpdf/template.py  did not fix it. For some reason the
 rendering through web2py is breaking the display somewhere.


 On Thu, Feb 16, 2012 at 10:41 AM, Bruce Wade bruce.w...@gmail.com wrote:

 web2py.app.fpdf.w2p

 fpdfex application, controller default, action invoice.

 When running python template.py directly the invoice is created as
 expected. However when using the invoice action it is incorrect. I think it
 is a problem when pulling from the database. I am replacing the database
 call with a csv file to see if it corrects the problem.


 On Thu, Feb 16, 2012 at 10:33 AM, Mariano Reingart reing...@gmail.com
 wrote:

 What examples?

 Mariano Reingart
 http://www.sistemasagiles.com.ar
 http://reingart.blogspot.com



 On Thu, Feb 16, 2012 at 2:42 PM, Bruce Wade bruce.w...@gmail.com wrote:
  When using the examples provided for creating pdf's all whitespace
  between
  words is removed.
 
  IE: Testing Change is rendered as TestingChange
 
  Some Address - somewhere - is rendered as SomeAddress-somewhere-
 
  Is there a solution to this that someone else has found?
 
  --
  --
  Regards,
  Bruce Wade
  http://ca.linkedin.com/in/brucelwade
  http://www.wadecybertech.com
  http://www.warplydesigned.com
  http://www.fitnessfriendsfinder.com




 --
 --
 Regards,
 Bruce Wade
 http://ca.linkedin.com/in/brucelwade
 http://www.wadecybertech.com
 http://www.warplydesigned.com
 http://www.fitnessfriendsfinder.com




 --
 --
 Regards,
 Bruce Wade
 http://ca.linkedin.com/in/brucelwade
 http://www.wadecybertech.com
 http://www.warplydesigned.com
 http://www.fitnessfriendsfinder.com


Re: [web2py] pyfpdf rendering bug

2012-02-16 Thread Bruce Wade
I am using the sample text that came with the example. For some reason it
just removes the spaces between words looks like there may be a issue when
rendering dest='S'

On Thu, Feb 16, 2012 at 11:03 AM, Mariano Reingart reing...@gmail.comwrote:

 Strange, are you using unicode?

 Mariano Reingart
 http://www.sistemasagiles.com.ar
 http://reingart.blogspot.com



 On Thu, Feb 16, 2012 at 3:45 PM, Bruce Wade bruce.w...@gmail.com wrote:
  Nope using the CSV like
  if __name__ == __main__:
  in the gluon/contrib/pyfpdf/template.py  did not fix it. For some reason
 the
  rendering through web2py is breaking the display somewhere.
 
 
  On Thu, Feb 16, 2012 at 10:41 AM, Bruce Wade bruce.w...@gmail.com
 wrote:
 
  web2py.app.fpdf.w2p
 
  fpdfex application, controller default, action invoice.
 
  When running python template.py directly the invoice is created as
  expected. However when using the invoice action it is incorrect. I
 think it
  is a problem when pulling from the database. I am replacing the database
  call with a csv file to see if it corrects the problem.
 
 
  On Thu, Feb 16, 2012 at 10:33 AM, Mariano Reingart reing...@gmail.com
  wrote:
 
  What examples?
 
  Mariano Reingart
  http://www.sistemasagiles.com.ar
  http://reingart.blogspot.com
 
 
 
  On Thu, Feb 16, 2012 at 2:42 PM, Bruce Wade bruce.w...@gmail.com
 wrote:
   When using the examples provided for creating pdf's all whitespace
   between
   words is removed.
  
   IE: Testing Change is rendered as TestingChange
  
   Some Address - somewhere - is rendered as SomeAddress-somewhere-
  
   Is there a solution to this that someone else has found?
  
   --
   --
   Regards,
   Bruce Wade
   http://ca.linkedin.com/in/brucelwade
   http://www.wadecybertech.com
   http://www.warplydesigned.com
   http://www.fitnessfriendsfinder.com
 
 
 
 
  --
  --
  Regards,
  Bruce Wade
  http://ca.linkedin.com/in/brucelwade
  http://www.wadecybertech.com
  http://www.warplydesigned.com
  http://www.fitnessfriendsfinder.com
 
 
 
 
  --
  --
  Regards,
  Bruce Wade
  http://ca.linkedin.com/in/brucelwade
  http://www.wadecybertech.com
  http://www.warplydesigned.com
  http://www.fitnessfriendsfinder.com




-- 
-- 
Regards,
Bruce Wade
http://ca.linkedin.com/in/brucelwade
http://www.wadecybertech.com
http://www.warplydesigned.com
http://www.fitnessfriendsfinder.com


[web2py] Re: Close...but still not deployed

2012-02-16 Thread Bill Thayer
Thanks to Omi Chiba for pointing out the missing e in welcome. Now the 
welcome app is deployed!


[web2py] Re: loop inside helper

2012-02-16 Thread web-dev-m
You got it!  Thanks!!!

On Feb 16, 1:10 am, Anthony abasta...@gmail.com wrote:
  I am trying to add a jquery effect, to each row based on its id, but i
  am having trouble formatting the _onclick=jQuery('id').toggle()

 _onclick=jQuery('%s').toggle() % row.id

 Anthony


[web2py] Re: menu problem when importing layout

2012-02-16 Thread Edward Shave
Hi Anthony, In case thodoris isn't around

I'm assuming this problem is the same as I ran into when using the layout 
plugins... Just seems like drop down (sub) menus aren't supported?

To see this just upload one into the welcome app.

Regards, Ed


[web2py] new mysql claimed 70x faster

2012-02-16 Thread Massimo Di Pierro
http://www.mysql.com/why-mysql/white-papers/mysql-cluster-7.2-ga.html


[web2py] Re: Video site : Should i use AWS cloudfront just web2py?

2012-02-16 Thread Anaconda
Thank you for taking the time out to reply Anthony, i am not running
an EC2 instance but will give it a try now with CloudFront.

On Feb 16, 6:06 am, Anthony abasta...@gmail.com wrote:
 On Thursday, February 16, 2012 4:47:52 AM UTC-5, Anaconda wrote:

  I need some advice, i notice that web2py has streaming by default,
  therefore should i just use web2py to stream the video files or use
  CloudFront? Which option would allow better scalability and pricing?

 If you're already running web2py on an EC2 instance, it looks like
 CloudFront would be about the same price, but the point is that it should
 be faster (and I guess more scalable), so maybe not a bad idea to give it a
 try.

 Anthony


[web2py] Re: pyfpdf rendering bug

2012-02-16 Thread Alan Etkin
Perhaps there is some old system filename conversion feature causing
the mess with the strings. I think I was manually testing an app with
a function that returns a pdf file without problems.

On Feb 16, 2:42 pm, Bruce Wade bruce.w...@gmail.com wrote:
 When using the examples provided for creating pdf's all whitespace between
 words is removed.

 IE: Testing Change is rendered as TestingChange

 Some Address - somewhere - is rendered as SomeAddress-somewhere-

 Is there a solution to this that someone else has found?

 --
 --
 Regards,
 Bruce 
 Wadehttp://ca.linkedin.com/in/brucelwadehttp://www.wadecybertech.comhttp://www.warplydesigned.comhttp://www.fitnessfriendsfinder.com


Re: [web2py] Re: pyfpdf rendering bug

2012-02-16 Thread Bruce Wade
Yeah not sure, I am trying to get it working correct. I know running the
python template.py directly works.

On Thu, Feb 16, 2012 at 2:13 PM, Alan Etkin spame...@gmail.com wrote:

 Perhaps there is some old system filename conversion feature causing
 the mess with the strings. I think I was manually testing an app with
 a function that returns a pdf file without problems.

 On Feb 16, 2:42 pm, Bruce Wade bruce.w...@gmail.com wrote:
  When using the examples provided for creating pdf's all whitespace
 between
  words is removed.
 
  IE: Testing Change is rendered as TestingChange
 
  Some Address - somewhere - is rendered as SomeAddress-somewhere-
 
  Is there a solution to this that someone else has found?
 
  --
  --
  Regards,
  Bruce Wadehttp://
 ca.linkedin.com/in/brucelwadehttp://www.wadecybertech.comhttp://www.warplydesigned.comhttp://www.fitnessfriendsfinder.com




-- 
-- 
Regards,
Bruce Wade
http://ca.linkedin.com/in/brucelwade
http://www.wadecybertech.com
http://www.warplydesigned.com
http://www.fitnessfriendsfinder.com


[web2py] Re: new mysql claimed 70x faster

2012-02-16 Thread Cliff
And recommended by 9 out of 10 dentists :)

Sorry, couldn't help myself.

On Feb 16, 3:33 pm, Massimo Di Pierro massimo.dipie...@gmail.com
wrote:
 http://www.mysql.com/why-mysql/white-papers/mysql-cluster-7.2-ga.html


[web2py] Re: TR() unwanted extra cell - don't know what's happening

2012-02-16 Thread Cliff
thanks, Anthony.

I stared at that thing for at least 30 minutes this morning and didn't
see the nesting.

Another palm-to-forehead moment.

On Feb 16, 10:24 am, Anthony abasta...@gmail.com wrote:
                  tbody.append(TR(
                      TD(row.products.name),
                      TD(row.products.internal_item_number),
                      TD(product_total_quantity), # EXTRA CELL comes up
  here!!
                      TD(indexer.mk_links('Inventory', 'products', arg,
                                       leading_links = details_link)),
                  ))

 It looks like the mk_links function returns a TD, so you have a TD nested
 inside another TD -- maybe that's the problem. Try:

   tbody.append(TR(
                     TD(row.products.name),
                     TD(row.products.internal_item_number),
                     TD(product_total_quantity),
                     indexer.mk_links('Inventory', 'products', arg,
                                      leading_links = details_link)
                 ))

 Anthony


Re: [web2py] Re: Implementing task queue using web2py

2012-02-16 Thread howesc
for writing files to the blobstore see the GAE docs: 
http://code.google.com/appengine/docs/python/blobstore/overview.html#Writing_Files_to_the_Blobstore


[web2py] Re: Forms not working with web2py in Chrome

2012-02-16 Thread Cliff
Do you have the little Web2py icon in the destination field? (Or
whatever Chrome calls it - the place where you type the URL.)

That would be your favicon.ico.  In the past, Chrome did really odd
things if favicon is missing and maybe it still does.

On Feb 16, 12:52 pm, Sameh Khalil thebook...@gmail.com wrote:
 I'm new to web2py and following the book, I'm trying to follow along with
 the 3rd Chapter building the images 
 applicationhttp://web2py.com/books/default/chapter/29/3#An-image-blog, I'm 
 faced with
 a problem after building the model and trying to add uploads using the
 database administration, it doesn't work in chrome, after filling the form
 and clicking submit, the page refreshes with cleared inputs as new. The
 form works with other browsers as expected (Firefox, Opera, IE) I'm running
 on Windows 7.

 Anybody knows what is causing such problem ??


[web2py] Re: html5 suport for forms

2012-02-16 Thread howesc
nothing generic, but i have been known to do things like:

#Set HTML 5 input properties
if not auth.is_logged_in():
form.custom.widget.first_name['_required'] = True
form.custom.widget.first_name['_autofocus'] = True

form.custom.widget.last_name['_required'] = True

form.custom.widget.email['_type'] = 'email'
form.custom.widget.email['_required'] = True

form.custom.widget.confirm_email['_type'] = 'email'
form.custom.widget.confirm_email['_required'] = True

form.custom.widget.confirm_password['_onkeyup'] = 
check_password(this.value);

form.custom.widget.phone_area_code['_required'] = True
form.custom.widget.phone_exchange['_required'] = True
form.custom.widget.phone_suffix['_required'] = True
form.custom.widget.phone_area_code['_maxlength'] = 3
form.custom.widget.phone_exchange['_maxlength'] = 3
form.custom.widget.phone_suffix['_maxlength'] = 4
form.custom.widget.phone_extension['_maxlength'] = 5



[web2py] Re: Wizard comments/suggestions

2012-02-16 Thread Bill Thayer


https://lh6.googleusercontent.com/-5Lz1SVK5Swk/Tz2Jxso6ugI/ACA/JUxWbEK-Qa8/s1600/illegible_plugin_selector.JPG
This might be a decent thread to add this discovery. The wizard's plugin 
selector is illegible in Firefox. See screenshot.



Regards,
Bill


Re: [web2py] Forms not working with web2py in Chrome

2012-02-16 Thread Sameh Khalil
The forms page is created by web2py in the database administration page, 
and I checked the source and it contains no empty hrefs or src

[web2py] Re: Forms not working with web2py in Chrome

2012-02-16 Thread Sameh Khalil
the favicon exists and shows just fine

[web2py] Re: Forms not working with web2py in Chrome

2012-02-16 Thread Anthony
Can you show your exact model file code? What version of web2py? Are you 
running from source (with your own Python installation), or using the 
Windows binary?

Anthony

On Thursday, February 16, 2012 12:52:03 PM UTC-5, Sameh Khalil wrote:

 I'm new to web2py and following the book, I'm trying to follow along with 
 the 3rd Chapter building the images application 
 http://web2py.com/books/default/chapter/29/3#An-image-blog, I'm faced 
 with a problem after building the model and trying to add uploads using the 
 database administration, it doesn't work in chrome, after filling the form 
 and clicking submit, the page refreshes with cleared inputs as new. The 
 form works with other browsers as expected (Firefox, Opera, IE) I'm running 
 on Windows 7.

 Anybody knows what is causing such problem ??



Re: [web2py] Re: html5 suport for forms

2012-02-16 Thread Bruno Rocha
I want to create a form parser, to not break the compatibility with FORM

something like this:

raw_form = SQLFORM(db.table)

from plugin_html5form import HTML5FORM
html5_form = HTML5FORM(form)

So HTML5FORM receives a FORM object and loops inside its components
changing everything to html5 pattern, also it can receive some extra values
as fields_order, include_fieldset=True, labels={}, and subform=FORM()

I did not started to code the plugin, I am just wondering about it.

-- 

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


[web2py] Re: Associative Table

2012-02-16 Thread Cliff
If you want to avoid duplicate associations, check out
update_or_insert.

http://web2py.com/books/default/chapter/29/6#update_or_insert

In raw SQL you would use the two associated IDs as the primary key,
then use ON DUPLICATE KEY to trap the error.

On Feb 16, 8:09 am, Ross Peoples ross.peop...@gmail.com wrote:
 Good practice says you should ALWAYS have an identity (ID) field, even if
 you don't use it.


[web2py] Re: sqlhtml.py - breadcrumbs exception when using smartgrid format + lambda

2012-02-16 Thread Cliff
Here's an alternative breadcrumb generator that handles object names
like this...

if len(request.args)  0: # tune this value.  grid  smartgrid use
longer arg lists
  if 'name' in db[request.controller].fields:
  item_name = 'editing ' + db[request.controller][args[-1]]].name
  else:
  item_name = 'editing item #' + request.args[-1]

bc_list.append(A(item_name, _href=URL())) #


On Feb 16, 4:26 am, Roderick roderick.m...@gmail.com wrote:
 Hi Massimo and Anthony

 Created the following 
 issue:http://code.google.com/p/web2py/issues/detail?id=663

 Unfortunately the fix doesn't work on the breadcrumbs - still getting
 the index - although it does work on row data...

 Thanks  regards,

 Roderick

 On Feb 14, 4:44 pm, Massimo Di Pierro massimo.dipie...@gmail.com
 wrote:







  Thanks fixed in trunk now.

  On Feb 14, 6:18 am, Roderick roderick.m...@gmail.com wrote:

   Being a noob at Python and Web2py, this is the best I could come up with:

   In sqlhtml.py, insert the 2nd try block (below name = db[referee]._format
   % record) as follows:

                       try:
                           name = db[referee]._format % record
                       except TypeError:
                           try:
                               name = db[referee]._format(record)
                           except TypeError:
                               name = id

   This seems to work for format=%(name)s and format=lambda record:
   record.name formats.

   If anyone has a better/cleaner solution I'd like to hear it..

   Thanks!


Re: [web2py] Re: How to Generate the effective report by using web2py

2012-02-16 Thread Sanjeet Kumar
Ross i am new in web2py and python so please what are you planning put in
the repository because i want to generate the report by using FPDF and i
also generated the report but now in the rows i have the large text so
Problems are arising on the view

On Fri, Feb 17, 2012 at 12:02 AM, Mariano Reingart reing...@gmail.comwrote:

 Ross:

 I'm planning a unicode patch and a better support to html rendering
 using web2py helpers
 They will not break compatibility.
 If you want, you can sent me your changes, I could add it somewhere or
 using as a base of a new reporting functions.

 It would be great if you can fill an issue:

 http://code.google.com/p/pyfpdf/

 BTW, if you want, I can give you commit access.

 Best regards

 Mariano Reingart
 http://www.sistemasagiles.com.ar
 http://reingart.blogspot.com



 On Thu, Feb 16, 2012 at 10:01 AM, Ross Peoples ross.peop...@gmail.com
 wrote:
  I had to write a lot of code to get FPDF to do proper headers, footers,
 and
  page numbers. Then about another 100 lines of code to get it to wrap long
  lines of text inside of a table. I'm also not using HTML to PDF
 conversion.
  I am using FPDF's methods to create PDFs. If I recall correctly, I tried
 to
  use paragraphs and even new line characters to force the line to break,
 but
  ended up having to use absolute positioning for the lines. It sounds
  terrible, I know, but I have been using this successfully for a little
  while. I basically wrote a module that takes a query (just like
  SQLFORM.grid) and generates a PDF with headers, footers, a logo, and can
  even group data into multiple tables, all while wrapping long text and
  repeating column headers on each new page. It was a lot of work, but the
  reports look pretty good.
 
  Mariano, what about FPDF are you planning on updating? And are you
 planning
  to break backwards-compatibility?



Re: [web2py] Re: How to Generate the effective report by using web2py

2012-02-16 Thread Ramkrishan Bhatt
Hello Sanjeet,
   In your code the header and footer column is unmatched . Just care full 
about the Grid Structure as per Column name and data value. A part from 
that in refer
http://www.web2py.com/book/default/chapter/10#Low-level-API-and-other-recipes
 http://www.geraldoreports.org/docs/tutorial-web2py.html
http://code.google.com/p/pyfpdf/  

I


[web2py] turnoff the default datepicker

2012-02-16 Thread Martin Weissenboeck
Hi,

I want
(1) to deactive the automatic call of the AnyTime picker depending on the
class 'date' and
(2) substitue it with something like $('myid').click(...)

(2) works fine, I have translated the names of month and days to German,
changed the first day of the week and so on.
(1) is the problem: if the form is displayed the first time and I click
into the date filed the standard datepicker (with English texts) appears.

Where is the code that calls the datepicker? It must be someting like
$('.date') I have fould this code in js/anytime-setup.js and I have
deleted this file - the (original) datepicker appears again.

I have tried to ask the author at http://www.ama3.com/doorkeeper/, but
there is a doorkeeper on this website and whatever I try to enter in the
filed Reason for contact my message is qualified as spam.

After some hours - it is my question to the community: how to turn off the
default behavior of the datepicker?
Regards Martin


[web2py] rendering a view

2012-02-16 Thread Praveen Bhat
Hello,

I have 2 tables : business and article.

And I have 3 controllers : Home, Articles, Businesses.

In Home page the following code renders a list of Businesses and Articles:
 
 def index(): 
lists= db().select(db.article.ALL,limitby=(0, 5),orderby=~db.article.id)
listings=db().select(db.business.ALL)
return dict(lists=lists,listings=listings)

with a loop in the home view file.

So I want to link articles to the Articles controller and Businesses to the 
Business controller from the home page...I have used the following code:

def show(): 
myid == request.vars.id
  redirect(URL(c='businesses',f='show?id=%s'% myid))

So even articles list will link to Business controller now using the 
function show in Bunsiess controller, but I wanna use if and elif according 
to the respective listing.

Can someone help me out.


[web2py] adding extra form elements in a

2012-02-16 Thread Martin Weissenboeck
Hi,

chapter 7.2.8 of the books tells how to add extra form elements to SQLFORM.
My question: I want to use a SQLFORM.smartgrid. On adding a new record a
SQLFORM appears. It is possible to add an extra form element to this form?

Concrete: I want to add a button to activate a datepicker in the line above

Regards, Martin


[web2py] Why admin|examples|welcome in hgignore?

2012-02-16 Thread pbreit
I see this line in .hgignore:

^applications/(?!(admin|examples|welcome|__init__)).*$

So I'm wondering how I get updates to those applications? Is it safe to 
change that to this?

^applications/(?!(__init__)).*$