[web2py] Re: New Site for web2py poweredby

2012-01-13 Thread Rahul
Looks nice and professional :) nice work

Rahul D

On Jan 13, 12:29 pm, Annet  wrote:
> Hi Andrew,
>
> Nice site. Just three questions, why did you swap photo gallery and
> login/join in the menu at the bottom? why not center the copyright
> message? isn't it possible to style the forum in the same colors as
> the rest of the site?
>
> Regards,
>
> Annet


[web2py] Re: why won't web2py create the databases

2012-01-13 Thread pbreit
What you are doing is pretty straightforward so I'm surprised you are 
running in to trouble.

I did notice this line is not quite right:
jodb.joke_category.requires = IS_IN_DB(jodb,jodb.joke.id)

Should be:
jodb.joke_category.joke_id.requires = IS_IN_DB(jodb, 
joke.id
)

For me, "jodb" was hard to look at since I'm so used to just "db".

I do the same thing as Villas. I develop against SQLite and then deploy on 
Postgres. I have migrations turned off in my production environment and 
then I do migrations more carefully than I do in dev.


[web2py] Re: controller question

2012-01-13 Thread pbreit
7mb sounds quite large. Any reason you can't break it up?

Re: [web2py] Re: web2py powerby screenshot

2012-01-13 Thread Albert Abril
Hey!

Can the mantainer of powereby remove the "arritmiacolectiva.es" link?
I'm not the mantainer of the web anymore and they moved to some ugly php
website :P

Regards!




2012/1/12 Massimo Di Pierro 

> good job indeed.
>
> On Jan 12, 9:26 am, Francisco Costa  wrote:
> > Thanks, we've been working hard on it
> >
> > No Massimo, it's a simple input that submits via ajax() web2py
> > function. We then return the result by getting the id of the form.
> >
> > I will send invitations very soon. I will also provide an early access
> > code for the web2py community.
> >
> > On Jan 12, 2:41 pm, Massimo Di Pierro 
> > wrote:
> >
> >
> >
> >
> >
> >
> >
> > > I really like the form for requesting invitation. Is that a jquery
> > > plugin?
> >
> > > On Jan 12, 8:07 am, Anthony  wrote:
> >
> > > > Done. Thanks for the heads up. I like the new look.
> >
> > > > Anthony
> >
> > > > On Thursday, January 12, 2012 8:33:03 AM UTC-5, Francisco Costa
> wrote:
> >
> > > > > Can anyone change tymr.com screenshot onhttp://
> www.web2py.com/poweredby/
> > > > > That one is very old.
> > > > > tx
>


[web2py] Re: Routes error

2012-01-13 Thread Web2Py Freak
Dear all ,

am still trying and its not working  , am just trying to change the
default app , i renamed the router.example.py to router.py and changed
the the welcome app and added another one  , and then i entered the
admin and clicked reload routes ,and then i restarted the sever , but
nothing happend !!

what to do ?


[web2py] Re: Set table name

2012-01-13 Thread Marcello
No one ??

On 10 jan, 14:51, Marcello Parra  wrote:
> Hello Massimo and all,
>
> I'm trying to use web2py for several projects of mine.
> I always find a problem that should be solved if I could set the table name.
>
> Let me show an example...
>
> Suppose that I have this:
>
> db.define_table('person12345', Field('name'))
> db.define_table('dog12345', Field('name'), Field('owner', db.person))
>
> person12345 and dog12345 are names of the tables.
> As they are already running projects, I can't change them...
>
> If I don't want to call a dog, dog12345 all the time, I could do this:
>
> person=db.define_table('person12345', Field('name'))
> dog=db.define_table('dog12345', Field('name'), Field('owner', db.person))
>
> This should work fine.
>
> But I can't do this:
> person[1].dog.select()
>
> This should just work with:
> person[1].dog12345.select()
>
> Is there a way to do this ?
>
> Thanks...


[web2py] Rows without Headers

2012-01-13 Thread Vikas Singhal
Hi ,

How can produce a list of rows without the header information. I need
to use this to json encode and send it datatable which will then
display it. Currently I have written a loop which does the job but I
was wondering if we have something already?

Regards,
Vikas


[web2py] Re: Set table name

2012-01-13 Thread Ross Peoples
I don't know if anyone has tried this kind of thing before. The only idea I 
have right now is to alias your table objects. This MIGHT work, or might 
make things worse :) Either way, try this and see if it works (no promises):

db.define_table('person12345',
Field('name'),
)
db.person = db.person12345

db.define_table('dog12345',
Field('name'),
Field('owner', db.person)
)
db.dog = db.dog12345



[web2py] Custom Operator

2012-01-13 Thread Vikas Singhal
Hi,

I am using SQLCustomType to declare a field inet to tie it to string.
Now I want to use custom SQL operator on it. I am trying to use <<=
operator which says contains within, its like LIKE for inet field. How
can I create it?

Ref: http://www.postgresql.org/docs/current/static/functions-net.html

Vikas


[web2py] Re: New Site for web2py poweredby

2012-01-13 Thread Cliff
Very nice.

A agree with Annet about the forum styling, though.

On Jan 13, 3:16 am, Rahul  wrote:
> Looks nice and professional :) nice work
>
> Rahul D
>
> On Jan 13, 12:29 pm, Annet  wrote:
>
>
>
>
>
>
>
> > Hi Andrew,
>
> > Nice site. Just three questions, why did you swap photo gallery and
> > login/join in the menu at the bottom? why not center the copyright
> > message? isn't it possible to style the forum in the same colors as
> > the rest of the site?
>
> > Regards,
>
> > Annet


[web2py] Row difference bug

2012-01-13 Thread Kenneth Lundström

Hello list,

I got an Internal error and the problem is in a views file.

And as we know row numbers in the source files is not the same as in the 
Error page. So I started looking at the error on the Error page and I 
think I found a bug in showing the code.


File"/views/troop/campaign.html",line436,in
TypeError:unsupported operand type(s)for-:'NoneType'and'long'


So I scrolled down to line number 436
436if tracker_rows[person_id].has_key(product.id):

and I can't understand whats wrong.

So I scrolled back up to check the row number and then by mistake I 
looked at the short version that only shows 20 rows. In that listing row 
numer 436 is:
to_be_returned[product.id] = 
tracker_rows[person_id][product.id].count_received - 
tracker_rows[person_id][product.id].count_paid - 
tracker_rows[person_id][product.id].count_returned


makes much more sense.


Kenneth


[web2py] Get the URL

2012-01-13 Thread Web2Py Freak
Dear ALl ,

How can i get the URL of the page am in ?


Re: [web2py] Re: Set table name

2012-01-13 Thread Marcello Parra
Thanks Ross

I tried this, but did not work:

- db.person[1].dog.select() raises:
  KeyError: 'dog'

but
- db.person[1].dog12345.select()
  works fine



On Fri, Jan 13, 2012 at 10:46 AM, Ross Peoples wrote:

> I don't know if anyone has tried this kind of thing before. The only idea
> I have right now is to alias your table objects. This MIGHT work, or might
> make things worse :) Either way, try this and see if it works (no promises):
>
> db.define_table('person12345',
> Field('name'),
> )
> db.person = db.person12345
>
> db.define_table('dog12345',
> Field('name'),
> Field('owner', db.person)
> )
> db.dog = db.dog12345
>
>


[web2py] Links to referencing records - 'str' object has no attribute 'ignore_common_filters'

2012-01-13 Thread isi_jca
Hello!!!

I am a beginner and get the next ticket. Anybody Can I Help me?. Thanks in 
advance.

Ticket ID 

127.0.0.1.2012-01-12.14-09-56.3407b807-6bc6-4428-a7f2-0173a5473524
 'str' object has no attribute 
'ignore_common_filters' Version  web2py™ (1, 99, 4, datetime.datetime(2011, 
12, 14, 14, 46, 14), 'stable')  Python Python 2.7.2+: /usr/bin/python  
Traceback 

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.

Traceback (most recent call last):
  File "/home/jalbornoz/web2py/gluon/restricted.py", line 204, in restricted
exec ccode in environment
  File "/home/jalbornoz/web2py/applications/ExpedienteX/controllers/default.py" 
, 
line 135, in 
  File "/home/jalbornoz/web2py/gluon/globals.py", line 172, in 
self._caller = lambda f: f()
  File "/home/jalbornoz/web2py/applications/ExpedienteX/controllers/default.py" 
, 
line 80, in list_records
records = db(query).select(db[table].ALL)
  File "/home/jalbornoz/web2py/gluon/dal.py", line 6333, in select
return self.db._adapter.select(self.query,fields,attributes)
  File "/home/jalbornoz/web2py/gluon/dal.py", line 1274, in select
sql = self._select(query, fields, attributes)
  File "/home/jalbornoz/web2py/gluon/dal.py", line 1155, in _select
if query and not query.ignore_common_filters:
AttributeError: 'str' object has no attribute 'ignore_common_filters'

 Error snapshot [image: help]  

('str' object has no attribute 
'ignore_common_filters') 

inspect attributes 
 Frames 
   
   -  
   
   *File /home/jalbornoz/web2py/gluon/restricted.py in restricted at line 
   204* code arguments variables 
-  
   
   *File 
   /home/jalbornoz/web2py/applications/ExpedienteX/controllers/default.py in 
at line 135* code arguments variables 
-  
   
   *File /home/jalbornoz/web2py/gluon/globals.py in  at line 172* 
   code arguments variables 
-  
   
   *File 
   /home/jalbornoz/web2py/applications/ExpedienteX/controllers/default.py in 
   list_records at line 80* code arguments variables 
-  
   
   *File /home/jalbornoz/web2py/gluon/dal.py in select at line 6333* code 
   arguments variables 
-  
   
   *File /home/jalbornoz/web2py/gluon/dal.py in select at line 1274* code 
   arguments variables 
-  
   
   *File /home/jalbornoz/web2py/gluon/dal.py in _select at line 1155* code 
   arguments variables 
Function argument list 
   
   (self=, query='dog.owner=5', 
   fields=[, , 
   ], attributes={})
