[web2py] Re: Images work in IE9, vanish in firefox

2012-04-29 Thread Stefan Scholl
Simon Pickles  wrote:
> Thanks for the reply. Oddly there is no missing image icon. The
> alt text seems to flash up then disappear.

Don't try to load the whole page, just the image with its image
URL. This way you could see if there is any error reported.






[web2py] Re: Images work in IE9, vanish in firefox

2012-04-29 Thread Simon Pickles
Adblock plus. That was the issue. It intercepted the images and turned all 
the css to null.

http://stackoverflow.com/questions/3558071/img-tag-greyed-out-in-firebug-hence-found-the-reason-for-image-not-showing-up

Thanks for help, Antony


[web2py] Re: are 8 stickys really necessary at the top of this forum?

2012-04-29 Thread Ashraf Mansour
Thank you...


>>>

Re: [web2py] Re: File generation using web2py

2012-04-29 Thread RAHUL PRIYADARSI
Dear All,
Thanks for your answers.But what I was looking for was,putting into simple
words,implementing a use case similar to the following "The system
maintains the data related to each transaction.Each transaction includes
the list of items demanded per transaction with each item belonging to a
category.The system also generates an aggregated report per transaction as
well as an overall report of the total items belonging to each category
demanded.".Now "the report" here need not be in csv only.It may be txt
file.Since I am not sure as to whether is it possible to print formatted
strings(e.g. the string "report" printed right aligned in a total field of
15 characters,something likd printf(%15s)) in web2py,my question is that
how we do file IO in web2py. Can we generate a txt file in web2py. And can
we print formatted strings to it?
Since the controller runs on server and my application would be deployed in
an intranet lan and it needs to generate files to be used in local file
system of the system on which the user will access the app , where must
this file IO code be written, in controller or view.

On 30 April 2012 07:35, Brian M  wrote:

> Yep, I've got a processing app that spits out all sorts of csv files based
> on data gathered from multiple sources.
>
> Here's a little helper function I use
>
> def csv_export(records, column_names, fields, mode = 'dal'):
> """Export DAL result set, list of dicts or list of lists to CSV stream
> for returning to user
> Arguments:
> records = the data to be returned
> column_names (list)= the column names/headings for the first row in
> the CSV file
> Example ['First Name', 'Last Name', 'Email']
> fields (list) = the names of the fields (as they appear in records) in
> the order they
> should be in the CSV. Example ['f_name', 'l_name',
> 'email']
> or ['table_a.f_name', 'table_a.l_name',
> 'table_b.email']
> If mode = 'list' and your records are in the correct
> order then fields may be None
> otherwise use [1,3,0] if you list is in a different
> order
> mode (string) = what type of data is in records? 'dal' (Default),
> 'dict' or 'list'
> 'dal' if records came from a regular dal query
> (Default)
> 'dict' if records are a list of dicts (for example
> using db.executesql() with as_dict = True)
> 'list' if records are a list of lists/tuples (for
> example using db.executesql() with as_dict = False)
>
> """
>
> #create fake file object
> import cStringIO
> file = cStringIO.StringIO()
> #setup csv writer
> import csv
> csv_file = csv.writer(file)
> #write first row withspecified column headings/names
> csv_file.writerow(column_names)
> #which mode - dal or dict?
> if mode.lower() == 'dal' or mode.lower() == 'dict':
> for record in records:
> csv_file.writerow([record[field] for field in fields])
> elif mode.lower() == 'list':
> if fields == None:
> csv_file.writerows(records)
> else:
> for record in records:
> csv_file.writerow([record[field] for field in fields])
> return file
>
>
>
> Then in a controller you can have something like
>
> csv_stream = csv_export(processed_dataset, column_names, fields, mode
> = 'dict')
> response.headers['Content-Type']='application/vnd.ms-excel'
> response.headers['Content-Disposition']='attachment;
> filename=data_for_%s.csv' % date.today()
> return csv_stream.getvalue()
>
> which will cause browser to download the csv file with your chosen filename
>
> you could also turn around and save the datafile to the filesystem if you
> wanted.
>
> Hope this helps!
> Brian
>
>
> On Saturday, April 28, 2012 5:20:15 AM UTC-5, rahulserver wrote:
>>
>> I wish to generate a few reports in csv or txt or other file formats
>> based on some database data maintained through a crud application.
>> Previously, it was done through an asp.net application with vb as
>> scripting language.But as I explored the wonderful capabilities of web2py,
>> I have become a fan of this terrific framework.
>> Is it possible to do it in web2py. And if it is, then how and where
>> should the code be placed.In the view or model or controller?
>>
>