Code listing 
   
   1150.
   1151.
   1152.
   1153.
   1154.
   1155.
   
   1156.
   1157.
   1158.
   1159.
   
   else:
   new_fields.append(item)
   fields = new_fields
   tablenames = self.tables(query)
   
   if query and not query.ignore_common_filters:
   
   query = self.common_filter(query,tablenames)
   
   if not fields:
   for table in tablenames:
   
Variables  query 'dog.owner=5'  query.ignore_common_filters undefined  

 Context 

locals request session response 
 In file: 
/home/jalbornoz/web2py/applications/ExpedienteX/controllers/default.py 

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
95.
96.
97.
98.
99.
100.
101.
102.
103.
104.
105.
106.
107.
108.
109.
110.
111.
112.
113.
114.
115.
116.
117.
118.
119.
120.
121.
122.
123.
124.
125.
126.
127.
128.
129.
130.
131.
132.
133.
134.
135.
136.

# -*- coding: utf-8 -*-
# this file is released under public domain and you can use without limitations

#
## This is a samples controller
## - index is the default action of any application
## - user is required for authentication and authorization
## - download is for downloading files uploaded in the db (does streaming)
## - call exposes all registered services (none by default)
#
@auth.requires_login()
def index():
"""
example action using the internationalization operator T and flash
rendered by views/default/index.html or views/generic.html
"""
   #response.flash = "Test Your English"
elemento = db().select(db.menu.ALL)
return dict(items=elemento)
# Permite realizar el ABM de las tablas de la aplicación, es llamada desde 
setting.html
def menu():
grid=SQLFORM 
.smartgrid(db[request 
.args(0)],user_signature=True,deletable=True,editable=True,links_in_grid=True)
return 

Re: [web2py] Re: Set table name

2012-01-13 Thread Marin Pranjić
Try this,

dog = 'dog12345'
db.person[1][dog].select()

On Fri, Jan 13, 2012 at 2:37 PM, Marcello Parra  wrote:

> Thanks Ross
>
> I tried this, but did not work:
>
> - db.person[1].dog.select() raises:
>   KeyError: 'dog'
>
> but
> - db.person[1].dog12345.select()
>   works fine
>
>
>
> On Fri, Jan 13, 2012 at 10:46 AM, Ross Peoples wrote:
>
>> I don't know if anyone has tried this kind of thing before. The only idea
>> I have right now is to alias your table objects. This MIGHT work, or might
>> make things worse :) Either way, try this and see if it works (no promises):
>>
>> db.define_table('person12345',
>> Field('name'),
>> )
>> db.person = db.person12345
>>
>> db.define_table('dog12345',
>> Field('name'),
>> Field('owner', db.person)
>> )
>> db.dog = db.dog12345
>>
>>
>


[web2py] List of fields to select()

2012-01-13 Thread Vikas Singhal
Hi,

How can I pass a list of fields to db(query).select() functions. For
e.g cols = { field1, field2, field3 } does not work when I call
db(query).select(cols). Any help?

- Vikas


[web2py] Re: Computed Fields broken by 1.99.2

2012-01-13 Thread Alan Etkin
I think I was able to define readable auto computeable fields (fields
were able to re-compute themselves on insert or update, at least with
Sqlite) in the past. This is no longer supported (of course, if former
versions did)?

On 17 nov 2011, 11:25, David Manns  wrote:
> I have finally figured out the cause of my problem, though not why
> there was inconsistency in behavior with somecomputedfields updating
> and others not.  I was putting writable=false and readable=false on
> thecomputedfields in my model.  I'm not sure why I thought this was
> correct usage; it makes sense that readable=false might be needed to
> prevent thefieldfrom being displayed in forms, but given that the
> form won't show thefield, writable=false would be unnecessary.
> It seems that neither writable=false nor readable=false is needed 
> forcomputedfields, they appear to be automatically not displayed in
> SQLFORM andCRUD.  Readable=false causes no harm but writable=false
> *MAY* cause thefieldto not be recomputed on update, though it will
> becomputedon record creation.  This behavior is still present in the
> nightly build.
> The book could use some clarification in this area!
> David
>
> On Nov 17, 1:50 am, Massimo Di Pierro 
> wrote:
>
> > I believe this is a bug and it has already been fixed in trunk and
> > nightly build. can you confirm?
>
> > On Nov 16, 8:23 pm, Anthony  wrote:
>
> > > On Wednesday, November 16, 2011 8:39:54 PM UTC-5, David Manns wrote:
>
> > > > This is all very alarming in a framework which boasts of "always
> > > > maintaining backward compatibility" - quote taken from the preface of
> > > > "the book".
>
> > > The intention was certainly not to break backward compatibility. If
> > > something isn't working the same, it's a bug, not a backward compatibility
> > > violation (unless, of course, the original behavior was a bug and was
> > > simply being fixed). It's always a good idea to test upgrades before
> > > deploying to production, and if you find bugs, report them -- they will
> > > usually be fixed very quickly. Even better, test out the nightly builds or
> > > trunk from time to time, and report bugs before they make it into stable
> > > releases.
>
> > > Anthony
>
>


[web2py] Responsivekit for web2py!

2012-01-13 Thread Angelo Compagnucci
Hello list,

I want to share with you my new plugin (aiming to web2py inclusion!),
responsivekit, you can find it on github
https://github.com/angeloc/web2py-responsivekit.

Responsivekit implements responsive tables and responsive images using the
best known techniques at the moment (I'm basing on Marcotte,
SmashingMagazine and filamentgroups reccomendations). More will come!

Comments are welcome.

Cheers,

Angelo

-- 
Profile: http://it.linkedin.com/in/compagnucciangelo


[web2py] Re: Get the URL

2012-01-13 Thread Anthony
request.env.path_info is the URL of the requested page before any incoming 
URL rewrite and without the query string. request.env.request_uri is the 
URL of the requested page after any incoming URL rewrite and including the 
query string.

Anthony

On Friday, January 13, 2012 8:31:58 AM UTC-5, Web2Py Freak wrote:
>
> Dear ALl , 
>
> How can i get the URL of the page am in ?



Re: [web2py] Re: Set table name

2012-01-13 Thread Marcello Parra
Marin,

Thanks a lot.
This solved the problem

Two questions:

- why the brackets ??

- is this the most "elegant" what to do this ??


Thanks...



On Fri, Jan 13, 2012 at 11:45 AM, Marin Pranjić wrote:

> Try this,
>
> dog = 'dog12345'
> db.person[1][dog].select()
>
> On Fri, Jan 13, 2012 at 2:37 PM, Marcello Parra wrote:
>
>> Thanks Ross
>>
>> I tried this, but did not work:
>>
>> - db.person[1].dog.select() raises:
>>   KeyError: 'dog'
>>
>> but
>> - db.person[1].dog12345.select()
>>   works fine
>>
>>
>>
>> On Fri, Jan 13, 2012 at 10:46 AM, Ross Peoples wrote:
>>
>>> I don't know if anyone has tried this kind of thing before. The only
>>> idea I have right now is to alias your table objects. This MIGHT work, or
>>> might make things worse :) Either way, try this and see if it works (no
>>> promises):
>>>
>>> db.define_table('person12345',
>>> Field('name'),
>>> )
>>> db.person = db.person12345
>>>
>>> db.define_table('dog12345',
>>> Field('name'),
>>> Field('owner', db.person)
>>> )
>>> db.dog = db.dog12345
>>>
>>>
>>
>


[web2py] Re: List of fields to select()

2012-01-13 Thread Anthony
On Friday, January 13, 2012 8:50:30 AM UTC-5, Vikas Singhal wrote:
>
> Hi, 
>
> How can I pass a list of fields to db(query).select() functions. For 
> e.g cols = { field1, field2, field3 }


{} makes a dict, not a list -- you want:

cols = [field1, field2, field3]

In that case:

db(query).select(*cols)

Note, that is standard Python syntax (*args expands a list into a set of 
positional arguments).

Anthony



Re: [web2py] Re: Set table name

2012-01-13 Thread Anthony

>
> Thanks a lot.
> This solved the problem
>
> Two questions:
>
> - why the brackets ??
>

Tables and fields can be accessed as properties via the usual "." notation, 
but also via keys like a dictionary. So,

db['tablename'] is equivalent to db.tablename and db.tablename['fieldname']is 
equivalent to 
db.tablename.fieldname.
 

>
> - is this the most "elegant" what to do this ??
>

Probably.

Anthony



[web2py] Re: Web2py binary distribution and psycopg2 driver

2012-01-13 Thread Alan Etkin
Sorry, I probably used the psycopg windows binaries with web2py source
so using those installers will not solve the problem.

On 11 ene, 08:53, Álvaro J. Iradier  wrote:
> Thanks for your comments.
>
> Do you remember how you did it? I can make it work correctly when
> using the source version of web2py, and I installpsycopgunder the
> python installation (c:\python27).
>
> However, when trying the binary distribution, I have tried extracting
> the files from thepsycopgversion for python 2.5, and putting them:
>
>  a) Inside web2py\site-packages: They work if I start a shell and try
> "import psycopg2", "psycopg2.connect(...)", etc. However they are not
> detected as an available driver, and trying to connect the DAL to
> Postgres fails with "Unable to import driver"
>  b) I tried putting the files inside the library.zip file created by
> py2exe, but it just didn't work even when importing from the
> application shell...
>
> I have managed to get it working using portable python + web2py source
> distribution, but I think it would be easier to bundle it with web2py
> binary.
>
> Greets.
>
> On Jan 11, 11:55 am, Alan Etkin  wrote:
>
> > I think i installed one of the listed binary files listed here without
> > problems:http://stickpeople.com/projects/python/win-psycopg/
>
> > Regards
>
> > On 10 ene, 17:14, Álvaro J. Iradier  wrote:
>
> > > Hi,
>
> > > I was trying to distribute an application with web2py binary for
> > >windows, but I required the PostgreSQL driver. So I copied the
> > > psycopg2 files to site-packages in the web2py binary folder.
>
> > > If I start a shell from an application, I can import psycopg2 and
> > > connect to the database. However, it looks like the DAL does not
> > > recognize the psycopg2 driver. I am getting the error:
>
> > > Traceback (most recent call last):
> > >   File "gluon/restricted.py", line 204, in restricted
> > >   File "C:/Users/airadier/Downloads/web2py_win/web2py/applications/
> > > init/models/10_db.py", line 13, in 
> > >   File "gluon/dal.py", line 4749, in __init__
> > > RuntimeError: Failure to connect, tried 5 times:
> > > Traceback (most recent call last):
> > >   File "gluon/dal.py", line 4736, in __init__
> > >   File "gluon/dal.py", line 1867, in __init__
> > > RuntimeError: Unable to import driver
>
> > > My guess is when DAL is being initialized, the site-packages folder is
> > > not yet in the sys.path, so the following fails:
>
> > >     try:
> > >         import psycopg2
> > >         from psycopg2.extensions import adapt as psycopg2_adapt
> > >         drivers.append('PostgreSQL')
> > >     except ImportError:
> > >         logger.debug('no psycopg2 driver')
>
> > > Is there a reason for this? Is it a bug or a feature?
>
> > > Is there other way to acomplish these? And is it allowed to distribute
> > > a binary web2py including the PostgreSQL driver?
>
> > > Thanks in advance.
>
>


[web2py] Re: Links to referencing records - 'str' object has no attribute 'ignore_common_filters'

2012-01-13 Thread Anthony
Looks like somewhere you have a query 'dog.owner=5'. Instead, that should 
be:

dog.owner == 5

Note, no surrounding quotes, and use of == (to test equality) instead of = 
(used for assignment).

Anthony

On Friday, January 13, 2012 6:20:58 AM UTC-5, isi_jca wrote:
>
> Hello!!!
>
> I am a beginner and get the next ticket. Anybody Can I Help me?. Thanks in 
> advance.
>
> Ticket ID 
>
> 127.0.0.1.2012-01-12.14-09-56.3407b807-6bc6-4428-a7f2-0173a5473524
>  'str' object has no attribute 
> 'ignore_common_filters' Version  web2py™ (1, 99, 4, 
> datetime.datetime(2011, 12, 14, 14, 46, 14), 'stable')  Python Python 
> 2.7.2+: /usr/bin/python  Traceback 
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
> 10.
> 11.
> 12.
> 13.
> 14.
> 15.
> 16.
>
> Traceback (most recent call last):
>   File "/home/jalbornoz/web2py/gluon/restricted.py", line 204, in restricted
> exec ccode in environment
>   File 
> "/home/jalbornoz/web2py/applications/ExpedienteX/controllers/default.py" 
> ,
>  line 135, in 
>   File "/home/jalbornoz/web2py/gluon/globals.py", line 172, in 
> self._caller = lambda f: f()
>   File 
> "/home/jalbornoz/web2py/applications/ExpedienteX/controllers/default.py" 
> ,
>  line 80, in list_records
> records = db(query).select(db[table].ALL)
>   File "/home/jalbornoz/web2py/gluon/dal.py", line 6333, in select
> return self.db._adapter.select(self.query,fields,attributes)
>   File "/home/jalbornoz/web2py/gluon/dal.py", line 1274, in select
> sql = self._select(query, fields, attributes)
>   File "/home/jalbornoz/web2py/gluon/dal.py", line 1155, in _select
> if query and not query.ignore_common_filters:
> AttributeError: 'str' object has no attribute 'ignore_common_filters'
>
>  Error snapshot [image: help]  
>
> ('str' object has no attribute 
> 'ignore_common_filters') 
>
> inspect attributes 
>  Frames 
>
>-  
>
>*File /home/jalbornoz/web2py/gluon/restricted.py in restricted at line 
>204* code arguments variables 
> -  
>
>*File 
>/home/jalbornoz/web2py/applications/ExpedienteX/controllers/default.py in 
> at line 135* code arguments variables 
> -  
>
>*File /home/jalbornoz/web2py/gluon/globals.py in  at line 172* 
>code arguments variables 
> -  
>
>*File 
>/home/jalbornoz/web2py/applications/ExpedienteX/controllers/default.py in 
>list_records at line 80* code arguments variables 
> -  
>
>*File /home/jalbornoz/web2py/gluon/dal.py in select at line 6333* code 
>arguments variables 
> -  
>
>*File /home/jalbornoz/web2py/gluon/dal.py in select at line 1274* code 
>arguments variables 
> -  
>
>*File /home/jalbornoz/web2py/gluon/dal.py in _select at line 1155* code 
>arguments variables 
> Function argument list 
>
>(self=, query='dog.owner=5', 
>fields=[, , 
>], attributes={})
> Code listing 
>
>1150.
>1151.
>1152.
>1153.
>1154.
>1155.
>
>1156.
>1157.
>1158.
>1159.
>
>else:
>new_fields.append(item)
>fields = new_fields
>tablenames = self.tables(query)
>
>if query and not query.ignore_common_filters:
>
>query = self.common_filter(query,tablenames)
>
>if not fields:
>for table in tablenames:
>
> Variables  query 'dog.owner=5'  query.ignore_common_filters undefined  
> 
>  Context 
>
> locals request session response 
>  In file: 
> /home/jalbornoz/web2py/applications/ExpedienteX/controllers/default.py 
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
> 10.
> 11.
> 12.
> 13.
> 14.
> 15.
> 16.
> 17.
> 18.
> 19.
> 20.
> 21.
> 22.
> 23.
> 24.
> 25.
> 26.
> 27.
> 28.
> 29.
> 30.
> 31.
> 32.
> 33.
> 34.
> 35.
> 36.
> 37.
> 38.
> 39.
> 40.
> 41.
> 42.
> 43.
> 44.
> 45.
> 46.
> 47.
> 48.
> 49.
> 50.
> 51.
> 52.
> 53.
> 54.
> 55.
> 56.
> 57.
> 58.
> 59.
> 60.
> 61.
> 62.
> 63.
> 64.
> 65.
> 66.
> 67.
> 68.
> 69.
> 70.
> 71.
> 72.
> 73.
> 74.
> 75.
> 76.
> 77.
> 78.
> 79.
> 80.
> 81.
> 82.
> 83.
> 84.
> 85.
> 86.
> 87.
> 88.
> 89.
> 90.
> 91.
> 92.
> 93.
> 94.
> 95.
> 96.
> 97.
> 98.
> 99.
> 100.
> 101.
> 102.
> 103.
> 104.
> 105.
> 106.
> 107.
> 108.
> 109.
> 110.
> 111.
> 112.
> 113.
> 114.
> 115.
> 116.
> 117.
> 118.
> 119.
> 120.
> 121.
> 122.
> 123.
> 124.
> 125.
> 126.
> 127.
> 128.
> 129.
> 130.
> 131.
> 132.
> 133.
> 134.
> 135.
> 136.
>
> # -*- coding: utf-8 -*-
> # this file is released under public domain and you can use without 
> limitations
>
> #
> ## This is a samples controller
> ## - index is the default action of any application
> ## - user is required for authentication and authorization
> ## - download is for downloading fi

Re: [web2py] Re: Set table name

2012-01-13 Thread Marcello Parra
Anthony, thanks very much



On Fri, Jan 13, 2012 at 12:03 PM, Anthony  wrote:

> Thanks a lot.
>> This solved the problem
>>
>> Two questions:
>>
>> - why the brackets ??
>>
>
> Tables and fields can be accessed as properties via the usual "."
> notation, but also via keys like a dictionary. So,
>
> db['tablename'] is equivalent to db.tablename and
> db.tablename['fieldname'] is equivalent to db.tablename.fieldname.
>
>
>>
>> - is this the most "elegant" what to do this ??
>>
>
> Probably.
>
> Anthony
>
>


[web2py] Re: Get the URL

2012-01-13 Thread Web2Py Freak
i want the full URL and i tried   request.env.request_url  like you
said and i got (None). !


Re: [web2py] Re: Get the URL

2012-01-13 Thread Jonathan Lundell
On Jan 13, 2012, at 6:49 AM, Web2Py Freak wrote:

> i want the full URL and i tried   request.env.request_url  like you
> said and i got (None). !

That's not what Anthony said to try; reread his message, please.

What are you trying to accomplish?


[web2py] Re: Get the URL

2012-01-13 Thread Anthony
request_uri, not request_url

On Friday, January 13, 2012 9:49:52 AM UTC-5, Web2Py Freak wrote:
>
> i want the full URL and i tried   request.env.request_url  like you 
> said and i got (None). ! 
>


[web2py] Re: Get the URL

2012-01-13 Thread Web2Py Freak
ok i did request_uri and got None ?? i want the full url with tha
domain and args because i want to use it for the facebook like


[web2py] Re: Get the URL

2012-01-13 Thread Anthony
On Friday, January 13, 2012 10:22:40 AM UTC-5, Web2Py Freak wrote:
>
> ok i did request_uri and got None ?? i want the full url with tha 
> domain and args because i want to use it for the facebook like


Something is wrong -- please show your code. 


[web2py] Re: CRUD Form

2012-01-13 Thread Anthony
Can you show your controller and view code?

On Friday, January 13, 2012 2:03:26 AM UTC-5, tOlorun wrote:
>
> Hello everyone 
>
> Please iam trying to submit a crud.create form 
>
> which iam loading as a component via ajax 
>
> my url is not the url is not pointing to the function of the crud form 
>
> i.e. my crud form is in a controller is celebrities and the function 
> is set_up 
>
> but my url is default/index (this is how i want it) 
>
> but my form is not being processed 
>
> please any ideas on how to get it processed



Re: [web2py] Re: Get the URL

2012-01-13 Thread Jonathan Lundell
On Jan 13, 2012, at 7:22 AM, Web2Py Freak wrote:

> ok i did request_uri and got None ?? i want the full url with tha
> domain and args because i want to use it for the facebook like

It's possible that you need to enable routing to set request_uri (I'm not 
sure). This is how the router builds it; you could try it yourself:

request_uri = request.env.path_info + (request.env.query_string and ('?' + 
request.env.query_string) or '')



Re: [web2py] Re: Get the URL

2012-01-13 Thread Jonathan Lundell
On Jan 13, 2012, at 7:31 AM, Jonathan Lundell wrote:

> On Jan 13, 2012, at 7:22 AM, Web2Py Freak wrote:
> 
>> ok i did request_uri and got None ?? i want the full url with tha
>> domain and args because i want to use it for the facebook like
> 
> It's possible that you need to enable routing to set request_uri (I'm not 
> sure). This is how the router builds it; you could try it yourself:
> 
>request_uri = request.env.path_info + (request.env.query_string and ('?' + 
> request.env.query_string) or '')