Re: [web2py] Re: Emails never making it to hotmail accounts

2012-04-29 Thread tsvim
i just looked up your domain. You should setup DKIM and SPF records for your 
domain. Don't have the links to explanations handy, but basically those are two 
different technologies that allow you to authenticate the source of the mail 
thereby proving that a spammer didn't just set the from field to your domain.
It's quite easy under Google apps. DKIM requires you to generate a key for your 
domain which you enter as a text record at your DNS provider. SPF doesn't 
require a key, just a DNS txt record telling the receiver that he should check 
with Google that this is  valid user.

Hope it helps,

Tsvi


[web2py] Re: File generation using web2py

2012-04-29 Thread Brian M
Yep, I've got a processing app that spits out all sorts of csv files based 
on data gathered from multiple sources.

Here's a little helper function I use

def csv_export(records, column_names, fields, mode = 'dal'):
"""Export DAL result set, list of dicts or list of lists to CSV stream 
for returning to user
Arguments:
records = the data to be returned
column_names (list)= the column names/headings for the first row in the 
CSV file
Example ['First Name', 'Last Name', 'Email']
fields (list) = the names of the fields (as they appear in records) in 
the order they
should be in the CSV. Example ['f_name', 'l_name', 
'email']
or ['table_a.f_name', 'table_a.l_name', 'table_b.email']
If mode = 'list' and your records are in the correct 
order then fields may be None
otherwise use [1,3,0] if you list is in a different 
order
mode (string) = what type of data is in records? 'dal' (Default), 
'dict' or 'list'
'dal' if records came from a regular dal query (Default)
'dict' if records are a list of dicts (for example 
using db.executesql() with as_dict = True)
'list' if records are a list of lists/tuples (for 
example using db.executesql() with as_dict = False)

"""

#create fake file object
import cStringIO
file = cStringIO.StringIO()
#setup csv writer
import csv
csv_file = csv.writer(file)
#write first row withspecified column headings/names
csv_file.writerow(column_names)
#which mode - dal or dict?
if mode.lower() == 'dal' or mode.lower() == 'dict':
for record in records:
csv_file.writerow([record[field] for field in fields])
elif mode.lower() == 'list':
if fields == None:
csv_file.writerows(records)
else:
for record in records:
csv_file.writerow([record[field] for field in fields])
return file



Then in a controller you can have something like

csv_stream = csv_export(processed_dataset, column_names, fields, mode = 
'dict')
response.headers['Content-Type']='application/vnd.ms-excel'
response.headers['Content-Disposition']='attachment; 
filename=data_for_%s.csv' % date.today()
return csv_stream.getvalue()  

which will cause browser to download the csv file with your chosen filename

you could also turn around and save the datafile to the filesystem if you 
wanted.

Hope this helps!
Brian

On Saturday, April 28, 2012 5:20:15 AM UTC-5, rahulserver wrote:
>
> I wish to generate a few reports in csv or txt or other file formats based 
> on some database data maintained through a crud application. Previously, it 
> was done through an asp.net application with vb as scripting language.But 
> as I explored the wonderful capabilities of web2py, I have become a fan of 
> this terrific framework.
> Is it possible to do it in web2py. And if it is, then how and where should 
> the code be placed.In the view or model or controller?
>


[web2py] Re: request.intargs RFC