Another way to see the URL from web2py's point of view is to use URL(). 

request_uri = URL(args=request.args, vars=request.vars, host=True)

...where host=True asks for an absolute URL (you can specify a host name if you 
want). I haven't tested this particular call, so I might have some details 
wrong. It has the advantage of rewriting the URL if any rewriting is necessary.



[web2py] Re: SQLFORM: file upload

2012-01-13 Thread Anthony
This is handled by the UploadWidget class in sqlhtml.py. Looks like all of 
that is hard-coded. You can provide a callable (e.g., lambda) for the 
download URL, but maybe we should allow a callable for the entire 
link/delete element so it can be customized. For now, your best alternative 
might be a custom widget for the upload field:

db.define_table('mytable', Field('myupload', 'upload', 
widget=custom_upload_widget))

For details on custom widgets, 
see http://web2py.com/books/default/chapter/29/7#Widgets.

Anthony

On Friday, January 13, 2012 12:59:38 AM UTC-5, mweissen wrote:
>
> Hi, 
>
> I have built a form with SQLFORM(... upload=URL(r=request, 
> f='download')...)
> There is a link to download the uploaded file (it's a picture) and a 
> checkbox to delete this file. 
>
> That is very simple and it works fine. But it does not look very nice:
>
>
>
> Foto: 
> [file
> |delete]
>
> No spaces around the word "file", no space between the checkbox and the 
> word "delete" and all in one row. 
>
> It seems, that the "T-operator" is missing for "fle" and "delete"!
>  
> I want to change the layout and to put these elements below the picture or 
> at least in a new row. Further I want to remove the square brackets.
>
>- Is there any parameter to change the layout? 
>- Or is it possible to use the "extra form elements" to re-build this 
>part of the form?
>- Or could another function instead of f='download' the solution?
>
> *I have tried to find the source code of this part, but I did not find it.
> *
> Is there any detailed description of the upload parameter?
>
> Regards, Martin
>


Re: [web2py] Re: Get the URL

2012-01-13 Thread Anthony
On Friday, January 13, 2012 10:31:04 AM UTC-5, Jonathan Lundell wrote:
>
> On Jan 13, 2012, at 7:22 AM, Web2Py Freak wrote:
>
> > ok i did request_uri and got None ?? i want the full url with tha
> > domain and args because i want to use it for the facebook like
>
> It's possible that you need to enable routing to set request_uri (I'm not 
> sure).
>
Good point -- yes, looks like request_uri is only available with routing 
enabled. Another alternative is request.url (though that doesn't include 
the query string, which can be found in request.env.query_string). And as 
Jonathan pointed out, URL(), without any arguments, should return the URL 
of the current page (after rewrite).

Anthony


[web2py] Qdb: a really simple client/server remote python debugger

2012-01-13 Thread Mariano Reingart
FYI

I'm working on a enhancement to Pdb, wich could be used from a remote
terminal to any server (and in the near future, with a nice visual
IDE):

http://code.google.com/p/rad2py/wiki/QdbRemotePythonDebugger

Quick steps:

1. Download qdb.py (put in web2py modules and in your local folder)

2. Add the following line as a breakpoint:
import qdb; qdb.set_trace()

3. In a terminal, run
python qdb.py

Open your webpage, when the qdb.set_trace() line is reached, you'll
see the debugger prompt in your terminal.

To connect to a remote server, just change addres and password in the
source file.

Comments and contributions are welcome ;-)

Best regards

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


Re: [web2py] Re: Get the URL

2012-01-13 Thread Jonathan Lundell
On Jan 13, 2012, at 7:50 AM, Anthony wrote:

> On Friday, January 13, 2012 10:31:04 AM UTC-5, Jonathan Lundell wrote:
> On Jan 13, 2012, at 7:22 AM, Web2Py Freak wrote:
> > ok i did request_uri and got None ?? i want the full url with tha
> > domain and args because i want to use it for the facebook like
> 
> It's possible that you need to enable routing to set request_uri (I'm not 
> sure).
> 
> Good point -- yes, looks like request_uri is only available with routing 
> enabled. Another alternative is request.url (though that doesn't include the 
> query string, which can be found in request.env.query_string). And as 
> Jonathan pointed out, URL(), without any arguments, should return the URL of 
> the current page (after rewrite).
> 

It does need argument, though; otherwise I don't think that args, vars or host 
will be included.

[web2py] Re: Responsivekit for web2py!

2012-01-13 Thread Angelo Compagnucci
Hi list!

I'm reading Marcotte's book (Responsive Web Design) and I think we should
modify slightly our web2py.css. Tag img should be
img { border: 0; max-width: 100%;} so it can use the width of parent
instead to overflow if bigger than that and it automatically reflow when
size changes.

This is a patch:

web2py.css

25c25
< img { border: 0; }
---
> img { border: 0; max-width: 100%; }

2012/1/13 Angelo Compagnucci 

> Hello list,
>
> I want to share with you my new plugin (aiming to web2py inclusion!),
> responsivekit, you can find it on github
> https://github.com/angeloc/web2py-responsivekit.
>
> Responsivekit implements responsive tables and responsive images using the
> best known techniques at the moment (I'm basing on Marcotte,
> SmashingMagazine and filamentgroups reccomendations). More will come!
>
> Comments are welcome.
>
> Cheers,
>
> Angelo
>
> --
> Profile: http://it.linkedin.com/in/compagnucciangelo
>



-- 
Profile: http://it.linkedin.com/in/compagnucciangelo


Re: [web2py] Qdb: a really simple client/server remote python debugger

2012-01-13 Thread Angelo Compagnucci
I'll try as soon as possible, nice work!

Thanks!

2012/1/13 Mariano Reingart 

> FYI
>
> I'm working on a enhancement to Pdb, wich could be used from a remote
> terminal to any server (and in the near future, with a nice visual
> IDE):
>
> http://code.google.com/p/rad2py/wiki/QdbRemotePythonDebugger
>
> Quick steps:
>
> 1. Download qdb.py (put in web2py modules and in your local folder)
>
> 2. Add the following line as a breakpoint:
> import qdb; qdb.set_trace()
>
> 3. In a terminal, run
> python qdb.py
>
> Open your webpage, when the qdb.set_trace() line is reached, you'll
> see the debugger prompt in your terminal.
>
> To connect to a remote server, just change addres and password in the
> source file.
>
> Comments and contributions are welcome ;-)
>
> Best regards
>
> Mariano Reingart
> http://www.sistemasagiles.com.ar
> http://reingart.blogspot.com
>



-- 
Profile: http://it.linkedin.com/in/compagnucciangelo


Re: [web2py] Register User issue -- Blank password

2012-01-13 Thread VIREN PATEL
Thanks for the help.
i recognized that we had our own customised auth_user and we missed
IS_NOTEMPTY validation for the password field.
The issue was resolved

On Wed, Jan 11, 2012 at 8:07 PM, Anthony  wrote:

> Are you using a custom auth_user table? With the default table, the
> password field has a CRYPT validator with the minimum password length set
> to auth.settings.password_min_length, which defaults to 4.
>
> Anthony
>
>
> On Wednesday, January 11, 2012 4:19:40 AM UTC-5, Viren Patel wrote:
>
>> Even i tried with version 1.99.3 still it registers successfully and also
>> able to login with that user with blank password
>>
>> On Wed, Jan 11, 2012 at 2:38 PM, Albert Abril wrote:
>>
>>> I tryed in Version 1.99.3 and it's working ok. When I put a blank
>>> password there's a "Too short" message.
>>>
>>>
>>> 2012/1/11 VIREN PATEL 
>>>
>>> Hi,


 In register screen if i do not provide password and verify-password
 still the user does gets registered.

 also able to login with that user. any solution to avoid the acceptance
 of blank password


 Thanks,
 Viren

>>>
>>>
>>


Re: [web2py] Register User issue -- Blank password

2012-01-13 Thread Anthony

>
> Thanks for the help.
> i recognized that we had our own customised auth_user and we missed 
> IS_NOTEMPTY validation for the password field.
> The issue was resolved
>

Note, if you're using the CRYPT() validator (you should be hashing the 
password somehow), it takes a min_length argument, so no need to use 
IS_NOT_EMPTY in addition.

Anthony 


Re: [web2py] Re: New Site for web2py poweredby

2012-01-13 Thread Andrew Evans
ty everyone! Annet I did the changes you suggested but will have to work on
the forum styling later today. Great ideas though *cheers




On Fri, Jan 13, 2012 at 5:04 AM, Cliff  wrote:

> Very nice.
>
> A agree with Annet about the forum styling, though.
>
> On Jan 13, 3:16 am, Rahul  wrote:
> > Looks nice and professional :) nice work
> >
> > Rahul D
> >
> > On Jan 13, 12:29 pm, Annet  wrote:
> >
> >
> >
> >
> >
> >
> >
> > > Hi Andrew,
> >
> > > Nice site. Just three questions, why did you swap photo gallery and
> > > login/join in the menu at the bottom? why not center the copyright
> > > message? isn't it possible to style the forum in the same colors as
> > > the rest of the site?
> >
> > > Regards,
> >
> > > Annet
>


[web2py] PyCharm for web2py development -- interest in a third-party plugin?

2012-01-13 Thread monotasker
I had an email exchange over the last couple of days with a developer at 
Jetbrains who works on PyCharm. The bad news is they've chosen not to work 
on web2py integration any time soon. The even worse news (from my 
perspective) is that they seem to have a very negative impression of the 
web2py community, and this was given as one factor in the decision not to 
make web2py a priority. Now, I think the last thing we need is a flame war 
against PyCharm. It sounds like they've had some legitimately bad 
interactions with a few of the people wanting web2py support (I have no 
idea who). So I think this is a moment to be on our best behaviour.

The good news, though, is that the developer encouraged the development of 
a third-party plugin for web2py support. This isn't something I can take on 
alone right now, but is there any interest from others in forming a team to 
work on one?


Re: [web2py] PyCharm for web2py development -- interest in a third-party plugin?

2012-01-13 Thread Angelo Compagnucci
There is really such an intrest?