2012-04-29 Thread Anthony
On Sunday, April 29, 2012 7:54:11 PM UTC-4, Massimo Di Pierro wrote:
>
> I often run into this problem:
>
> def index():
>   record=db.tablename(request.args(0))  or redirect(URL('error'))
>
> which assumes request.args(0) is integer or missing. If not it issues a 
> ticket.
>

If request.args(0) is not an integer or missing, doesn't 
db.tablename(request.args(0)) simply return None -- in which case, no 
ticket should be issued? Also, you can already do request.args(0, 
default=0) if you want a 0 instead of None when request.args is empty, no?
 

> In trunk there is a new request.intargs which allows
>
> def index():
>   record=db.tablename(request.intargs(0,default=0)) or 
> redirect(URL('error'))
>
>
Another option might be:

request.args(0, assert_int=True, ...)

Anthony



[web2py] request.intargs RFC

2012-04-29 Thread Massimo Di Pierro
I often run into this problem:

def index():
  record=db.tablename(request.args(0))  or redirect(URL('error'))

which assumes request.args(0) is integer or missing. If not it issues a 
ticket. In trunk there is a new request.intargs which allows

def index():
  record=db.tablename(request.intargs(0,default=0)) or 
redirect(URL('error'))

so that is never issues a ticket. If the request.args(0) is missing it uses 
default=0 else ir raises HTTP(404).
It it returns is also returns an integer. 

It also takes the optional parameter url_onerror which allows redirect 
instead of raise HTTP(404).

Before this makes it into 2.0, please send comments and suggestions for 
improvement.






[web2py] Re: are 8 stickys really necessary at the top of this forum?

2012-04-29 Thread Massimo Di Pierro
will do.

On Sunday, 29 April 2012 14:06:19 UTC-5, Ashraf Mansour wrote:
>
> OR they can be aggregated in one sticky topic.
>
>
>>

Re: [web2py] Re: Cookbook recipe for nginx/uwsgi woes

2012-04-29 Thread Bill Barry
I am running web2py on Debian with nginx and the  uwsgi-plugin-python 
package. My configuration is similar to  yours, but uses mount instead of 
 app


  python
  127.0.0.1:9001
  /=/home/www-data/web2py/wsgihandler.py


Bill

On Friday, April 27, 2012 1:16:07 AM UTC-7, rif wrote:
>
> I had the same issue and I solved by adding plugin python in the uwsgi 
> web2py configuration:
>
> 
> python   
>   <--HERE
> 127.0.0.1:9001
> /home/www-data/web2py/
> 
> wsgihandler
> 
> 
>
>>
>>  

Re: [web2py] Reading web2py tickets on app engine

2012-04-29 Thread David Phillips
Thank you, howesc and especially Ricardo. That code snippet worked. I can 
now see my tickets on app engine.