I'm using eclipse+pydev everyday and overcomed the trickery to get code
completion working, it's really good ide. I think there is major need to
provide support for pydev than a closed source ide.

They are a company that sells a software, and if they don't want our money,
I think it's their problem. I'm really disappointed that a few users don't
get their wishes fullfilled, but it's a closed source software, and in a
closed source world you can contribute only to a certain degree.

Angelo

2012/1/13 monotasker 

> I had an email exchange over the last couple of days with a developer at
> Jetbrains who works on PyCharm. The bad news is they've chosen not to work
> on web2py integration any time soon. The even worse news (from my
> perspective) is that they seem to have a very negative impression of the
> web2py community, and this was given as one factor in the decision not to
> make web2py a priority. Now, I think the last thing we need is a flame war
> against PyCharm. It sounds like they've had some legitimately bad
> interactions with a few of the people wanting web2py support (I have no
> idea who). So I think this is a moment to be on our best behaviour.
>
> The good news, though, is that the developer encouraged the development of
> a third-party plugin for web2py support. This isn't something I can take on
> alone right now, but is there any interest from others in forming a team to
> work on one?
>



-- 
Profile: http://it.linkedin.com/in/compagnucciangelo


Re: [web2py] PyCharm for web2py development -- interest in a third-party plugin?

2012-01-13 Thread Bruno Rocha
I can help with the plugin, but where is the docs about plugin creation?

http://zerp.ly/rochacbruno
Em 13/01/2012 14:45, "monotasker"  escreveu:

> I had an email exchange over the last couple of days with a developer at
> Jetbrains who works on PyCharm. The bad news is they've chosen not to work
> on web2py integration any time soon. The even worse news (from my
> perspective) is that they seem to have a very negative impression of the
> web2py community, and this was given as one factor in the decision not to
> make web2py a priority. Now, I think the last thing we need is a flame war
> against PyCharm. It sounds like they've had some legitimately bad
> interactions with a few of the people wanting web2py support (I have no
> idea who). So I think this is a moment to be on our best behaviour.
>
> The good news, though, is that the developer encouraged the development of
> a third-party plugin for web2py support. This isn't something I can take on
> alone right now, but is there any interest from others in forming a team to
> work on one?
>


[web2py] T and internationalization

2012-01-13 Thread Niphlod
Hi,
   I'm currently researching the possibility to add some translations
using the T helper in a different way then usual.

Let's say that I wrote all the strings to be translated in english,
and use T for the italian translation.

Until here, no problem found

Then, I tried to use a string, like "DEFAULT_CURRENCY", that has to be
translated BOTH in english and italian, using the T helper.

I have two languages files, en.py and it.py, in en.py there is the
translation "DEFAULT_CURRENCY" --> "USD", in it.py the one
"DEFAULT_CURRENCY" --> "EUR".

Now, let's enter the shell..

>>> print T("DEFAULT_CURRENCY")
DEFAULT_CURRENCY
>>> print T("DEFAULT_CURRENCY", language='it')
EUR
>>> T.current_languages
['en']
>>> #hey, any language in current_languages don't use T, as said into the docs
>>> #let's force this list with arabic (alphabetical order merit, don't blame 
>>> me :D)
>>> T.set_current_languages('ar')
>>> T.current_languages
('ar',)
>>> print T("DEFAULT_CURRENCY", language='it')
EUR
>>> print T("DEFAULT_CURRENCY", language='en')
DEFAULT_CURRENCY
>>> #umpf
>>> T.force('en')
>>> print T("DEFAULT_CURRENCY", language='en')
DEFAULT_CURRENCY
>>> #multi-umpf!
>>> print T("DEFAULT_CURRENCY")
USD
>>> #finally ...

am I the only one seeing something going wrong behaviour? Why do I
have to force translation to english if T.current_languages don't
include "en" to get the translation in english ?
Is this the wanted behaviour ?




[web2py] Re: Links to referencing records - 'str' object has no attribute 'ignore_common_filters'

2012-01-13 Thread isi_jca
Thanks for your answers. I made a correction, but the error persist. I
was reading about this error in
https://groups.google.com/group/web2py/browse_thread/thread/11835a3c9c1aeda3/68c0c35d7fe29b54?hl=es&lnk=gst&q=Links+to+referencing+records#68c0c35d7fe29b54.


On 13 ene, 11:10, Anthony  wrote:
> Looks like somewhere you have a query 'dog.owner=5'. Instead, that should
> be:
>
> dog.owner == 5
>
> Note, no surrounding quotes, and use of == (to test equality) instead of =
> (used for assignment).
>
> Anthony
>
>
>
>
>
>
>
> On Friday, January 13, 2012 6:20:58 AM UTC-5, isi_jca wrote:
>
> > Hello!!!
>
> > I am a beginner and get the next ticket. Anybody Can I Help me?. Thanks in
> > advance.
>
> > Ticket ID
>
> > 127.0.0.1.2012-01-12.14-09-56.3407b807-6bc6-4428-a7f2-0173a5473524
> >  'str' object has no attribute
> > 'ignore_common_filters' Version  web2py™ (1, 99, 4,
> > datetime.datetime(2011, 12, 14, 14, 46, 14), 'stable')  Python Python
> > 2.7.2+: /usr/bin/python  Traceback
>
> > 1.
> > 2.
> > 3.
> > 4.
> > 5.
> > 6.
> > 7.
> > 8.
> > 9.
> > 10.
> > 11.
> > 12.
> > 13.
> > 14.
> > 15.
> > 16.
>
> > Traceback (most recent call last):
> >   File "/home/jalbornoz/web2py/gluon/restricted.py", line 204, in restricted
> >     exec ccode in environment
> >   File 
> > "/home/jalbornoz/web2py/applications/ExpedienteX/controllers/default.py" 
> > , 
> > line 135, in 
> >   File "/home/jalbornoz/web2py/gluon/globals.py", line 172, in 
> >     self._caller = lambda f: f()
> >   File 
> > "/home/jalbornoz/web2py/applications/ExpedienteX/controllers/default.py" 
> > , 
> > line 80, in list_records
> >     records = db(query).select(db[table].ALL)
> >   File "/home/jalbornoz/web2py/gluon/dal.py", line 6333, in select
> >     return self.db._adapter.select(self.query,fields,attributes)
> >   File "/home/jalbornoz/web2py/gluon/dal.py", line 1274, in select
> >     sql = self._select(query, fields, attributes)
> >   File "/home/jalbornoz/web2py/gluon/dal.py", line 1155, in _select
> >     if query and not query.ignore_common_filters:
> > AttributeError: 'str' object has no attribute 'ignore_common_filters'
>
> >  Error snapshot [image: help]
>
> > ('str' object has no attribute
> > 'ignore_common_filters')
>
> > inspect attributes
> >  Frames
>
> >    -
>
> >    *File /home/jalbornoz/web2py/gluon/restricted.py in restricted at line
> >    204* code arguments variables
> >     -
>
> >    *File
> >    /home/jalbornoz/web2py/applications/ExpedienteX/controllers/default.py in
> >     at line 135* code arguments variables
> >     -
>
> >    *File /home/jalbornoz/web2py/gluon/globals.py in  at line 172*
> >    code arguments variables
> >     -
>
> >    *File
> >    /home/jalbornoz/web2py/applications/ExpedienteX/controllers/default.py in
> >    list_records at line 80* code arguments variables
> >     -
>
> >    *File /home/jalbornoz/web2py/gluon/dal.py in select at line 6333* code
> >    arguments variables
> >     -
>
> >    *File /home/jalbornoz/web2py/gluon/dal.py in select at line 1274* code
> >    arguments variables
> >     -
>
> >    *File /home/jalbornoz/web2py/gluon/dal.py in _select at line 1155* code
> >    arguments variables
> >     Function argument list
>
> >    (self=, query='dog.owner=5',
> >    fields=[, ,
> >    ], attributes={})
> >     Code listing
>
> >    1150.
> >    1151.
> >    1152.
> >    1153.
> >    1154.
> >    1155.
>
> >    1156.
> >    1157.
> >    1158.
> >    1159.
>
> >                else:
> >                    new_fields.append(item)
> >            fields = new_fields
> >            tablenames = self.tables(query)
>
> >            if query and not query.ignore_common_filters:
>
> >                query = self.common_filter(query,tablenames)
>
> >            if not fields:
> >                for table in tablenames:
>
> >     Variables  query 'dog.owner=5'  query.ignore_common_filters undefined
>
> >  Context
>
> > locals request session response
> >  In file:
> > /home/jalbornoz/web2py/applications/ExpedienteX/controllers/default.py
>
> > 1.
> > 2.
> > 3.
> > 4.
> > 5.
> > 6.
> > 7.
> > 8.
> > 9.
> > 10.
> > 11.
> > 12.
> > 13.
> > 14.
> > 15.
> > 16.
> > 17.
> > 18.
> > 19.
> > 20.
> > 21.
> > 22.
> > 23.
> > 24.
> > 25.
> > 26.
> > 27.
> > 28.
> > 29.
> > 30.
> > 31.
> > 32.
> > 33.
> > 34.
> > 35.
> > 36.
> > 37.
> > 38.
> > 39.
> > 40.
> > 41.
> > 42.
> > 43.
> > 44.
> > 45.
> > 46.
> > 47.
> > 48.
> > 49.
> > 50.
> > 51.
> > 52.
> > 53.
> > 54.
> > 55.
> > 56.
> > 57.
> > 58.
> > 59.
> > 60.
> > 61.
> > 62.
> > 63.
> > 64.
> > 65.
> > 66.
> > 67.
> > 68.
> > 69.
> > 70.
> > 71.
> > 72.
> > 73.
> > 74.
> > 75.
> > 76.
> > 77.
> > 78.
> > 79.
> > 80.
> > 81.
> > 82.
> > 83.
> > 84.
> > 85.
> > 86.
> > 87.
> > 88.
> > 89.
> > 90.
> > 91.
> > 92.
> > 93.
> > 94.
> > 95.
> > 96.
> > 97.
> > 98.
> > 99.
> > 100.
> > 101.
> > 102.
> > 103.
>

Re: [web2py] Re: Get the URL