On Tuesday, April 24, 2012 8:41:33 PM UTC-5, Ricardo Pedroso wrote:
>
> On Tue, Apr 24, 2012 at 12:57 AM, David Phillips
> > wrote:
> > I don't know how to read the tickets web2py generates on app engine. On
> > devserver, the tickets are shown in their entirety, but on the production
> > server, the datastore viewer only shows the first 1000 or so characters. 
> I
> > can't figure out a way to see the entire ticket.
> >
> > The database management (appadmin) page doesn't show the tickets table,
> > although it shows web2py_session_rage.
> >
> > So, I wrote this action in a controller:
> >
> > def download_ticket():
> >
> > id = request.args[0]
> >
> > rec = db (db.web2py_ticket_rage.id == id).select().first()
> >
> > return rec.ticket_data
> >
> >
> > where web2py_ticket_rage is the name of the table where the tickets are
> > stored according to the dashboard. But when I execute, this exception is
> > raised:
> >
> > KeyError: 'web2py_ticket_rage'
> >
>
> You need to db.define_table()
>
> > Fortunately, there is a lot of information in the app engine logs, but I
> > would still like to see the ticket. So, is therea way to view tickets on 
> app
> > engine?
>
> I have this in the beginning of appadmin after the imports:
>
> if request.env.web2py_runtime_gae:
> import cPickle
>
> tablename = 'web2py_ticket_'+request.application
> db.define_table(
> tablename,
> Field('ticket_id', length=100),
> Field('ticket_data', 'text'),
> Field('created_datetime', 'datetime'),
> )
>
> def pre_widget(field, value, **attributes):
> return PRE(value)
>
> def traceback_ticket_widget(field, value, **attributes):
> return PRE(cPickle.loads(value)['traceback'],
>_style="color:#ddd;background-color:#000;padding:4px")
>
> db[tablename].ticket_id.widget = pre_widget
> db[tablename].ticket_data.widget = traceback_ticket_widget
> db[tablename].created_datetime.widget = pre_widget
>
>
> and it's working for me.
>
> The definition of the table you can copy from gluon/restricted.py
> around line 75.
>
> Note that if you try insert a new ticket through appadmin it will
> raise an exception,
> but I leave it this way as a way to generate a ticket if I need.
>
> Ricardo
>
>

[web2py] Re: are 8 stickys really necessary at the top of this forum?

2012-04-29 Thread Ashraf Mansour
OR they can be aggregated in one sticky topic.


>

[web2py] are 8 stickys really necessary at the top of this forum?

2012-04-29 Thread simon
Is it really necessary to have 8 stickies pinned to the top of this 
forum?  It is particularly intrusive on a mobile taking up a whole screen!

Have managed to filter it out on my laptop with an adblock filter: 
"*google.com##table[role="list"] 
tbody tr:nth-child(-n+8)"*
This works but chops off the first 8 posts on all forums. Is there a better 
way?





[web2py] IOErrors

2012-04-29 Thread Bruce Wade
Hi,

I am getting a lot of these errors:

Traceback (most recent call last):\n  File
"/home/developer/bossteam_pro/projects/yaw/gluon/main.py", line 447, in
wsgibase\nparse_get_post_vars(request, environ)\n  File
"/home/developer/bossteam_pro/projects/yaw/gluon/main.py", line 275, in
parse_get_post_vars\nrequest.body = copystream_progress(request) ###
stores request body\n  File
"/home/developer/bossteam_pro/projects/yaw/gluon/main.py", line 143, in
copystream_progress\ncopystream(source, dest, size, chunk_size)\n  File
"/home/developer/bossteam_pro/projects/yaw/gluon/fileutils.py", line 374,
in copystream\ndata = src.read(size)\nIOError: request data read error\n

Any suggestions?
NOTE: this is on an apache server.
-- 
-- 
Regards,
Bruce Wade
http://ca.linkedin.com/in/brucelwade
http://www.wadecybertech.com
http://www.fittraineronline.com - Fitness Personal Trainers Online
http://www.warplydesigned.com


[web2py] Re: web2py + leaflet

2012-04-29 Thread Ashraf Mansour
Hi, 

Can i know the reason of avoiding google mape api v3 ?




[web2py] web2py + leaflet