2012-01-13 Thread pbreit
You can always pull up /appadmin/state which shows all of the env, request, 
session variables available.

[web2py] Re: List of fields to select()

2012-01-13 Thread Vikas Singhal
Thanks Anthony, that worked!

On Jan 13, 6:58 pm, Anthony  wrote:
> On Friday, January 13, 2012 8:50:30 AM UTC-5, Vikas Singhal wrote:
>
> > Hi,
>
> > How can I pass a list of fields to db(query).select() functions. For
> > e.g cols = { field1, field2, field3 }
>
> {} makes a dict, not a list -- you want:
>
> cols = [field1, field2, field3]
>
> In that case:
>
> db(query).select(*cols)
>
> Note, that is standard Python syntax (*args expands a list into a set of
> positional arguments).
>
> Anthony


[web2py] Re: Need a instruction for Rating Plugin

2012-01-13 Thread Omi Chiba
It easy to use and works great !!

Here's my blog post
http://ochiba77.blogspot.com/2012/01/web2py-plugin-rating-widget.html


On Jan 12, 7:08 pm, kenji4569  wrote:
> I made a similar plugin before, and now uploaded it to my plugin site:
>
> http://dev.s-cubism.com/plugin_rating_widget
>
> The plugin provide a form widget to generate the rating chooser.
>
> Just give it a try.
>
> (Note that the plugin has some boilerplate codes for dealing with ajax
> form and for customizing css and js files.)
>
> Kenji
>
> On 1月13日, 午前4:56, Chris Hawkes  wrote:
>
>
>
>
>
>
>
> > I did take a look at that myself.   I find it much harder to figure out how 
> > to apply a plugin to my design then to just do it all over myself specific 
> > to my design.  If you are beginner it will be a nightmare.  You should 
> > prabably make your own with simple form variables using jquery and CSS to 
> > create roll over effects
>
> > Sent from my Samsung smartphone on AT&T
>
> > Omi Chiba  wrote:
> > >I'm trying to use the plugin but it doesn't provide me much
> > >information.
> > >http://www.web2py.com/plugins/default/rating
>
> > >Is there anyone who use it and who can provide me a little bit more
> > >details ?


[web2py] Is this possible?

2012-01-13 Thread Bruce Wade
db.define_table('user_account',

)
db.define_table('distributors',
Field('account_id', db.user_account),
Field('uadpoints_balance_available', 'integer', default=0),
)
db.define_table('ads',
Field('member_id', db.user_account),
Field('points', 'integer', default=0),
)
db.ads.points.requires = IS_INT_IN_RANGE(0,
db(db.distributors.account_id==db.ads.member_id).select()[0].uadpoints_balance_available)

Basically I want to limit the value of points assigned to an ad to the
maximum uadpoints_balance_available for a member. The reason I am trying
this crazy requires is I would like to use the SQLFORM.grid. If this (or
something similar) is not possible I will have to roll my own.

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


Re: [web2py] Re: Get the URL

2012-01-13 Thread Anthony
You can also put {{=response.toolbar()}} in a view, or even just 
{{=BEAUTIFY(request)}}.

Anthony

On Friday, January 13, 2012 1:11:10 PM UTC-5, pbreit wrote:
>
> You can always pull up /appadmin/state which shows all of the env, 
> request, session variables available.



[web2py] Re: Links to referencing records - 'str' object has no attribute 'ignore_common_filters'

2012-01-13 Thread Anthony
On Friday, January 13, 2012 12:52:26 PM UTC-5, isi_jca wrote:
>
> Thanks for your answers. I made a correction, but the error persist. I 
> was reading about this error in 
>
> https://groups.google.com/group/web2py/browse_thread/thread/11835a3c9c1aeda3/68c0c35d7fe29b54?hl=es&lnk=gst&q=Links+to+referencing+records#68c0c35d7fe29b54.
>  
>
>

What is the relevance of that issue? Where do you set that query?



[web2py] latest web2py trunk: AttributeError: 'module' object has no attribute 'ftruncate'

2012-01-13 Thread Carlos
Hi,

I'm using latest web2py trunk (on win7, with postgresql, up to changeset # 
c8f2c00a32fb), and I just started getting the following traceback once in a 
while:

File ...
return str(T(v))
File "C:\web2py\gluon\languages.py", line 139, in __str__
return self.T.translate(self.m, self.s)
File "C:\web2py\gluon\languages.py", line 305, in translate
write_dict(self.language_file, self.t)
File "C:\web2py\gluon\languages.py", line 107, in write_dict
os.ftruncate(fd, 0)
AttributeError: 'module' object has no attribute 'ftruncate'

The error goes away as soon as I reload.

This never happened in the previous web2py trunk version (from some days 
ago).

Thanks,

   Carlos



[web2py] Re: Custom Operator

2012-01-13 Thread howesc
take a look at dal.py for the postgresql adaptor.  see how it defines the 
other operators.  hopefully that will give you some clues as to how you 
would extend the DAL to have your operator.

i haven't done it myself, but it's just software so i'm sure there is a 
solution. :)

cfh


[web2py] Re: controller question

2012-01-13 Thread howesc
yeah, i don't have any controllers that are 7mb

if that 7mb happens to be some static data that you are loading into memory 
you might consider loading the data into a blobstore, and having a method 
that reads it in and stores it in memcache for use by your application.

just a thought.

cfh


Re: [web2py] Is this possible?

2012-01-13 Thread Khalil KHAMLICHI
Why enforce it at database level when you can do the same thing easily at
form level?


[web2py] Re: Is it me or what?

2012-01-13 Thread Likit
Nice.

Randomly noticed that the all bands/against me link is brokent...


On Jan 12, 11:48 pm, Annet  wrote:
> Hi,
>
> > Thanks for pointing that out, this is probably a stupid question, but
> > where do I change the metadata author?
>
> In previous versions of web2py this was the way to set meta data:
>
> In menu.py or in a controller:
>
> ## read more athttp://dev.w3.org/html5/markup/meta.name.html
> response.meta.author = 'Your Name '
> response.meta.description = 'a cool new app'
> response.meta.keywords = 'web2py, python, framework'
> response.meta.generator = 'Web2py Web Framework'
> response.meta.copyright = 'Copyright 2011'
>
> and then in the  section of a layout something like:
>
> 
> 
> 
> 
>
> ... I am not sure it still is ...
>
> Regards,
>
> Annet


Re: [web2py] Is this possible?

2012-01-13 Thread Anthony
On Friday, January 13, 2012 5:04:31 PM UTC-5, Khalil KHAMLICHI wrote:
>
> Why enforce it at database level when you can do the same thing easily at 
> form level?
>
Validators are in fact enforced at the form level, even though they are 
typically specified with the db field definition (this is useful in case 
the same table/fields are used in multiple forms -- e.g., Auth register and 
profile forms).

Anthony 


[web2py] Re: Is this possible?

2012-01-13 Thread Anthony

>
> db.define_table('user_account',
> 
> )
> db.define_table('distributors',
> Field('account_id', db.user_account),
> Field('uadpoints_balance_available', 'integer', default=0),
> )
> db.define_table('ads',
> Field('member_id', db.user_account),
> Field('points', 'integer', default=0),
> )
> db.ads.points.requires = IS_INT_IN_RANGE(0, 
> db(db.distributors.account_id==db.ads.member_id).select()[0].uadpoints_balance_available)
>

If 'ads' records will be added via form submission, then you might try:

db.ads.points.requires = IS_INT_IN_RANGE(0,
db(db.distributors.account_id==request.vars.member_id
).select().first().uadpoints_balance_available)

You might want to set this in the form controller only when request.vars is 
not empty to avoid unnecessary db hits.

Anthony



[web2py] OFFTOPIC - http://www.pythonchallenge.com/

2012-01-13 Thread António Ramos
good critics. I 'm stuck in level 1 . Shame
http://www.pythonchallenge.com/


Re: [web2py] OFFTOPIC - http://www.pythonchallenge.com/

2012-01-13 Thread Javier Quarite
2012/1/13 António Ramos 

> good critics. I 'm stuck in level 1 . Shame
> http://www.pythonchallenge.com/
>

Can I help ? :D or you just wanted to share the page?

Javier


Re: [web2py] OFFTOPIC - http://www.pythonchallenge.com/

2012-01-13 Thread António Ramos
2^38?


2012/1/13 Javier Quarite 

>
>
> 2012/1/13 António Ramos 
>
>> good critics. I 'm stuck in level 1 . Shame
>> http://www.pythonchallenge.com/
>>
>
> Can I help ? :D or you just wanted to share the page?
>
> Javier
>


Re: [web2py] OFFTOPIC - http://www.pythonchallenge.com/

2012-01-13 Thread Javier Quarite
2012/1/13 António Ramos 