2012-04-29 Thread dancer`
Hello,

I'm working on a project involving the Leaflet API along with OSM, and was 
wondering if there was any documentation on integrating this with web2py. 
If not, are there any other people working on the same thing? 

Thank you. 


Re: [web2py] Re: Reloading modules

2012-04-29 Thread Massimo Di Pierro
Let's clarify something

web2py always uses the most comment models/controllers/views.
web2py (as Python does) loads modules onces and keeps them in memory, even 
when modules are shipped with the app.
The fact that 

from gluon.custom_import import track_changes; track_changes(True)

overrides this behavior if a feature to be used in development, not in 
production.

Reloading modules is a bad idea. It has performance penalties and can cause 
undesired effects because of global objects defined in the modules.
A production application should not do this. 



On Sunday, 29 April 2012 08:34:26 UTC-5, Yarin wrote:
>
> Got to say this is scary- we're about to go into production with our first 
> web2py app, and having erratic module behavior persist across server 
> restarts is not something we signed up for. Please let's address this.
>
> On Sunday, April 29, 2012 9:12:55 AM UTC-4, Yarin wrote:
>>
>> @Bruno- Thanks for confirming this issue
>> @Anthony - Thoughts?
>>
>>
>>>

Re: [web2py] Re: Emails never making it to hotmail accounts

2012-04-29 Thread Massimo Di Pierro
Than I was wrong and I do not know what the problem may be.

On Sunday, 29 April 2012 00:53:50 UTC-5, Bruce Wade wrote:
>
> Domain youadworld.com sending address sys...@youadworld.com
>
> On Sat, Apr 28, 2012 at 9:34 PM, Massimo Di Pierro <
> massimo.dipie...@gmail.com> wrote:
>
>> When you send it, you set a sender which is probably not the same domain 
>> as the sending machine. Some servers notice that and consider the email as 
>> spam. You should make sure the domain of the server is the same as the 
>> email sender address.
>>
>>
>> On Saturday, 28 April 2012 13:34:36 UTC-5, Alan Etkin wrote:
>>>
>>> Consider using .send() with raw=True in case the receiver account is 
>>> performing some payload filter.
>>>
>>> On Saturday, April 28, 2012 1:04:51 PM UTC-3, Bruce Wade wrote:

 Hi,

 Any suggestions on fixing the situation where hotmail never gets emails 
 from our servers using the mailer?

 -- 
 -- 
 Regards,
 Bruce Wade
 http://ca.linkedin.com/in/**brucelwade
 http://www.wadecybertech.com
 http://www.fittraineronline.**com  - 
 Fitness Personal Trainers Online
 http://www.warplydesigned.com


>
>
> -- 
> -- 
> Regards,
> Bruce Wade
> http://ca.linkedin.com/in/brucelwade
> http://www.wadecybertech.com
> http://www.fittraineronline.com - Fitness Personal Trainers Online
> http://www.warplydesigned.com
>
>  

[web2py] sqlite int field that behave as string ?

2012-04-29 Thread Sebastian E. Ovide
Hi All,

I have a field defined as integer but for some reason it is string


In [34]: db.agreement.client_stars.type
Out[34]: 'integer'

In [35]: db(db.agreement.client_stars >10
).select(db.agreement.client_stars).first()
Out[35]: 

In [36]: db._lastsql
Out[36]: 'SELECT  agreement.client_stars FROM agreement WHERE
(agreement.client_stars > 10);'


note: probably (I don't remember) it was String at some point...

any ideas ?

-- 
Sebastian E. Ovide


[web2py] Re: Images work in IE9, vanish in firefox

2012-04-29 Thread Anthony
Have you confirmed it's not related to any Firefox settings (
http://support.mozilla.org/en-US/kb/Images%20or%20animations%20do%20not%20show)?
 Can 
you pack and attach a minimal app that reproduces the problem?

Anthony

On Sunday, April 29, 2012 10:32:07 AM UTC-4, Simon Pickles wrote:
>
> Thanks for the reply. Oddly there is no missing image icon. The alt text 
> seems to flash up then disappear. I thought there was some CSS or js 
> weirdness going on but it makes no difference if I extend 'layout.html', ie 
> use no CSS and js.
>
> Firebug gives a preview of the image in question so Firefox clearly has 
> found it, just won't show it.
>
> Re recursive select, that's next on the todo list after displaying a 
> simple image!
>
>

[web2py] Re: Images work in IE9, vanish in firefox

2012-04-29 Thread Simon Pickles
Thanks for the reply. Oddly there is no missing image icon. The alt text seems 
to flash up then disappear. I thought there was some CSS or js weirdness going 
on but it makes no difference if I extend 'layout.html', ie use no CSS and js.

Firebug gives a preview of the image in question so Firefox clearly has found 
it, just won't show it.

Re recursive select, that's next on the todo list after displaying a simple 
image!


[web2py] Re: Images work in IE9, vanish in firefox

2012-04-29 Thread Anthony
What does Firefox show -- missing image icons? Do the links work?

Side note -- is a.advert.thumbnail a recursive 
select? 
Note that they execute a separate query for each item, so if you're looping 
through a long list of adverts, you're doing a lot of db queries. Instead, 
you might want to do a single initial query with a join so the thumbnail 
filenames are included in the original set of records.

Anthony

On Sunday, April 29, 2012 6:38:56 AM UTC-4, Simon Pickles wrote:
>
> Hi
>
> I am using this code to create a crude grid of images with links:
>
> {{for a in adverts:}}
> {{=A(IMG(_src=URL('static', 'images/ads/' + a.advert.thumbnail), 
> _alt="My Logo"),
>   _href=URL('default','index'))}}
>
> This renders as:
>  src="/test2/static/images/ads/jamie.jpg" />
>
> Shows up fine in IE9 but doesnt in Firefox 10. If I go to the address of 
> the image directly by putting it in the address bar (
> http://127.0.0.1:8000/test2/static/images/ads/jamie.jpg), it works.. the 
> image appears. It just doesnt appear in my firefox page when generated with 
> the python code above.
>
> Can anyone shed any light?
>


[web2py] Re: SQLFORM

2012-04-29 Thread Anthony
What do you want to change? Generally you would handle styling via CSS.

Anthony

On Sunday, April 29, 2012 1:58:17 AM UTC-4, Vibhor Purandare wrote:
>
> HOW TO CHANGE STYLE OF SQLFORM(eg TEXT BOX Style)
>  I want to change text box style?
>


Re: [web2py] Re: Reloading modules

2012-04-29 Thread Anthony

>
> @Bruno- Thanks for confirming this issue
> @Anthony - Thoughts?
>

Not sure what's going on. Perhaps Massimo or Pierre (creator of custom 
importer) could weigh in.

Anthony 


Re: [web2py] Re: Reloading modules

2012-04-29 Thread Yarin
Got to say this is scary- we're about to go into production with our first 
web2py app, and having erratic module behavior persist across server 
restarts is not something we signed up for. Please let's address this.

On Sunday, April 29, 2012 9:12:55 AM UTC-4, Yarin wrote:
>
> @Bruno- Thanks for confirming this issue
> @Anthony - Thoughts?
>
>
>>

[web2py] Re: insert into web2py tablel with field indices

2012-04-29 Thread Anthony
If you're using Python 2.7, you can use a dictionary comprehension:

db.Account_Master.insert(**{f: 'somevalue' for f in db.MyTable.fields})

otherwise, a generator expression passed to dict:

db.Account_Master.insert(**dict((f, 'somevalue') for f in db.MyTable.fields
))

Anthony

On Sunday, April 29, 2012 3:08:44 AM UTC-4, rahulserver wrote:
>
> The insert function in web2py expects db.tablename.insert(...) with column 
> name and value pairs. What if the table has lengthy field names and i wish 
> to insert in the table by iterating through all the fields.
> I tried:
>
> for field in db[db.MyTable]:
>  nme='\''+field.name+'\''
>  db.Account_Master.insert(nme='somevalue')
>
> It is giving me error as:
>  Field nme does not belong to the table
>
> When i try field.name instead of nme, editor does not let me save and 
> gives error as:
>
> keyword can't be an expression 
>
>

Re: [web2py] Re: Reloading modules

2012-04-29 Thread Yarin
@Bruno- Thanks for confirming this issue
@Anthony - Thoughts?


>

Re: [web2py] Re: Reloading modules

2012-04-29 Thread Yarin
@Bruno- Thanks for confirming this issue
@Anthony - Thoughts?

On Saturday, April 28, 2012 4:31:09 PM UTC-4, rochacbruno wrote:
>
> I have a similar problem.
>
> example:
>
> if I change this modules under this package: 
> https://github.com/rochacbruno/Movuca/tree/master/modules/datamodel they 
> never reloads, so I need to restart the server.
>
> But if I change something in modules under this: 
> https://github.com/rochacbruno/Movuca/tree/master/modules/handlers It 
> works ok, and I dont need to restart for reload.
>
> My track changes is in: 
> https://github.com/rochacbruno/Movuca/blob/master/models/0.py
>
> On Sat, Apr 28, 2012 at 4:42 PM, Yarin wrote:
>
>> @Anthony- There's really nothing specific to post, its a general thing, 
>> and not the first time i've dealt with it- just that this code fix doesn't 
>> change anything. Moreover, now I'm experiencing some truly odd behavior.
>>
>>1. I have a module that was throwing an error, and fixing it doesn't 
>>seem to update.
>>2. I quit python, restart web2py
>>3. The page loads fine, module working. 
>>4. I make a change- ANY change, including change in comments- and i 
>>start getting error tickets again, as if the old broken version of the 
>>module is still cached somewhere- how this would persist after quiting 
>> and 
>>restarting web2py makes no sense to me. It's just too erratic to track 
>> down. 
>>
>> I'm working locally with the rocket server on a Mac, if that means 
>> anything to anybody. 
>>
>> On Saturday, April 28, 2012 9:43:42 AM UTC-4, Yarin wrote:
>>>
>>> For dev purposes, it would be nice to be able to reload modules without 
>>> having to restart the server- or to have a setting that automatically 
>>> reloads on each request- Otherwise it's almost impossible to do active 
>>> module development from within web2py.
>>
>>
>
>
> -- 
>
> Bruno Rocha
> [http://rochacbruno.com.br]
>  
>

[web2py] Images work in IE9, vanish in firefox

2012-04-29 Thread Simon Pickles
Hi

I am using this code to create a crude grid of images with links:

{{for a in adverts:}}
{{=A(IMG(_src=URL('static', 'images/ads/' + a.advert.thumbnail), 
_alt="My Logo"),
  _href=URL('default','index'))}}

This renders as:


Shows up fine in IE9 but doesnt in Firefox 10. If I go to the address of 
the image directly by putting it in the address bar 
(http://127.0.0.1:8000/test2/static/images/ads/jamie.jpg), it works.. the 
image appears. It just doesnt appear in my firefox page when generated with 
the python code above.

Can anyone shed any light?


Re: [web2py] autodelete image computed field

2012-04-29 Thread CtrlSoft
on row delete works, but on row edit  when i change row image or delete 
only image, image_thumb stil remains on disk

[web2py] Re: insert into web2py tablel with field indices

2012-04-29 Thread simon
You could do:

for field in db.mytable:
 field.default=somevalue
db.mytable.insert()

However why would you want to do this?

On Sunday, 29 April 2012 08:08:44 UTC+1, rahulserver wrote:
>
> The insert function in web2py expects db.tablename.insert(...) with column 
> name and value pairs. What if the table has lengthy field names and i wish 
> to insert in the table by iterating through all the fields.
> I tried:
>
> for field in db[db.MyTable]:
>  nme='\''+field.name+'\''
>  db.Account_Master.insert(nme='somevalue')
>
> It is giving me error as:
>  Field nme does not belong to the table
>
> When i try field.name instead of nme, editor does not let me save and 
> gives error as:
>
> keyword can't be an expression 
>
>

[web2py] insert into web2py tablel with field indices

2012-04-29 Thread rahulserver
The insert function in web2py expects db.tablename.insert(...) with column 
name and value pairs. What if the table has lengthy field names and i wish 
to insert in the table by iterating through all the fields.
I tried:

for field in db[db.MyTable]:
 nme='\''+field.name+'\''
 db.Account_Master.insert(nme='somevalue')

It is giving me error as:
 Field nme does not belong to the table

When i try field.name instead of nme, editor does not let me save and gives 
error as:

keyword can't be an expression