> 2^38?
>
>
>
Yes :D  ( only the numbers) , I got stuck on the third level a month ago :(

Javier


Re: [web2py] OFFTOPIC - http://www.pythonchallenge.com/

2012-01-13 Thread António Ramos
2^38? what does it have to do with python?

ughhh

2012/1/13 Javier Quarite 

>
>
> 2012/1/13 António Ramos 
>
>> good critics. I 'm stuck in level 1 . Shame
>> http://www.pythonchallenge.com/
>>
>
> Can I help ? :D or you just wanted to share the page?
>
> Javier
>


[web2py] Documentation of web2py

2012-01-13 Thread davidjensen
I would like to help with the documentation of web2py. Is there a way
to do that, perhaps collaboratively?


Re: [web2py] OFFTOPIC - http://www.pythonchallenge.com/

2012-01-13 Thread Javier Quarite
2012/1/13 António Ramos 

> 2^38? what does it have to do with python?
>
> ughhh
>
>
Just write that on python console :/  2**38 and change the 0 on the URL
with the result


Re: [web2py] OFFTOPIC - http://www.pythonchallenge.com/

2012-01-13 Thread Jonathan Lundell
On Jan 13, 2012, at 3:34 PM, António Ramos wrote:

> 2^38? what does it have to do with python?
> 

It's easy to calculate. 

Re: [web2py] OFFTOPIC - http://www.pythonchallenge.com/

2012-01-13 Thread Jonathan Lundell
On Jan 13, 2012, at 3:34 PM, Javier Quarite wrote:

> Yes :D  ( only the numbers) , I got stuck on the third level a month ago :( 

The one with the candles?

Re: [web2py] Re: Is it me or what?

2012-01-13 Thread Chris Hawkes
Thanks for all the comments and suggestions.  There will be a major content fix 
over the weekend.   I will fix many dead links and I am adding an additional 
200 bands or so.  I am also adding more dynamic content over the next couple of 
weeks.


Sent from my Samsung smartphone on AT&T

Likit  wrote:

>Nice.
>
>Randomly noticed that the all bands/against me link is brokent...
>
>
>On Jan 12, 11:48 pm, Annet  wrote:
>> Hi,
>>
>> > Thanks for pointing that out, this is probably a stupid question, but
>> > where do I change the metadata author?
>>
>> In previous versions of web2py this was the way to set meta data:
>>
>> In menu.py or in a controller:
>>
>> ## read more athttp://dev.w3.org/html5/markup/meta.name.html
>> response.meta.author = 'Your Name '
>> response.meta.description = 'a cool new app'
>> response.meta.keywords = 'web2py, python, framework'
>> response.meta.generator = 'Web2py Web Framework'
>> response.meta.copyright = 'Copyright 2011'
>>
>> and then in the  section of a layout something like:
>>
>> 
>> 
>> 
>> 
>>
>> ... I am not sure it still is ...
>>
>> Regards,
>>
>> Annet


Re: [web2py] OFFTOPIC - http://www.pythonchallenge.com/

2012-01-13 Thread Anthony
On Friday, January 13, 2012 6:34:20 PM UTC-5, Ramos wrote:
>
> 2^38? what does it have to do with python?
>

The site says all but two of the levels can be completed with any language, 
not just Python.


[web2py] Re: Is it me or what?

2012-01-13 Thread chawk
BTW, Joseph thank you for the advice of updating my meta author, and
Annet you were right, it is in the model/menu.py file.  I could not
figure out why those meta tags were showing up like that.  The fix
will be updated tonight.


[web2py] Application-wide exception handler?

2012-01-13 Thread spiffytech
My web2py application is littered with calls to a library that loves
throwing exceptions when the website it connects to isn't available.
I'd like my web2py app to catch the exceptions thrown by the library
and redirect the user to a friendly error page. However, there are too
many library calls to load up the app with try/except statements all
over the place.

Is there something I can put in my models file that will catch all
exceptions of a certain type and handle them?


Re: [web2py] Re: Is this possible?

2012-01-13 Thread Bruce Wade
Thank you Anthony,

That works exactly how I was want. I didn't even think to use request.vars.
Just trying to see how many different ways this is going to save my team
development time.

We are moving youadworld.com from pyramid to web2py here is the start so
far if you are interested in watching the progress: http://176.34.12.39/

NOTE: There will be LOTS of changes and the database will be deleted and
rebuilt often over the next few months. youadworld.com however is live and
free to register to see what the current functionality is, and will be in
the new version with web2py.

On Fri, Jan 13, 2012 at 2:47 PM, Anthony  wrote:

> db.define_table('user_account'**,
>> 
>> )
>> db.define_table('distributors'**,
>> Field('account_id', db.user_account),
>> Field('uadpoints_balance_**available', 'integer', default=0),
>> )
>> db.define_table('ads',
>> Field('member_id', db.user_account),
>> Field('points', 'integer', default=0),
>> )
>> db.ads.points.requires = IS_INT_IN_RANGE(0, db(db.distributors.account_id=
>> **=db.ads.member_id).select()[0]**.uadpoints_balance_available)
>>
>
> If 'ads' records will be added via form submission, then you might try:
>
> db.ads.points.requires = IS_INT_IN_RANGE(0,
> db(db.distributors.account_id=**=request.vars.member_id
> ).select().first()**.uadpoints_balance_available)
>
> You might want to set this in the form controller only when request.vars
> is not empty to avoid unnecessary db hits.
>
> Anthony
>
>


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


Re: [web2py] Re: Is this possible?

2012-01-13 Thread Anthony
Glad it worked. Out of curiosity, what prompted you to move from Pyramid to 
web2py for this app?

On Friday, January 13, 2012 10:59:43 PM UTC-5, Detectedstealth wrote:
>
> Thank you Anthony,
>
> That works exactly how I was want. I didn't even think to use 
> request.vars. Just trying to see how many different ways this is going to 
> save my team development time.
>
> We are moving youadworld.com from pyramid to web2py here is the start so 
> far if you are interested in watching the progress: http://176.34.12.39/
>
> NOTE: There will be LOTS of changes and the database will be deleted and 
> rebuilt often over the next few months. youadworld.com however is live 
> and free to register to see what the current functionality is, and will be 
> in the new version with web2py.
>
> On Fri, Jan 13, 2012 at 2:47 PM, Anthony  wrote:
>
>> db.define_table('user_account'**,
>>> 
>>> )
>>> db.define_table('distributors'**,
>>> Field('account_id', db.user_account),
>>> Field('uadpoints_balance_**available', 'integer', default=0),
>>> )
>>> db.define_table('ads',
>>> Field('member_id', db.user_account),
>>> Field('points', 'integer', default=0),
>>> )
>>> db.ads.points.requires = IS_INT_IN_RANGE(0, 
>>> db(db.distributors.account_id=**=db.ads.member_id).select()[0]**
>>> .uadpoints_balance_available)
>>>
>>
>> If 'ads' records will be added via form submission, then you might try:
>>
>> db.ads.points.requires = IS_INT_IN_RANGE(0,
>> db(db.distributors.account_id=**=request.vars.member_id
>> ).select().first()**.uadpoints_balance_available)
>>
>> You might want to set this in the form controller only when request.vars 
>> is not empty to avoid unnecessary db hits.
>>
>> Anthony
>>
>>
>
>
> -- 
> -- 
> Regards,
> Bruce Wade
> http://ca.linkedin.com/in/brucelwade
> http://www.wadecybertech.com
> http://www.warplydesigned.com
> http://www.fitnessfriendsfinder.com
>  


Re: [web2py] Re: Is this possible?

2012-01-13 Thread Bruce Wade
Well as a test I got my new designer to try using web2py without any help
from me, he was successful so that was one bonus point.

Second if you were to look at the code base from 4 developers which 2 had
python background, one PHP, and the other Java, you can imagine how bad the
code is running the site.

So the primary reason is pyramid gives you to much freedom, and forces you
to do way to much manual work yourself. The freedom is good when everyone
on the team is VERY strong with python, however it causes more problems
when trying to teach someone and launch a product at the same time. Oh and
I forgot my main pet pev with pyramid is it has way to many dependences on
3rd party packages, making it very hard to track down bugs.

Finally, since the company launched it is been brining in a lot of money
and has to many feature requests to continue reinventing the wheel with
pyramid (IE: spending to much time developing things web2py already has) We
needed more security, a faster development cycle, easier
internationalization support, and tools that allow designers to work faster.

Don't get my wrong I have projects I have developed running on pyramid
(invoicing system), and django (dating site, personal journalling app where
daily journal entries are encrypted)  that are clean and easy to work
with etc... However, my projects are getting bigger and more demanding, so
far I am liking web2py more then django and pyramid.

I am also developing a fitness application using web2py I will post a link
once we get the new brochure up and running.

On Fri, Jan 13, 2012 at 8:14 PM, Anthony  wrote:

> Glad it worked. Out of curiosity, what prompted you to move from Pyramid
> to web2py for this app?
>
>
> On Friday, January 13, 2012 10:59:43 PM UTC-5, Detectedstealth wrote:
>
>> Thank you Anthony,
>>
>> That works exactly how I was want. I didn't even think to use
>> request.vars. Just trying to see how many different ways this is going to
>> save my team development time.
>>
>> We are moving youadworld.com from pyramid to web2py here is the start so
>> far if you are interested in watching the progress: http://176.34.12.39/
>>
>> NOTE: There will be LOTS of changes and the database will be deleted and
>> rebuilt often over the next few months. youadworld.com however is live
>> and free to register to see what the current functionality is, and will be
>> in the new version with web2py.
>>
>> On Fri, Jan 13, 2012 at 2:47 PM, Anthony  wrote:
>>
>>> db.define_table('user_account',
 
 )
 db.define_table('distributors',
 Field('account_id', db.user_account),
 Field('uadpoints_balance_**avail**able', 'integer', default=0),
 )
 db.define_table('ads',
 Field('member_id', db.user_account),
 Field('points', 'integer', default=0),
 )
 db.ads.points.requires = IS_INT_IN_RANGE(0,
 db(db.distributors.account_id==db.ads.member_id).select()[0]
 .uadpoints_balance_available)

>>>
>>> If 'ads' records will be added via form submission, then you might try:
>>>
>>> db.ads.points.requires = IS_INT_IN_RANGE(0,
>>> db(db.distributors.account_id==request.vars.member_id).**
>>> select().first()**.uadpoints_**balance_available)
>>>
>>> You might want to set this in the form controller only when request.vars
>>> is not empty to avoid unnecessary db hits.
>>>
>>> Anthony
>>>
>>>
>>
>>
>> --
>> --
>> 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] Re: Is this possible?

2012-01-13 Thread Anthony
Thanks for sharing. That's good to know.

On Friday, January 13, 2012 11:32:55 PM UTC-5, Detectedstealth wrote:
>
> Well as a test I got my new designer to try using web2py without any help 
> from me, he was successful so that was one bonus point.
>
> Second if you were to look at the code base from 4 developers which 2 had 
> python background, one PHP, and the other Java, you can imagine how bad the 
> code is running the site.
>
> So the primary reason is pyramid gives you to much freedom, and forces you 
> to do way to much manual work yourself. The freedom is good when everyone 
> on the team is VERY strong with python, however it causes more problems 
> when trying to teach someone and launch a product at the same time. Oh and 
> I forgot my main pet pev with pyramid is it has way to many dependences on 
> 3rd party packages, making it very hard to track down bugs.
>
> Finally, since the company launched it is been brining in a lot of money 
> and has to many feature requests to continue reinventing the wheel with 
> pyramid (IE: spending to much time developing things web2py already has) We 
> needed more security, a faster development cycle, easier 
> internationalization support, and tools that allow designers to work faster.
>
> Don't get my wrong I have projects I have developed running on pyramid 
> (invoicing system), and django (dating site, personal journalling app where 
> daily journal entries are encrypted)  that are clean and easy to work 
> with etc... However, my projects are getting bigger and more demanding, so 
> far I am liking web2py more then django and pyramid.
>
> I am also developing a fitness application using web2py I will post a link 
> once we get the new brochure up and running.
>
> On Fri, Jan 13, 2012 at 8:14 PM, Anthony  wrote:
>
>> Glad it worked. Out of curiosity, what prompted you to move from Pyramid 
>> to web2py for this app?
>>
>>
>> On Friday, January 13, 2012 10:59:43 PM UTC-5, Detectedstealth wrote:
>>
>>> Thank you Anthony,
>>>
>>> That works exactly how I was want. I didn't even think to use 
>>> request.vars. Just trying to see how many different ways this is going to 
>>> save my team development time.
>>>
>>> We are moving youadworld.com from pyramid to web2py here is the start 
>>> so far if you are interested in watching the progress: 
>>> http://176.34.12.39/
>>>
>>> NOTE: There will be LOTS of changes and the database will be deleted and 
>>> rebuilt often over the next few months. youadworld.com however is live 
>>> and free to register to see what the current functionality is, and will be 
>>> in the new version with web2py.
>>>
>>> On Fri, Jan 13, 2012 at 2:47 PM, Anthony  wrote:
>>>
 db.define_table('user_account',
> 
> )
> db.define_table('distributors',
> Field('account_id', db.user_account),
> Field('uadpoints_balance_**avail**able', 'integer', default=0),
> )
> db.define_table('ads',
> Field('member_id', db.user_account),
> Field('points', 'integer', default=0),
> )
> db.ads.points.requires = IS_INT_IN_RANGE(0, 
> db(db.distributors.account_id==db.ads.member_id).select()[0]
> .uadpoints_balance_available)
>

 If 'ads' records will be added via form submission, then you might try:

 db.ads.points.requires = IS_INT_IN_RANGE(0,
 db(db.distributors.account_id==request.vars.member_id).**
 select().first()**.uadpoints_**balance_available)

 You might want to set this in the form controller only when 
 request.vars is not empty to avoid unnecessary db hits.

 Anthony


>>>
>>>
>>> -- 
>>> -- 
>>> 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] Re: Routes error

2012-01-13 Thread Alexandre Andrade
You should rename it to routes.py, not router.py




2012/1/13 Web2Py Freak 

> Dear all ,
>
> am still trying and its not working  , am just trying to change the
> default app , i renamed the router.example.py to router.py and changed
> the the welcome app and added another one  , and then i entered the
> admin and clicked reload routes ,and then i restarted the sever , but
> nothing happend !!
>
> what to do ?
>



-- 
Atenciosamente


Alexandre Andrade
Hipercenter.com Classificados Gratuitos


[web2py] Re: latest web2py trunk: AttributeError: 'module' object has no attribute 'ftruncate'

2012-01-13 Thread Massimo Di Pierro
I have removed that patch. There is still a possible problem with
locking of language files. Let's keep testing...

On Jan 13, 3:28 pm, Carlos  wrote:
> Hi,
>
> I'm using latest web2py trunk (on win7, with postgresql, up to changeset #
> c8f2c00a32fb), and I just started getting the following traceback once in a
> while:
>
> File ...
>     return str(T(v))
> File "C:\web2py\gluon\languages.py", line 139, in __str__
>     return self.T.translate(self.m, self.s)
> File "C:\web2py\gluon\languages.py", line 305, in translate
>     write_dict(self.language_file, self.t)
> File "C:\web2py\gluon\languages.py", line 107, in write_dict
>     os.ftruncate(fd, 0)
> AttributeError: 'module' object has no attribute 'ftruncate'
>
> The error goes away as soon as I reload.
>
> This never happened in the previous web2py trunk version (from some days
> ago).
>
> Thanks,
>
>    Carlos


Re: [web2py] T and internationalization

2012-01-13 Thread Alexandre Andrade
I think u can create a file en_US or en_GB manually


Alexandre Andrade

2012/1/13 Niphlod 

> Hi,
>   I'm currently researching the possibility to add some translations
> using the T helper in a different way then usual.
>
> Let's say that I wrote all the strings to be translated in english,
> and use T for the italian translation.
>
> Until here, no problem found
>
> Then, I tried to use a string, like "DEFAULT_CURRENCY", that has to be
> translated BOTH in english and italian, using the T helper.
>
> I have two languages files, en.py and it.py, in en.py there is the
> translation "DEFAULT_CURRENCY" --> "USD", in it.py the one
> "DEFAULT_CURRENCY" --> "EUR".
>
> Now, let's enter the shell..
>
> >>> print T("DEFAULT_CURRENCY")
> DEFAULT_CURRENCY
> >>> print T("DEFAULT_CURRENCY", language='it')
> EUR
> >>> T.current_languages
> ['en']
> >>> #hey, any language in current_languages don't use T, as said into the
> docs
> >>> #let's force this list with arabic (alphabetical order merit, don't
> blame me :D)
> >>> T.set_current_languages('ar')
> >>> T.current_languages
> ('ar',)
> >>> print T("DEFAULT_CURRENCY", language='it')
> EUR
> >>> print T("DEFAULT_CURRENCY", language='en')
> DEFAULT_CURRENCY
> >>> #umpf
> >>> T.force('en')
> >>> print T("DEFAULT_CURRENCY", language='en')
> DEFAULT_CURRENCY
> >>> #multi-umpf!
> >>> print T("DEFAULT_CURRENCY")
> USD
> >>> #finally ...
>
> am I the only one seeing something going wrong behaviour? Why do I
> have to force translation to english if T.current_languages don't
> include "en" to get the translation in english ?
> Is this the wanted behaviour ?
>
>
>


-- 
Atenciosamente


Alexandre Andrade
Hipercenter.com Classificados Gratuitos


[web2py] Re: Need a instruction for Rating Plugin

2012-01-13 Thread kenji4569
Thanks for your blog post!

On 1月14日, 午前3:55, Omi Chiba  wrote:
> It easy to use and works great !!
>
> Here's my blog 
> posthttp://ochiba77.blogspot.com/2012/01/web2py-plugin-rating-widget.html
>
> On Jan 12, 7:08 pm, kenji4569  wrote:
>
>
>
>
>
>
>
> > I made a similar plugin before, and now uploaded it to my plugin site:
>
> >http://dev.s-cubism.com/plugin_rating_widget
>
> > The plugin provide a form widget to generate the rating chooser.
>
> > Just give it a try.
>
> > (Note that the plugin has some boilerplate codes for dealing with ajax
> > form and for customizing css and js files.)
>
> > Kenji
>
> > On 1月13日, 午前4:56, Chris Hawkes  wrote:
>
> > > I did take a look at that myself.   I find it much harder to figure out 
> > > how to apply a plugin to my design then to just do it all over myself 
> > > specific to my design.  If you are beginner it will be a nightmare.  You 
> > > should prabably make your own with simple form variables using jquery and 
> > > CSS to create roll over effects
>
> > > Sent from my Samsung smartphone on AT&T
>
> > > Omi Chiba  wrote:
> > > >I'm trying to use the plugin but it doesn't provide me much
> > > >information.
> > > >http://www.web2py.com/plugins/default/rating
>
> > > >Is there anyone who use it and who can provide me a little bit more
> > > >details ?


[web2py] SQLFORM.grid and custom display values from fields not displayed in the table.

2012-01-13 Thread Robert Clark
Can I first say that SQLFORM.grid is great and a massive productivity
gain, thanks Massimo & the rest of the web2py team.

My question is around formatting a column when the display value
depends on other non-visible columns (or other related tables).  We're
using the "links" parameter and a lambda function to generate the
label.  The clunky part is that the row function needs to go back to
the database each time as not all the fields required to generate that
display value are available in the "row" value passed to the lambda
function.  It seems like it would be cleaner if we didn't have to
unnecessarily revisit the database each time.

Here's a cut-back model & controller to illustrate.

db.define_table('fileimportgroup',
Field('status', 'string'), # "not_started", "success",
"processing", "cancelled", "errors"
Field('type', 'string'),
Field('start', 'datetime'),
Field('end', 'datetime'))

db.define_table('fileimportitem',
Field('fileimportgroup_id', db.fileimportgroup),
Field('status', 'string'), # "not_started", "unsupported_format",
"duplicate", "removed_prior_to_import", "failed", "imported"
Field('processed', 'datetime'))

# Controller function
def importgroups():
def _processing_status_label(fig):
# This raises a KeyError unless db.fileimportgroup.status is
added in fields
# status = fig.status

# Have to select the status instead
status =
db(db.fileimportgroup.id==fig['id']).select(db.fileimportgroup.status).first()
['status']

fig_id = fig['id']
if status == 'processing':
total =
db(db.fileimportitem.fileimportgroup_id==fig_id).count()
processed =
db((db.fileimportitem.fileimportgroup_id==fig_id)&
(db.fileimportitem.status!='not_started')).count()
return '%d/%d files processed' % (processed, total)
if status == 'success':
return 'Successful'
# ... etc.
return 'Unknown'

links = [dict(header='Status', body=lambda row:
_processing_status_label(row))]
grid=SQLFORM.grid((db.fileimportgroup.id>0), paginate=15,
links=links, orderby=~db.fileimportgroup.start,
fields=[db.fileimportgroup.start, db.fileimportgroup.end])

return dict(importgroups=grid)


(I realise we could change the model and increment a processed count
on fileimportgroup, but I'm hoping for a recommended fix to the
general problem)

Can I suggest adding a new SQLFORM.grid parameter like
"fields_nonvisible" which would select these fields back from the
database but not add columns for them.  That would do the trick, does
that sound reasonable?

Or is there another way to achieve what we're doing without having to
select non "fields" values one at a time?  Thanks.



[web2py] Re: New Site for web2py poweredby

2012-01-13 Thread Annet
Hi Andrew,

> Annet I did the changes you suggested but will have to work on
> the forum styling later today. Great ideas though *cheers

You're welcome, let us know when you're done with the styling ...


Kind regards,

Annet