[web2py:28077] Re: SQL and name of SUM field in a groupby

2009-08-06 Thread Fran



On Aug 6, 6:54 am, Dutch opera  wrote:
> db().select(db.test.date,db.
> test.url,db.test.hits.sum(), db.test.rev.sum(), groupby=
> db.test.datel)
> What is the name of the hits field?  In SQL I would do sum(hits) as
> sum_hits and sum(rev) as sum_rev

rows = db().select(db.test.date,db.test.url,db.test.hits.sum(),
db.test.rev.sum(), groupby=db.test.datel)
for row in rows:
hits_sum = row._extra[db.test.hits.sum()]

F
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28078] Re: Fwd: My thoughts on web2py

2009-08-06 Thread Fran

On Aug 6, 6:05 am, mdipierro  wrote:
> The issue with now vs utfnow, althought I dismissed because it would
> break backward compatibility, I should have been more extensive. The
> OS timestamps files using the local time, not utc time. The average
> developer prefers using localtime vs utc time. If you store things in
> database and you have multiple servers over multiple timezones than
> you want to use timestamp records using utc time instead of local
> time. Except in this last case localtime is to be preferred and that
> is why we store in a variable. If you need utf time that is also
> available via the datetime module.

Would you be up for adding an accessible request.utcnow?
I definitely want this & it seems like a standard thing for the
'enterprise'.
A recipe example would be an OK alternative...a quick play didn't
reveal to me how to convert default=request.now into a utcnow
equivalent...

F
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28079] Re: feature request: auth email to approver

2009-08-06 Thread Alex Fanjul

Ok, thats the way I did it...

El 06/08/2009 7:06, mdipierro escribió:
> remove the registration_key using appadmin or write your own
> interface.
>
> On Aug 5, 9:18 pm, Alejandro Fanjul  wrote:
>
>> What is the best (smart) way to approve pending users?
>> thanks
>>
>> On 27 jul, 17:25, Hans  wrote:
>>
>>  
>>> Grazie Massimo!
>>>
>>  
>>> The following works well for my need:
>>>
>>  
>>> auth.settings.registration_requires_verification = True
>>> auth.settings.registration_requires_approval = True
>>> auth.messages.verify_email = \
>>>   'Click on the linkhttps://mydomain/fips/default/user/verify_email/%(key)s
>>> to verify your FIPS registration'
>>> auth.settings.verify_email_onaccept = lambda form:\
>>>  auth.settings.mailer.send(to='adminwithapprovalpo...@admindomain',
>>> \
>>>subject='FIPS Approval Pending',\
>>>message='Your action is required. 
>>> Pleaseapproveuser %s asap.' % form.email)
>>>
>>  
>>> So the from me requested feature is there already and working well ;-)
>>>
>>  
>>> Hans
>>> On Jul 27, 2:25 am, mdipierro  wrote:
>>>
>>  
 Yes but you can do already
  
>>  
 auth.settings.registration_requires_approval = False
 auth.settings.register_onaccept = lambda form:
 auth.settings.mailer.send()
  
>>  
 why a notification email should be more important (i.e. built-in) vs
 any other action that may be required on login?
  
>>  
 Massimo
  
>>  
 On Jul 26, 12:05 pm, Hans
 wrote:
  
>>  
> For me it would be great if the approver gets a notification email as
> soon as his action is required. The idea is something like below
>
>>  
> auth.settings.registration_approver='youremailaddr...@yourdomain'
> auth.messages.approver_email = \
>   'A pending registration from %(email)s on application %
> (response.title)s requires your approval'
>
>>  
> Does that make sense?
>
>>  
> Thanks,
> Hans
>
> >
>
>

-- 
Alejandro Fanjul Fdez.
alex.fan...@gmail.com
www.mhproject.org

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28080] Re: Fwd: My thoughts on web2py

2009-08-06 Thread Alex Fanjul

Yea Massimo, thats the point, I don't know if there are really big 
issues and it seems actually there aren't. It's almost a mind question 
to you and big developers, is there any big issue to consider non 
backward? It seems is not by your comments, :-D

El 06/08/2009 7:05, mdipierro escribió:
> To my knowledge there is no issue cannot be solved in a backward
> compatible way.
>
> Most of the issues that Armin raised about web2py have to do with its
> internal design decisions. These are not bugs to be fixed. These are
> distinctive features of web2py that were thought through before being
> developed and I see no reason to change. Every design decision has
> pros and cons.
>
> Some of the issues like the "open file issue" do not constitute a bug
> (we have no knowledge of any problem with it) nevertheless this has
> been addressed in trunk already.
>
> The issues with "request.now" is non-existent. request.now is just a
> variable that contains the localtime when a request arrives. It is a
> variable that you can use in your programs. It is true that by the
> time a request arrives until a request a request ends time passes by,
> by there is no race condition. We simply provide a variable to the
> users to know for sure when the request arrived, the current time is
> in datetime.now().
>
> The issue with now vs utfnow, althought I dismissed because it would
> break backward compatibility, I should have been more extensive. The
> OS timestamps files using the local time, not utc time. The average
> developer prefers using localtime vs utc time. If you store things in
> database and you have multiple servers over multiple timezones than
> you want to use timestamp records using utc time instead of local
> time. Except in this last case localtime is to be preferred and that
> is why we store in a variable. If you need utf time that is also
> available via the datetime module.
>
> I am not sure there is any open issue here. Which issue in your
> opinion would need a backward incompatible change? Not that this is
> going to happen.
>
> Massimo
>
> On Aug 5, 8:38 pm, Alex Fanjul  wrote:
>
>> Some thoughts and commentaries about major version:
>>
>>-My question came after thinking in Armin thread
>>-Most of people seems to be convinced that there is no real reason
>> (big issue) that couldn't be "avoidable enough" to need to realase a non
>> backward compatible major version (so I figure out we have a strong
>> framework in front)
>>-Only real experience people (not like me) know if there are real
>> motives to consider a non backward compatible major version
>>-Many people say that web2py is so young to think in "big changes in
>> code", but In case it would be real motives to do a "non backward
>> compatible major version", and due to the youthfulness of the framework,
>> wouldn't be better to do it as soon as possible and not after some years
>> with many more users and applications online?
>>-In case it would be real motives to do a "non backward compatible
>> major version", wouldn't you prefer to adapt your application in return
>> to have a better framework (maybe more secure, flexible, better writed, etc)
>>
>> These are only (and probably wrong) open thoughts and conjetures, so
>> don't waste time in reply me...
>> Alex F
>>
>> El 04/08/2009 23:08, waTR escribió:
>>
>>
>>
>>  
>>> I don't feel it is necessary to re-write anything yet. There is a lot
>>> of good in it as it is. Don't just give up on it when you run into a
>>> few difficulties. We are not talking about anything that won't be
>>> addressed either. It is more of an issue of how it is addressed, and
>>> for all the "weaknesses" in this framework, there are a hell of a lot
>>> more strengths.
>>>
>>  
>>> Have patience, and don't forget this is a VERY young project. Also,
>>> you may not agree with all the decisions all the time, but then no one
>>> will in any framework. You can't please all the people all the time.
>>> The key is to remember what brought you to this framework, and if that
>>> still stands. All software has weaknesses, the question is whether it
>>> is being dealt with or monitored. If it is, then one day in the near
>>> future it will be addressed, but don't confuse speed of resolving all
>>> problems brought up with quality solutions. Often the best solution
>>> will require a lot of dialogue and a lot of analysis before
>>> implementing.
>>>
>>  
>>> Also, not breaking backwards compatibility is a great rule to prevent
>>> software from moving too fast. If the software breaks backwards
>>> compatibility with every minor release, no one will use it because it
>>> is not serious. If it breaks with every major release, no serious
>>> project will use it because it would be too expensive to maintain.
>>> Therefore, if all I have to do is use some added code in order to
>>> solve the problem but preserve backward compatibility, then I am all
>>> for it. If you have a small 

[web2py:28081] Shell...print dates from query

2009-08-06 Thread Dutch opera

Hi,

my  query seens to work.  In the shell...I run the query and I print
the results


2009-07-27,0,0,0
2009-07-28,0,0,0
2009-07-29,0,0,0

if I loop though each of the fields they work...expect the date
field.  My mysql its stored as a datetime.

in the shell

for r in records:
   print r.date

I get this error...

Traceback (most recent call last):
  File "", line 2, in 
  File "/home/dutch/workspace/test/gluon/sql.py", line 526, in
__getattr__
return dict.__getitem__(self,key)
KeyError: 'date'

Why do I this this error?

The same process works for the other columns names albeit they are not
date fields...




--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28082] Re: Upgrade web2py with one click

2009-08-06 Thread Alex Fanjul

Wow, thats would be AWESOME...!!! And a good point in web2py marketing 
(yea, its not exactly marketing, but say visibility, presence... :-D)

I was thinking that it would be imposible using cherrypy, because how do 
yo stop and restart de server if its using to upgrading at the same time?
how do you stop all proceses but keeps one to restart them again?

would be easier with apache, isnt it? as apache is running as "external 
server" and you only have to sustitute the framework code...

well, again open thoughts and conjetures...
alex f

P.S: the most incredible thing is that you say that the only issue is tu 
setup a server hahhaah

El 06/08/2009 7:12, mdipierro escribió:
> Yes, I have thought about this.
>
> The only issue is that I must setup a server to do it.
>
> In one of the next few versions.
>
> Massimo
>
>
>
> On Aug 5, 10:20 pm, Alex Fanjul  wrote:
>
>> Massimo, one of the best features with backward compatiblity is the
>> ability to upgrade web2py framework easily, have you thought in
>> implement a "one click upgrade" feature? Like wordpress upgrade...It
>> would be posible in any way? It would be a very cool feature to
>> differentiate from other frameworks (as somebody requested)
>>
>> Something like this:
>> step 1:http://irekia.com/screenshots/2009-08-06_051020.jpg
>> step 2:http://irekia.com/screenshots/2009-08-06_051842.jpg
>>
>> regards,
>> alex f
>> --
>> Alejandro Fanjul Fdez.
>> alex.fan...@gmail.comwww.mhproject.org
>>  
> >
>
>

-- 
Alejandro Fanjul Fdez.
alex.fan...@gmail.com
www.mhproject.org

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28083] utf- 8 chinese characters

2009-08-06 Thread max

I am inserting parsed text from a utf-8 xml file into a mysql
database.
there is a little problem, where i have to clarify.

In my xml file i have entries like this.
高中语文教学目标与检测(下编)<中学语文

when i parse the data only the second entry is correctly inserted.

I use the myDatabase.executesql() command.
insert into refs_test(title,abbrev_series_title) values ("8bed
\u6587,Zxyw", "\xe4\xb8\xad\xe5\xad\xa6\xe8\xaf\xad\xe6\)

i tried to encode all the strings using encode.(utf-8)   then every
entry was in  (\xe4\xb8\xad\x)
but in the database i see the same.

if i print the sql command in the console i have the correct string
and it works when i copy and paste it.

can somebody give me a tipp?

thanks!



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28084] get the row id from form

2009-08-06 Thread max

i am inserting Form values  into a postgres database.
For on-the fly parsing of other data, i need the  entry id of the
database, which was inserted by my form.
I am getting this values by calculating field values and it is so
ugly.
Is there any web2py way of just getting the entry id of the currently
added form entry?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28085] Re: get the row id from form

2009-08-06 Thread Mladen Milankovic

Hi.

The id of inserted records will be in form.vars.id, assuming you call the 
form, form.
Like:

if form.accepts(request.vars, session):
id = form.vars.id 

regards
mmlado

On Thursday 06 August 2009 10:43:26 max wrote:
> i am inserting Form values  into a postgres database.
> For on-the fly parsing of other data, i need the  entry id of the
> database, which was inserted by my form.
> I am getting this values by calculating field values and it is so
> ugly.
> Is there any web2py way of just getting the entry id of the currently
> added form entry?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28086] Re: Shell...print dates from query

2009-08-06 Thread Dutch opera

H..I figured it but it was not clearI get a group by clause
and the date was a group was nested in the results




On Aug 5, 10:12 pm, Dutch opera  wrote:
> Hi,
>
> my  query seens to work.  In the shell...I run the query and I print
> the results
>
> 2009-07-27,0,0,0
> 2009-07-28,0,0,0
> 2009-07-29,0,0,0
>
> if I loop though each of the fields they work...expect the date
> field.  My mysql its stored as a datetime.
>
> in the shell
>
> for r in records:
>    print r.date
>
> I get this error...
>
> Traceback (most recent call last):
>   File "", line 2, in 
>   File "/home/dutch/workspace/test/gluon/sql.py", line 526, in
> __getattr__
>     return dict.__getitem__(self,key)
> KeyError: 'date'
>
> Why do I this this error?
>
> The same process works for the other columns names albeit they are not
> date fields...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28087] Re: Google App Engine and get_by_key_name

2009-08-06 Thread Jim

Sure.   Full details are on 
http://code.google.com/appengine/docs/python/datastore/modelclass.html

hit on /confirm/account/(?P.*)$

key_name = 'account:' + account
acc = Account.get_by_key_name(key_name)
if not acc:
template_values = {'account' : account}
template_file = os.path.join(os.path.dirname(__file__),
'templates', 'NoAccount.html')
body = template.render(template_file, template_values)
self.response.out.write(body)
logging.warning( account + " not found" )
return False

This is trivial and user confirmations (and all the stuff that comes
with having good passwords, forgetting passwords, changing emails,
etc.) is probably best done with other tools.

Where it starts to matter a lot on GAE is where it's something like an
URL or email or phone number or part number.   These are (or can be)
things that have one entry or no entry.   For something like Reddish,
it might be Url.get_by_key_name('url:http://www.web2py.com/article')
to see if the article can be entered.

Url.get_or_insert('url:http://www.web2py.com/article') means "get this
key_name if it exists, otherwise create it"   If you have a clear
naming scheme, it makes it easy to use an item that might not have
existed until just now.   Example might be tracking Twitter
usernames.   We don't know if we saw /jdeibele or /web2py  before but
now he's referencing /web2py so we'd get_or_insert('user:web2py') and
add a ReferenceProperty to get_or_insert('user:jdeibele')



On Aug 5, 1:53 pm, mdipierro  wrote:
> I am not sure what it does. Can you give us an example?
>
> Massimo
>
> On Aug 5, 12:44 pm, Jim  wrote:
>
> > I was (and am) very interested in web2py but I want to use GAE for
> > hosting.   One of the things that web2py didn't have was support for
> > model.get_by_key_name
>
> > Where it's possible to have a defined key_name - say an email address
> > or a domain - it requires significantly less quota to get than to
> > query.   As in 10-20%.
>
> > I try to follow the web2py messages but haven't seen anything on this
> > lately.  I know a couple of people were modifying web2py for their own
> > use to get the benefits of this.
>
> > Is this something that web2py will support in the future?
>
> > Thanks!
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28088] Re: Fwd: My thoughts on web2py

2009-08-06 Thread Timbo

It's been a while since I've been around but this seems to be an
important discussion that I'd like to weigh in on.

Massimo is right.  Most of Armin's critiques are thought-out design
decisions.  The perceived problems from just looking at the code don't
play out in reality due to being either a non-issue handled by some
other mechanism.

The issue of open file-handles is partly an issue and partly Armin
showing his ignorance of WSGI.  Any iterator passed back to a WSGI
server will be "closed" if it has a close methods and will be
appropriately deleted.  For all the other instances, yes, we should
close them.

I'm not going to weigh in on the ORM since I currently do not use it
(however, this might change with the new ORM coming out).

Fact is, I've used web2py for production purposes for more than a year
now and the only issues I've had with my setup were either my own code
or issues with python's broken socket library (which the included
wsgiserver uses).

As for the future of Python...I see cPython becoming what the vanilla
Linux kernel is today.  That is to say, it's sort of the base-line,
but no distribution uses just the vanilla kernel, but they all add
their own patches and customizations.  Pypy will likely bypass both
cPython and Jython in performance and flexibility within the next 2
years and popularity in the following 5.  Python developers will refer
to cPython more than end-users will actually use it.  Google will keep
using it since they're investing in Unladen-Swallow, but independent
projects will gear more towards Pypy compatibility due to it's
platform flexibility, speed and scalability.

That being said, Python 3.x will not be adopted as quickly as some
would hope.  Py3 support is barely on the radar for Pypy and Jython.
Frankly, even at Python3.1 it's still horribly broken for web-
development.  The Cherrypy and Werkzeug devs are building their own
versions of the cgi library.

Eventually, web2py will need to have some implementation on Python3,
but I don't see that as needed for at least 2 more years.  Python2 is
still going very strong.  It will be more than 2 years before Google
migrates.  They will likely be the driving force behind moving beyond
Py2.

Just my 2c

-tim
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28089] How to a static file as logo

2009-08-06 Thread Johann Spies

I am trying my first web2py page and I am wasting hours even after
watching several tutorial video's, reading the manual and the latest
version of cookbook2.pdf.

After createing a new application, I want to to customize the menu and
put an image where the menu.py specifies:


response.title = request.application
response.subtitle = T('customize me!')

I want to replace the "request.application" part with a logo which I
put amongst the static files.

I have tried to modify layout.html as follows, but it ignores what I
am trying to do:


  

  

{{title=response.title or 'response.title'}}

{{IMG(_src=URL(r=request, c='static', f='Tux.jpg'))}}


Please help me to waste less time.

Regards
Johann

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28090] Re: How to a static file as logo

2009-08-06 Thread Mladen Milankovic

Hi.

Try:

{{=IMG(_src=URL(r=request, c='static', f='Tux.jpg'))}}

Everything you want to write out in the view, from python code needs =
like: {{=variable}}

regards
mmlado

On Thursday 06 August 2009 16:36:11 Johann Spies wrote:
> I am trying my first web2py page and I am wasting hours even after
> watching several tutorial video's, reading the manual and the latest
> version of cookbook2.pdf.
>
> After createing a new application, I want to to customize the menu and
> put an image where the menu.py specifies:
>
>
> response.title = request.application
> response.subtitle = T('customize me!')
>
> I want to replace the "request.application" part with a logo which I
> put amongst the static files.
>
> I have tried to modify layout.html as follows, but it ignores what I
> am trying to do:
>
> 
>   
> 
>   
> 
> {{title=response.title or 'response.title'}}
>
> {{IMG(_src=URL(r=request, c='static', f='Tux.jpg'))}}
> 
>
> Please help me to waste less time.
>
> Regards
> Johann
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28091] LDAP Authentication notes

2009-08-06 Thread Ahmed Soliman
Hello everybody,

I'm starting to dig more into web2py and I started playing with LDAP
authentication which lacks documentation on the website, I managed to get it
working but I have to following notes:

   1. Change password still checks the password against the database, it
   should check binding to the LDAP instead.
   2. We should add method to hook on change profile and change password to
   update the LDAP as well.

What do you think?

Ahmed Soliman
Software Engineer
B-Virtual Team.

Thebe Technology. Egypt - Belgium
16 Nehro St. Heliopolis. Cairo
Egypt.

http://www.b-virtual.org
http://www.thebetechnology.com

GPG ID: 0xAEEE5042

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28092] Re: Fwd: My thoughts on web2py

2009-08-06 Thread waTR

Re-writing a framework after 2-3 years is suicide. First, and
foremost, we do not have enough developers to take-on such a huge
task. Even if we did, it is still too early because they are not
organized for such a task (look at Perl 6...and how long it is taking
them to release a new version).

Backwards compatibility is EXTREMELY important for a framework to be
taken seriously. If you are looking at this issue from your bedroom
and thinking I want a really fun hot-rod framework to play with, thats
fine. However, for a business, you are looking for something that is:
1. Going to still be around in 5 years
2. Going to still be stable & Secure in 5 years
3. Going to still be compatible in 5 years.

Don't forget that some companies are still using code written back in
the 1970s (think COBOL). While I agree that it would be FUN to play
with the latest web-framework features, I am sure you are free to fork
this project and take it in an experimental direction. However, try
not to push such a promising potential "enterprise" framework in that
direction.

As Massimo says, there are no bugs here, rather design decisions. If
you disagree with a design decision, fork and re-design. If you can
live with it, provide some work-around plug-ins to do it the way you
feel it should be done.

Speaking of which... is there a plug-in function in web2py yet???  It
would be great for web2py to allow people to plug-in these crazy
features so people can choose to try every idea talked about by simply
downloading the plug-in. Then, if it is popular enough, it can be
added to the list of plug-ins that will be included in the main
release once the framework moves to Python 3.



On Aug 6, 7:29 am, Timbo  wrote:
> It's been a while since I've been around but this seems to be an
> important discussion that I'd like to weigh in on.
>
> Massimo is right.  Most of Armin's critiques are thought-out design
> decisions.  The perceived problems from just looking at the code don't
> play out in reality due to being either a non-issue handled by some
> other mechanism.
>
> The issue of open file-handles is partly an issue and partly Armin
> showing his ignorance of WSGI.  Any iterator passed back to a WSGI
> server will be "closed" if it has a close methods and will be
> appropriately deleted.  For all the other instances, yes, we should
> close them.
>
> I'm not going to weigh in on the ORM since I currently do not use it
> (however, this might change with the new ORM coming out).
>
> Fact is, I've used web2py for production purposes for more than a year
> now and the only issues I've had with my setup were either my own code
> or issues with python's broken socket library (which the included
> wsgiserver uses).
>
> As for the future of Python...I see cPython becoming what the vanilla
> Linux kernel is today.  That is to say, it's sort of the base-line,
> but no distribution uses just the vanilla kernel, but they all add
> their own patches and customizations.  Pypy will likely bypass both
> cPython and Jython in performance and flexibility within the next 2
> years and popularity in the following 5.  Python developers will refer
> to cPython more than end-users will actually use it.  Google will keep
> using it since they're investing in Unladen-Swallow, but independent
> projects will gear more towards Pypy compatibility due to it's
> platform flexibility, speed and scalability.
>
> That being said, Python 3.x will not be adopted as quickly as some
> would hope.  Py3 support is barely on the radar for Pypy and Jython.
> Frankly, even at Python3.1 it's still horribly broken for web-
> development.  The Cherrypy and Werkzeug devs are building their own
> versions of the cgi library.
>
> Eventually, web2py will need to have some implementation on Python3,
> but I don't see that as needed for at least 2 more years.  Python2 is
> still going very strong.  It will be more than 2 years before Google
> migrates.  They will likely be the driving force behind moving beyond
> Py2.
>
> Just my 2c
>
> -tim
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28093] Re: connection to the database from remote client command line

2009-08-06 Thread Yarko Tymciurak
it sounds as if setting up a webservice on your server might be a more
appropriate approach for what you want.

See, for example,
http://www.web2py.com/examples/default/examples#xmlrpc_examples
http://www.web2py.com/examples/default/tools#services

on the slides at http://www.web2py.com,
making controllers services:  slide 54-55 (see also 50-53);

authentication for services:  slide 134;


On Thu, Aug 6, 2009 at 1:57 AM, Fran  wrote:

>
> On Aug 6, 7:52 am, gabriel  wrote:
> > This action will then require to have the web2py.py installed on the
> > remote client, do I guess well ?
> > How to specify than the shell for execution is the one of the server,
> > where the application is installed ?
> > Can I add arguments on "yourscript.py" like : -R "yourscript.py -o
> > option1 -x option2" ?
>
> Can you do this via an SSH tunnel?
>
> F
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28094] Re: How to a static file as logo

2009-08-06 Thread Yarko Tymciurak
On Thu, Aug 6, 2009 at 9:49 AM, Mladen Milankovic  wrote:

>
> Hi.
>
> Try:
>
> {{=IMG(_src=URL(r=request, c='static', f='Tux.jpg'))}}
>
> Everything you want to write out in the view, from python code needs =
> like: {{=variable}}


Yes ... this will make more sense for example if you want to do more
processing before outputting something, e.g.:

 {{mylogo=IMG(_src=URL(r=request, c='static', f='Tux.jpg'))}}
 {{ # more processing perhaps with mylogo...}}
 {{ =mylogo  =title }}

Think of the empty left-side of the assignment as a "here" assignment (e.g.,
output)


>
> regards
> mmlado
>
> On Thursday 06 August 2009 16:36:11 Johann Spies wrote:
> > I am trying my first web2py page and I am wasting hours even after
> > watching several tutorial video's, reading the manual and the latest
> > version of cookbook2.pdf.
> >
> > After createing a new application, I want to to customize the menu and
> > put an image where the menu.py specifies:
> >
> >
> > response.title = request.application
> > response.subtitle = T('customize me!')
> >
> > I want to replace the "request.application" part with a logo which I
> > put amongst the static files.
> >
> > I have tried to modify layout.html as follows, but it ignores what I
> > am trying to do:
> >
> > 
> >   
> > 
> >   
> > 
> > {{title=response.title or 'response.title'}}
> >
> > {{IMG(_src=URL(r=request, c='static', f='Tux.jpg'))}}
> > 
> >
> > Please help me to waste less time.
> >
> > Regards
> > Johann
> >
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28095] Re: Fwd: My thoughts on web2py

2009-08-06 Thread Yarko Tymciurak
I think Massimo has already spoken to all these concerns / issues;

Closing files explicitly is stylistic - saying what you mean (and not
counting on side-effects of the system); it makes for more readable code in
general (although some will complain about an extra line of typing, it is
explicit to say "I'm done with this handle now!).   Among other things, not
depending on side effects of a particular system means your code is more
portable to other systems/languages (you may want to move processing from
javascript to a controller or vice-versa; you can think of other situations
where language choice of a part is beyond your choice).

Massimo has chosen to do this already.

As for rewrite for Python 3 at some point in the future (as Massimo alluded
to being a possible fork from backward compatibility) that will be an
opportunity to look at the application writer's idioms, and if something can
be changed to more naturally express the work-flow of expressing business
logic, this will be an opportunity to explore that.

In the meantime, no worries - openness to feedback is a good thing.


On Thu, Aug 6, 2009 at 12:06 PM, waTR  wrote:

>
> Re-writing a framework after 2-3 years is suicide. First, and
> foremost, we do not have enough developers to take-on such a huge
> task. Even if we did, it is still too early because they are not
> organized for such a task (look at Perl 6...and how long it is taking
> them to release a new version).
>
> Backwards compatibility is EXTREMELY important for a framework to be
> taken seriously. If you are looking at this issue from your bedroom
> and thinking I want a really fun hot-rod framework to play with, thats
> fine. However, for a business, you are looking for something that is:
> 1. Going to still be around in 5 years
> 2. Going to still be stable & Secure in 5 years
> 3. Going to still be compatible in 5 years.
>
> Don't forget that some companies are still using code written back in
> the 1970s (think COBOL). While I agree that it would be FUN to play
> with the latest web-framework features, I am sure you are free to fork
> this project and take it in an experimental direction. However, try
> not to push such a promising potential "enterprise" framework in that
> direction.
>
> As Massimo says, there are no bugs here, rather design decisions. If
> you disagree with a design decision, fork and re-design. If you can
> live with it, provide some work-around plug-ins to do it the way you
> feel it should be done.
>
> Speaking of which... is there a plug-in function in web2py yet???  It
> would be great for web2py to allow people to plug-in these crazy
> features so people can choose to try every idea talked about by simply
> downloading the plug-in. Then, if it is popular enough, it can be
> added to the list of plug-ins that will be included in the main
> release once the framework moves to Python 3.
>
>
>
> On Aug 6, 7:29 am, Timbo  wrote:
> > It's been a while since I've been around but this seems to be an
> > important discussion that I'd like to weigh in on.
> >
> > Massimo is right.  Most of Armin's critiques are thought-out design
> > decisions.  The perceived problems from just looking at the code don't
> > play out in reality due to being either a non-issue handled by some
> > other mechanism.
> >
> > The issue of open file-handles is partly an issue and partly Armin
> > showing his ignorance of WSGI.  Any iterator passed back to a WSGI
> > server will be "closed" if it has a close methods and will be
> > appropriately deleted.  For all the other instances, yes, we should
> > close them.
> >
> > I'm not going to weigh in on the ORM since I currently do not use it
> > (however, this might change with the new ORM coming out).
> >
> > Fact is, I've used web2py for production purposes for more than a year
> > now and the only issues I've had with my setup were either my own code
> > or issues with python's broken socket library (which the included
> > wsgiserver uses).
> >
> > As for the future of Python...I see cPython becoming what the vanilla
> > Linux kernel is today.  That is to say, it's sort of the base-line,
> > but no distribution uses just the vanilla kernel, but they all add
> > their own patches and customizations.  Pypy will likely bypass both
> > cPython and Jython in performance and flexibility within the next 2
> > years and popularity in the following 5.  Python developers will refer
> > to cPython more than end-users will actually use it.  Google will keep
> > using it since they're investing in Unladen-Swallow, but independent
> > projects will gear more towards Pypy compatibility due to it's
> > platform flexibility, speed and scalability.
> >
> > That being said, Python 3.x will not be adopted as quickly as some
> > would hope.  Py3 support is barely on the radar for Pypy and Jython.
> > Frankly, even at Python3.1 it's still horribly broken for web-
> > development.  The Cherrypy and Werkzeug devs are building their own
> > versions of the cgi

[web2py:28096] db - stored procedure

2009-08-06 Thread 陶艺夫
Hi,
I'm using PostgreSQL, I need to use stored procedure to calculate on more
than 5 records -- according to every people's birthday, figure out how
much subsidy (s)he will get. Is this a rational idea?
I have done calculating by a controller, but it has taken more than 50
seconds to get the result. Is a stored procedure helpful for this? And how
to do it in DAL?

Thanks.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28097] Re: Auth based on UUID

2009-08-06 Thread Alex Fanjul

Hello Vihang,
I'm very curious  and It would be very interesting to know how to build 
a distributed node app.
Any short tutorial? guidelines?

Thanks,
Alex F

El 04/08/2009 9:30, vihang escribió:
> Hello,
>
> I am currently working on an app which is distributed between
> different nodes. The issue is that when it comes to app related dbs, I
> am managing (somehow) using a seperate UUID column. But the Auth which
> comes with web2py does not. any ideas... I want 'building my own auth'
> as a last resort.
>
> Vihang
> >
>
>

-- 
Alejandro Fanjul Fdez.
alex.fan...@gmail.com
www.mhproject.org

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28098] Re: How to change how IS_IN_DB() is rendered?

2009-08-06 Thread Alastair Medford

So then I would do something like form.accepts(...,
onvalidation=lambda form: myvalidator(form)) ?
I suppose if I use my validator to verify the value is in the other
table, then I wouldn't need to use IS_IN_DB, and could render it
however I want. Thanks, and sorry for the slow response.

On Aug 3, 3:22 am, Fran  wrote:
> On Aug 3, 9:53 am, Fran  wrote:
>
> > This should do what you want:
> > crud.create(db.table, onvalidation=lambda: form: myvalidator(form))
> > onvalidation callback runs before DB I/O
> > (onaccept callback is after DB I/O)
>
> Actually, I see that SQLFORM's accepts() method includes an
> onvalidation callback as well...no need to used crud...
>
> F
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28099] Re: Two tables that link to each other

2009-08-06 Thread JoshuaJ

Thanks for the info, this is exactly what I wanted!

This seems to violate one of the basic principles of python
programming philosophy: "There should be one--and preferably only one--
obvious way to do it."

In fact, this particular example demonstrates precisely why that rule
of thumb is a good one -- here we have two ways to do the same thing,
but one way works in places where the other doesn't, so we really need
to learn *both* ways. (Actually, maybe we only need to learn the more
powerful latter method... but the former method, with weaknesses, is
the one taught first in the web2py slideshow.)

Are there any advantages (other than saving a few characters) to
writing db.other_table instead of "reference other_table"? If not,
maybe it should be deprecated? (Not removed, I know backwards
compatibility is important... but at the very least, relegated to an
appendix in the documentation instead of being the preferred method).

On Jul 21, 11:49 pm, Yarko Tymciurak  wrote:
> There are two formats for declaring a reference:
>
> 
> db.Field('owner', db.other_table)   # this must have other_table already
> defined, or it is a Python error;
> ...
> db.Field('owner', 'reference other_table')  # this is delayed evaluation,
> and what you would use to have two tables cross link each other;
>
>
>
> On Tue, Jul 21, 2009 at 10:27 PM, JoshuaJ  wrote:
>
> > It seems that in web2py, if one table is to have a foreign key to
> > another table, the target table must be defined first in db.py. Does
> > this mean that there is no way to have two tables that link to each
> > other?
>
> > Specifically: I'm writing a basic multi-user address book application.
> > Each user, of course, owns multiple contacts. However, each user
> > selects at most one of their contacts as being their identity, the
> > contact that represents themselves.
>
> > The way I'd do this in a traditional database would be to define a
> > "users" table with fields "username" (a string) and
> > "primary_contact_id" (foreign key into contacts table); and then a
> > "contacts" table with fields "contact_data" (i'm simplifying here) and
> > "owner_id" (pointing back into the users table). However, Web2py
> > doesn't seem to allow this.
>
> > Does anyone have a solution?
>
> > (One workaround would be to add an "is_identity" field to each
> > contact, but this seems like a nasty kludge, firstly because since it
> > will have the value of "no" for the vast majority of contacts, but
> > more importantly because it doesn't guarantee data integrity -- a bug
> > in the code could leave a user with multiple identities, something
> > impossible with the other representation.)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28100] Re: Auth based on UUID

2009-08-06 Thread vihang

Hello Alex,

I am in the stage of 'figuring things out'. Frankly, I am as clueless
as the next person. Just reading up on things and trying to put it
together. But if I get something working, I would definitely put
something up, atleast the good practice. Meanwhile I am struggling
with distributed auth. Too many security implications. If you are
doing something in this line, we could have a chat, maybe through
direct email, as it may not be relevant to this group.

Cheers.
Vihang

On Aug 6, 11:28 pm, Alex Fanjul  wrote:
> Hello Vihang,
> I'm very curious  and It would be very interesting to know how to build
> a distributed node app.
> Any short tutorial? guidelines?
>
>  Thanks,
> Alex F
>
> El 04/08/2009 9:30, vihang escribió:
>
> > Hello,
>
> > I am currently working on an app which is distributed between
> > different nodes. The issue is that when it comes to app related dbs, I
> > am managing (somehow) using a seperate UUID column. But the Auth which
> > comes with web2py does not. any ideas... I want 'building my own auth'
> > as a last resort.
>
> > Vihang
>
> --
> Alejandro Fanjul Fdez.
> alex.fan...@gmail.comwww.mhproject.org
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28101] Re: Upgrade web2py with one click

2009-08-06 Thread mdipierro

After upgrate one may have to restart web2py.

On Aug 6, 3:21 am, Alex Fanjul  wrote:
> Wow, thats would be AWESOME...!!! And a good point in web2py marketing
> (yea, its not exactly marketing, but say visibility, presence... :-D)
>
> I was thinking that it would be imposible using cherrypy, because how do
> yo stop and restart de server if its using to upgrading at the same time?
> how do you stop all proceses but keeps one to restart them again?
>
> would be easier with apache, isnt it? as apache is running as "external
> server" and you only have to sustitute the framework code...
>
> well, again open thoughts and conjetures...
> alex f
>
> P.S: the most incredible thing is that you say that the only issue is tu
> setup a server hahhaah
>
> El 06/08/2009 7:12, mdipierro escribió:
>
>
>
> > Yes, I have thought about this.
>
> > The only issue is that I must setup a server to do it.
>
> > In one of the next few versions.
>
> > Massimo
>
> > On Aug 5, 10:20 pm, Alex Fanjul  wrote:
>
> >> Massimo, one of the best features with backward compatiblity is the
> >> ability to upgrade web2py framework easily, have you thought in
> >> implement a "one click upgrade" feature? Like wordpress upgrade...It
> >> would be posible in any way? It would be a very cool feature to
> >> differentiate from other frameworks (as somebody requested)
>
> >> Something like this:
> >> step 1:http://irekia.com/screenshots/2009-08-06_051020.jpg
> >> step 2:http://irekia.com/screenshots/2009-08-06_051842.jpg
>
> >> regards,
> >> alex f
> >> --
> >> Alejandro Fanjul Fdez.
> >> alex.fan...@gmail.comwww.mhproject.org
>
> --
> Alejandro Fanjul Fdez.
> alex.fan...@gmail.comwww.mhproject.org
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28102] Re: LDAP Authentication notes

2009-08-06 Thread mdipierro

On Aug 6, 5:42 am, Ahmed Soliman  wrote:
> Hello everybody,
>
> I'm starting to dig more into web2py and I started playing with LDAP
> authentication which lacks documentation on the website, I managed to get it
> working but I have to following notes:
>
>    1. Change password still checks the password against the database, it
>    should check binding to the LDAP instead.

This can be disabled. Do

auth.settings.login_methods=[ldap_auth(...)]

instead of

auth.settings.login_methods.append(ldap_auth(...))

>    2. We should add method to hook on change profile and change password to
>    update the LDAP as well.
>
> What do you think?

This is a good idea but needs some design first.

>
> Ahmed Soliman
> Software Engineer
> B-Virtual Team.
>
> Thebe Technology. Egypt - Belgium
> 16 Nehro St. Heliopolis. Cairo
> Egypt.
>
> http://www.b-virtual.orghttp://www.thebetechnology.com
>
> GPG ID: 0xAEEE5042
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28103] Re: Fwd: My thoughts on web2py

2009-08-06 Thread mdipierro

Why should I add when you can do it in your model?

import datetime
request.utcnow=datetime.datetime.utcnow()

Massimo

On Aug 6, 2:26 am, Fran  wrote:
> On Aug 6, 6:05 am, mdipierro  wrote:
>
> > The issue with now vs utfnow, althought I dismissed because it would
> > break backward compatibility, I should have been more extensive. The
> > OS timestamps files using the local time, not utc time. The average
> > developer prefers using localtime vs utc time. If you store things in
> > database and you have multiple servers over multiple timezones than
> > you want to use timestamp records using utc time instead of local
> > time. Except in this last case localtime is to be preferred and that
> > is why we store in a variable. If you need utf time that is also
> > available via the datetime module.
>
> Would you be up for adding an accessible request.utcnow?
> I definitely want this & it seems like a standard thing for the
> 'enterprise'.
> A recipe example would be an OK alternative...a quick play didn't
> reveal to me how to convert default=request.now into a utcnow
> equivalent...
>
> F
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28104] Re: db - stored procedure

2009-08-06 Thread mdipierro

You can do

db.executesql('')

and pass any sql you want. If you show us what you need to do
specifically perhaps we can suggest a better way.

Massimo

On Aug 6, 1:13 pm, 陶艺夫  wrote:
> Hi,
> I'm using PostgreSQL, I need to use stored procedure to calculate on more
> than 5 records -- according to every people's birthday, figure out how
> much subsidy (s)he will get. Is this a rational idea?
> I have done calculating by a controller, but it has taken more than 50
> seconds to get the result. Is a stored procedure helpful for this? And how
> to do it in DAL?
>
> Thanks.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28105] Web2py Plug-in system

2009-08-06 Thread b00m_chef

Is this being worked on? Who is involved? Is there a specification
somewhere?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28106] Left Join Failures

2009-08-06 Thread howesc

Hi all,

I'm writing several queries with multiple tables, and left joins, and
the generated SQL is not working with postgres:

ProgrammingError: invalid reference to FROM-clause entry for table
"concert"
LINE 1: ..., artist LEFT JOIN audiofile ON
audiofile.concert=concert.id...
 ^
HINT:  There is an entry for table "concert", but it cannot be
referenced from this part of the query.

my query is:
query = db((db.concert_purchases.auth_user == auth.user.id) &
   (db.concert.id == db.concert_purchases.concert) &
   (db.concert_purchases.expires > now) &
   (db.artist.id == db.concert.artist) &
   (db.venue.id == db.concert.venue))
rows = query.select(db.concert.name, db.concert.id,
db.concert_purchases.date,
db.artist.name,
db.venue.name,
db.concert.date,
db.audiofile.file,
left=db.audiofile.on(db.audiofile.concert ==
db.concert.id),
orderby=~db.concert_purchases.date)

I have web2py Version 1.63.5 (2009-06-03 23:35:00)

so, is there a way i can write the query to make the left join work,
or should i just do multiple queries?

thanks for the help,

christian

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28107] How to POST information from link?

2009-08-06 Thread Alastair Medford

What I'm trying to do is place information into a nornal  link,
which will be sent along with an onclick ajax call. I know how to do
this when the information is from an  tag just fine. But in
this case I would like the information, like an id, to be contained
somewhere in the  tag itself.

The reasoning behind this is I would like to build a jquery tree, and
when a link inside is clicked, an ajax function is called that then
"knows" which link was clicked and will act accordingly. I've tried
sending the  tag along by adding its id to the arguments of the
ajax call, but its value in request.vars ends up being undefined. I
theoreticaly could have a hidden field with each element containing
the id but this seems messy. Is there a better way?

The reason I'm not just straight out callng controller functions is
this tree will be generated from a user made xml file. It's then used
to find content in another user made file, so it has nothing to with
calling certain functions.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28108] How does db.table.field.represent work in the view?

2009-08-06 Thread __future__

I am sure this is something simple that I am missing here when you do
something like:

#model
db.define_table('event',
Field('description','text'),
Field('creation_date','datetime', default=request.now),
Field('start_date','datetime'),
Field('creator', db.auth_user,default=auth.user.id if
auth.is_logged_in() else 0),
Field('latest','boolean',default=True))

db.event.creator.represent=lambda id: db.auth_user[id].email

#controller
def tonight():

from datetime import datetime, timedelta

now = datetime.now()
start = datetime.min.replace(year=now.year, month=now.month,
day=now.day)
end = (start + timedelta(days=1)) - timedelta.resolution

tonight_query = (db.event.start_date > start) &
(db.event.start_date < end) & (db.event.latest == True)
events = db(tonight_query).select()
return dict(events=events)

#view
{{extend 'layout.html'}}
Events Tonight

{{ for event in events: }}
{{ =event.creator }} : {{ =event.description }}
{{ pass }}


The {{ =event.creator }} is still always an integer rather than using
the representation defined in the model (db.auth_user.email).

If I add {{=BEAUTIFY(response._vars)}} to the view, the table shows
the event.creator field with the correct db.auth_user.email
representation

What am I missing here?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28109] Bizzare Auth Bug. Could Fix But Need Massimo's Ok

2009-08-06 Thread Bottiger

I am trying to incorporate OpenID into Auth.

In my attempt to implement a CAS style plugin into auth, I stumbled
upon a bizzare error.

On line 628 of gluon.tools, there is the following line:

"users = self.db(table_user[username] == keys[username]).select()"

username is defined to be "username" if you have a username and
"email" if you have email specified. However, when I looked at the
auth_user table, there is no "username" column.

The closest thing to a username column is first_name or last_name, but
obviously this isn't the same thing.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28110] Re: db - stored procedure

2009-08-06 Thread 陶艺夫
Thank you for reply.

It's a charity project. The city goverment here decided to help old people
who aged 70 above financially every month. There are aid standards here:
age range : 70-7980-8990-9495-99100+
aid money:  30 80 150  300   500
You know, every month some people's ages will changed to the next age range.
So I need to calculate monthly every person's age to decide how much money
(s)he will get.
The fields of the people table:
name, gender, birth_date, township_id, community_id
When the calculating work is done, I need to generate an Excel file by xlwt,
a town a worksheet, the rows will be grouped by every community.
The aged 70+ people here is 50,000+.
Any solutions more efficient than python's "For Loop" on a huge DAL records
set?

Thanks


2009/8/7 mdipierro 

>
> You can do
>
> db.executesql('')
>
> and pass any sql you want. If you show us what you need to do
> specifically perhaps we can suggest a better way.
>
> Massimo
>
> On Aug 6, 1:13 pm, 陶艺夫  wrote:
> > Hi,
> > I'm using PostgreSQL, I need to use stored procedure to calculate on more
> > than 5 records -- according to every people's birthday, figure out
> how
> > much subsidy (s)he will get. Is this a rational idea?
> > I have done calculating by a controller, but it has taken more than 50
> > seconds to get the result. Is a stored procedure helpful for this? And
> how
> > to do it in DAL?
> >
> > Thanks.
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28111] Re: Bizzare Auth Bug. Could Fix But Need Massimo's Ok

2009-08-06 Thread Yarko Tymciurak
Which version of web2py are you looking at?

First - in the most current version, I think you are talking about line 653,
in
get_or_create_user();

You will note at the beginning of that function:

if 'username' in keys:
username = 'username'
elif 'email' in keys:
username = 'email'
else:
raise SyntaxError, "user must have username or email"

(there are 2 other places with lines like this, and they do similar checks;
so you can define a username in your auth, or by default it uses email).

You might want to get a look at:
http://bazaar.launchpad.net/~mdipierro/web2py/devel/annotate/head%3A/gluon/tools.py

BEWARE:  if you get the latest revision from launchpad, there is a bug in
template.py - which I'm waiting for Massimo to apply the patch for...  You
can remove the ".read()" portion of line 120 yourself in the meantime, that
is in parse_template():

try:
fp = open(t, 'rb').read()
parent = fp.read()
fp.close()

should read:

try:
fp = open(t, 'rb')
parent = fp.read()
fp.close()


- Yarko

On Thu, Aug 6, 2009 at 7:29 PM, Bottiger  wrote:

>
> I am trying to incorporate OpenID into Auth.
>
> In my attempt to implement a CAS style plugin into auth, I stumbled
> upon a bizzare error.
>
> On line 628 of gluon.tools, there is the following line:
>
> "users = self.db(table_user[username] == keys[username]).select()"
>
> username is defined to be "username" if you have a username and
> "email" if you have email specified. However, when I looked at the
> auth_user table, there is no "username" column.
>
> The closest thing to a username column is first_name or last_name, but
> obviously this isn't the same thing.
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28112] Re: db - stored procedure

2009-08-06 Thread Yarko Tymciurak
can you calculate this as you process payment per person?  Or is this
something that is calculated once a month?

The idea is that stored procedures work on the database engine, and can
sometimes be more efficient, but you can do the same as you describe on the
selected data.

I think perhaps a nice way to do this is with a database view, where you
create a stored procedure, and return a non-stored value through the view.

What i mean is the payment would look to web2py "like" a data table column,
but in reality it would be a calculated value by your view, which would use
a stored procedure to return the proper value.

This means you would set migrate to False for your web2py table definition
(you do not want to change the view, once the basic table is setup).

You would create the stored procedure in whatever way is conveneint (most
likely with a management tool for the database);
You would create a VIEW in the database which would return all the fields of
the "native" table, PLUS a field which would be defined as the return of
your stored procedure on the current row-id, and the appropriate age fields.

In web2py you COULD define an administrative function to make the initial
"native" table, and then define a second one, migrate=False, and this payout
field as readonly, and name it for the VIEW you created separately in your
DB.

That should nicely and transparently give you what you want.

Perhaps others will have other ideas.  I have done things like this in the
past, and it can work rather well.

Regards,
- Yarko

2009/8/6 陶艺夫 

> Thank you for reply.
>
> It's a charity project. The city goverment here decided to help old people
> who aged 70 above financially every month. There are aid standards here:
> age range : 70-7980-8990-9495-99100+
> aid money:  30 80 150  300   500
> You know, every month some people's ages will changed to the next age
> range. So I need to calculate monthly every person's age to decide how much
> money (s)he will get.
> The fields of the people table:
> name, gender, birth_date, township_id, community_id
> When the calculating work is done, I need to generate an Excel file by
> xlwt, a town a worksheet, the rows will be grouped by every community.
> The aged 70+ people here is 50,000+.
> Any solutions more efficient than python's "For Loop" on a huge DAL records
> set?
>
> Thanks
>
>
> 2009/8/7 mdipierro 
>
>
>> You can do
>>
>> db.executesql('')
>>
>> and pass any sql you want. If you show us what you need to do
>> specifically perhaps we can suggest a better way.
>>
>> Massimo
>>
>> On Aug 6, 1:13 pm, 陶艺夫  wrote:
>> > Hi,
>> > I'm using PostgreSQL, I need to use stored procedure to calculate on
>> more
>> > than 5 records -- according to every people's birthday, figure out
>> how
>> > much subsidy (s)he will get. Is this a rational idea?
>> > I have done calculating by a controller, but it has taken more than 50
>> > seconds to get the result. Is a stored procedure helpful for this? And
>> how
>> > to do it in DAL?
>> >
>> > Thanks.
>>
>>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28113] Re: Bizzare Auth Bug. Could Fix But Need Massimo's Ok

2009-08-06 Thread Bottiger

I am using the latest version.

I know there is a check, but the check is useless. If you specify a
username in the dictionary that comes with the argument, then it will
automatically assume that your auth_users table has a username column,
which isn't the case.

On Aug 6, 5:58 pm, Yarko Tymciurak  wrote:
> Which version of web2py are you looking at?
>
> First - in the most current version, I think you are talking about line 653,
> in
> get_or_create_user();
>
> You will note at the beginning of that function:
>
>     if 'username' in keys:
>             username = 'username'
>         elif 'email' in keys:
>             username = 'email'
>         else:
>             raise SyntaxError, "user must have username or email"
>
> (there are 2 other places with lines like this, and they do similar checks;
> so you can define a username in your auth, or by default it uses email).
>
> You might want to get a look 
> at:http://bazaar.launchpad.net/~mdipierro/web2py/devel/annotate/head%3A/...
>
> BEWARE:  if you get the latest revision from launchpad, there is a bug in
> template.py - which I'm waiting for Massimo to apply the patch for...  You
> can remove the ".read()" portion of line 120 yourself in the meantime, that
> is in parse_template():
>
>         try:
>             fp = open(t, 'rb').read()
>             parent = fp.read()
>             fp.close()
>
> should read:
>
>         try:
>             fp = open(t, 'rb')
>             parent = fp.read()
>             fp.close()
>
> - Yarko
>
> On Thu, Aug 6, 2009 at 7:29 PM, Bottiger  wrote:
>
> > I am trying to incorporate OpenID into Auth.
>
> > In my attempt to implement a CAS style plugin into auth, I stumbled
> > upon a bizzare error.
>
> > On line 628 of gluon.tools, there is the following line:
>
> > "users = self.db(table_user[username] == keys[username]).select()"
>
> > username is defined to be "username" if you have a username and
> > "email" if you have email specified. However, when I looked at the
> > auth_user table, there is no "username" column.
>
> > The closest thing to a username column is first_name or last_name, but
> > obviously this isn't the same thing.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28114] Where'd table_newfilename go ?

2009-08-06 Thread AchipA

I might have missed a few classes, but where did the newfilename field
go from SQLFORM's accepts/vars and why ? I know I can query it back
from the DB but it's kind of awkward, having it returned by
sqlform.accepts() was far more natural, especially considering
transactions...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28115] Re: Bizzare Auth Bug. Could Fix But Need Massimo's Ok

2009-08-06 Thread Yarko Tymciurak
On Thu, Aug 6, 2009 at 8:09 PM, Bottiger  wrote:

>
> I am using the latest version.


By "latest version" do you mean revision 1062 from Launchpad, or do you
mean

>
>
> I know there is a check, but the check is useless. If you specify a
> username in the dictionary that comes with the argument, then it will
> automatically assume that your auth_users table has a username column,
> which isn't the case.


You you define the auth_users table, then you can define this additional
field;
if not, it uses the email field.
This is how it is designed.

Am I missing something?


>
>
> On Aug 6, 5:58 pm, Yarko Tymciurak  wrote:
> > Which version of web2py are you looking at?
> >
> > First - in the most current version, I think you are talking about line
> 653,
> > in
> > get_or_create_user();
> >
> > You will note at the beginning of that function:
> >
> > if 'username' in keys:
> > username = 'username'
> > elif 'email' in keys:
> > username = 'email'
> > else:
> > raise SyntaxError, "user must have username or email"
> >
> > (there are 2 other places with lines like this, and they do similar
> checks;
> > so you can define a username in your auth, or by default it uses email).
> >
> > You might want to get a look at:
> http://bazaar.launchpad.net/~mdipierro/web2py/devel/annotate/head%3A/.
> ..
> >
> > BEWARE:  if you get the latest revision from launchpad, there is a bug in
> > template.py - which I'm waiting for Massimo to apply the patch for...
>  You
> > can remove the ".read()" portion of line 120 yourself in the meantime,
> that
> > is in parse_template():
> >
> > try:
> > fp = open(t, 'rb').read()
> > parent = fp.read()
> > fp.close()
> >
> > should read:
> >
> > try:
> > fp = open(t, 'rb')
> > parent = fp.read()
> > fp.close()
> >
> > - Yarko
> >
> > On Thu, Aug 6, 2009 at 7:29 PM, Bottiger  wrote:
> >
> > > I am trying to incorporate OpenID into Auth.
> >
> > > In my attempt to implement a CAS style plugin into auth, I stumbled
> > > upon a bizzare error.
> >
> > > On line 628 of gluon.tools, there is the following line:
> >
> > > "users = self.db(table_user[username] == keys[username]).select()"
> >
> > > username is defined to be "username" if you have a username and
> > > "email" if you have email specified. However, when I looked at the
> > > auth_user table, there is no "username" column.
> >
> > > The closest thing to a username column is first_name or last_name, but
> > > obviously this isn't the same thing.
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28116] Total Records

2009-08-06 Thread FERNANDO VILLARROEL


Hello All.

If i have a query as the follow:

rows=db(db.pagos.id_clientes==session.cliente_id).select(db.pagos.id,db.pagos.fecha,db.pagos.monto,db.pagos.comments,orderby=db.pagos.id)

How i can know the total of records of the object rows?

Fernando.


  

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28117] Re: Bizzare Auth Bug. Could Fix But Need Massimo's Ok

2009-08-06 Thread Yarko Tymciurak
On Thu, Aug 6, 2009 at 8:16 PM, Yarko Tymciurak  wrote:

> On Thu, Aug 6, 2009 at 8:09 PM, Bottiger  wrote:
>
>>
>> I am using the latest version.
>
>
> By "latest version" do you mean revision 1062 from Launchpad, or do you
> mean
>

Sorry - I meant  Launchpad version 1062, or Released Version 1.65.11 (which
looks to be Launchpad version 1056)?

>
>
>>
>> I know there is a check, but the check is useless. If you specify a
>> username in the dictionary that comes with the argument, then it will
>> automatically assume that your auth_users table has a username column,
>> which isn't the case.
>
>
> You you define the auth_users table, then you can define this additional
> field;
> if not, it uses the email field.
> This is how it is designed.
>
> Am I missing something?
>
>
>>
>>
>> On Aug 6, 5:58 pm, Yarko Tymciurak  wrote:
>> > Which version of web2py are you looking at?
>> >
>> > First - in the most current version, I think you are talking about line
>> 653,
>> > in
>> > get_or_create_user();
>> >
>> > You will note at the beginning of that function:
>> >
>> > if 'username' in keys:
>> > username = 'username'
>> > elif 'email' in keys:
>> > username = 'email'
>> > else:
>> > raise SyntaxError, "user must have username or email"
>> >
>> > (there are 2 other places with lines like this, and they do similar
>> checks;
>> > so you can define a username in your auth, or by default it uses email).
>> >
>> > You might want to get a look at:
>> http://bazaar.launchpad.net/~mdipierro/web2py/devel/annotate/head%3A/.
>> ..
>> >
>> > BEWARE:  if you get the latest revision from launchpad, there is a bug
>> in
>> > template.py - which I'm waiting for Massimo to apply the patch for...
>>  You
>> > can remove the ".read()" portion of line 120 yourself in the meantime,
>> that
>> > is in parse_template():
>> >
>> > try:
>> > fp = open(t, 'rb').read()
>> > parent = fp.read()
>> > fp.close()
>> >
>> > should read:
>> >
>> > try:
>> > fp = open(t, 'rb')
>> > parent = fp.read()
>> > fp.close()
>> >
>> > - Yarko
>> >
>> > On Thu, Aug 6, 2009 at 7:29 PM, Bottiger  wrote:
>> >
>> > > I am trying to incorporate OpenID into Auth.
>> >
>> > > In my attempt to implement a CAS style plugin into auth, I stumbled
>> > > upon a bizzare error.
>> >
>> > > On line 628 of gluon.tools, there is the following line:
>> >
>> > > "users = self.db(table_user[username] == keys[username]).select()"
>> >
>> > > username is defined to be "username" if you have a username and
>> > > "email" if you have email specified. However, when I looked at the
>> > > auth_user table, there is no "username" column.
>> >
>> > > The closest thing to a username column is first_name or last_name, but
>> > > obviously this isn't the same thing.
>> >>
>>
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28118] Re: Total Records

2009-08-06 Thread Yarko Tymciurak
len(rows)

On Thu, Aug 6, 2009 at 8:17 PM, FERNANDO VILLARROEL
wrote:

>
>
> Hello All.
>
> If i have a query as the follow:
>
> rows=db(db.pagos.id_clientes==session.cliente_id).select(db.pagos.id
> ,db.pagos.fecha,db.pagos.monto,db.pagos.comments,orderby=db.pagos.id)
>
> How i can know the total of records of the object rows?
>
> Fernando.
>
>
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28119] Re: Bizzare Auth Bug. Could Fix But Need Massimo's Ok

2009-08-06 Thread Bottiger

The function takes a dictionary where if the username key is defined,
then it assumes that your database has a "username" column which is
incorrect behavior.

On Aug 6, 6:16 pm, Yarko Tymciurak  wrote:
> On Thu, Aug 6, 2009 at 8:09 PM, Bottiger  wrote:
>
> > I am using the latest version.
>
> By "latest version" do you mean revision 1062 from Launchpad, or do you
> mean
>
>
>
> > I know there is a check, but the check is useless. If you specify a
> > username in the dictionary that comes with the argument, then it will
> > automatically assume that your auth_users table has a username column,
> > which isn't the case.
>
> You you define the auth_users table, then you can define this additional
> field;
> if not, it uses the email field.
> This is how it is designed.
>
> Am I missing something?
>
>
>
> > On Aug 6, 5:58 pm, Yarko Tymciurak  wrote:
> > > Which version of web2py are you looking at?
>
> > > First - in the most current version, I think you are talking about line
> > 653,
> > > in
> > > get_or_create_user();
>
> > > You will note at the beginning of that function:
>
> > >     if 'username' in keys:
> > >             username = 'username'
> > >         elif 'email' in keys:
> > >             username = 'email'
> > >         else:
> > >             raise SyntaxError, "user must have username or email"
>
> > > (there are 2 other places with lines like this, and they do similar
> > checks;
> > > so you can define a username in your auth, or by default it uses email).
>
> > > You might want to get a look at:
> >http://bazaar.launchpad.net/~mdipierro/web2py/devel/annotate/head%3A/.
> > ..
>
> > > BEWARE:  if you get the latest revision from launchpad, there is a bug in
> > > template.py - which I'm waiting for Massimo to apply the patch for...
> >  You
> > > can remove the ".read()" portion of line 120 yourself in the meantime,
> > that
> > > is in parse_template():
>
> > >         try:
> > >             fp = open(t, 'rb').read()
> > >             parent = fp.read()
> > >             fp.close()
>
> > > should read:
>
> > >         try:
> > >             fp = open(t, 'rb')
> > >             parent = fp.read()
> > >             fp.close()
>
> > > - Yarko
>
> > > On Thu, Aug 6, 2009 at 7:29 PM, Bottiger  wrote:
>
> > > > I am trying to incorporate OpenID into Auth.
>
> > > > In my attempt to implement a CAS style plugin into auth, I stumbled
> > > > upon a bizzare error.
>
> > > > On line 628 of gluon.tools, there is the following line:
>
> > > > "users = self.db(table_user[username] == keys[username]).select()"
>
> > > > username is defined to be "username" if you have a username and
> > > > "email" if you have email specified. However, when I looked at the
> > > > auth_user table, there is no "username" column.
>
> > > > The closest thing to a username column is first_name or last_name, but
> > > > obviously this isn't the same thing.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28120] Re: Bizzare Auth Bug. Could Fix But Need Massimo's Ok

2009-08-06 Thread Yarko Tymciurak
I see - so you would want an exception to be raised?   What do you propose?

On Thu, Aug 6, 2009 at 8:26 PM, Bottiger  wrote:

>
> The function takes a dictionary where if the username key is defined,
> then it assumes that your database has a "username" column which is
> incorrect behavior.
>
> On Aug 6, 6:16 pm, Yarko Tymciurak  wrote:
> > On Thu, Aug 6, 2009 at 8:09 PM, Bottiger  wrote:
> >
> > > I am using the latest version.
> >
> > By "latest version" do you mean revision 1062 from Launchpad, or do you
> > mean
> >
> >
> >
> > > I know there is a check, but the check is useless. If you specify a
> > > username in the dictionary that comes with the argument, then it will
> > > automatically assume that your auth_users table has a username column,
> > > which isn't the case.
> >
> > You you define the auth_users table, then you can define this additional
> > field;
> > if not, it uses the email field.
> > This is how it is designed.
> >
> > Am I missing something?
> >
> >
> >
> > > On Aug 6, 5:58 pm, Yarko Tymciurak  wrote:
> > > > Which version of web2py are you looking at?
> >
> > > > First - in the most current version, I think you are talking about
> line
> > > 653,
> > > > in
> > > > get_or_create_user();
> >
> > > > You will note at the beginning of that function:
> >
> > > > if 'username' in keys:
> > > > username = 'username'
> > > > elif 'email' in keys:
> > > > username = 'email'
> > > > else:
> > > > raise SyntaxError, "user must have username or email"
> >
> > > > (there are 2 other places with lines like this, and they do similar
> > > checks;
> > > > so you can define a username in your auth, or by default it uses
> email).
> >
> > > > You might want to get a look at:
> > >http://bazaar.launchpad.net/~mdipierro/web2py/devel/annotate/head%3A/
> . .>
> > > ..
> >
> > > > BEWARE:  if you get the latest revision from launchpad, there is a
> bug in
> > > > template.py - which I'm waiting for Massimo to apply the patch for...
> > >  You
> > > > can remove the ".read()" portion of line 120 yourself in the
> meantime,
> > > that
> > > > is in parse_template():
> >
> > > > try:
> > > > fp = open(t, 'rb').read()
> > > > parent = fp.read()
> > > > fp.close()
> >
> > > > should read:
> >
> > > > try:
> > > > fp = open(t, 'rb')
> > > > parent = fp.read()
> > > > fp.close()
> >
> > > > - Yarko
> >
> > > > On Thu, Aug 6, 2009 at 7:29 PM, Bottiger 
> wrote:
> >
> > > > > I am trying to incorporate OpenID into Auth.
> >
> > > > > In my attempt to implement a CAS style plugin into auth, I stumbled
> > > > > upon a bizzare error.
> >
> > > > > On line 628 of gluon.tools, there is the following line:
> >
> > > > > "users = self.db(table_user[username] == keys[username]).select()"
> >
> > > > > username is defined to be "username" if you have a username and
> > > > > "email" if you have email specified. However, when I looked at the
> > > > > auth_user table, there is no "username" column.
> >
> > > > > The closest thing to a username column is first_name or last_name,
> but
> > > > > obviously this isn't the same thing.
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28121] Re: Bizzare Auth Bug. Could Fix But Need Massimo's Ok

2009-08-06 Thread Bottiger

Well you see, unlike the "username" column, the "email" column is
actually defined.

So there are 3 possible solutions.

1. Define a "username" column in the "auth_user" table by default.
2. Change "username" to a column that is actually defined, such as
"first_name"
3. Remove the "username" check and usage completely.

On Aug 6, 6:38 pm, Yarko Tymciurak  wrote:
> I see - so you would want an exception to be raised?   What do you propose?
>
> On Thu, Aug 6, 2009 at 8:26 PM, Bottiger  wrote:
>
> > The function takes a dictionary where if the username key is defined,
> > then it assumes that your database has a "username" column which is
> > incorrect behavior.
>
> > On Aug 6, 6:16 pm, Yarko Tymciurak  wrote:
> > > On Thu, Aug 6, 2009 at 8:09 PM, Bottiger  wrote:
>
> > > > I am using the latest version.
>
> > > By "latest version" do you mean revision 1062 from Launchpad, or do you
> > > mean
>
> > > > I know there is a check, but the check is useless. If you specify a
> > > > username in the dictionary that comes with the argument, then it will
> > > > automatically assume that your auth_users table has a username column,
> > > > which isn't the case.
>
> > > You you define the auth_users table, then you can define this additional
> > > field;
> > > if not, it uses the email field.
> > > This is how it is designed.
>
> > > Am I missing something?
>
> > > > On Aug 6, 5:58 pm, Yarko Tymciurak  wrote:
> > > > > Which version of web2py are you looking at?
>
> > > > > First - in the most current version, I think you are talking about
> > line
> > > > 653,
> > > > > in
> > > > > get_or_create_user();
>
> > > > > You will note at the beginning of that function:
>
> > > > >     if 'username' in keys:
> > > > >             username = 'username'
> > > > >         elif 'email' in keys:
> > > > >             username = 'email'
> > > > >         else:
> > > > >             raise SyntaxError, "user must have username or email"
>
> > > > > (there are 2 other places with lines like this, and they do similar
> > > > checks;
> > > > > so you can define a username in your auth, or by default it uses
> > email).
>
> > > > > You might want to get a look at:
> > > >http://bazaar.launchpad.net/~mdipierro/web2py/devel/annotate/head%3A/
> > . > .>
> > > > ..
>
> > > > > BEWARE:  if you get the latest revision from launchpad, there is a
> > bug in
> > > > > template.py - which I'm waiting for Massimo to apply the patch for...
> > > >  You
> > > > > can remove the ".read()" portion of line 120 yourself in the
> > meantime,
> > > > that
> > > > > is in parse_template():
>
> > > > >         try:
> > > > >             fp = open(t, 'rb').read()
> > > > >             parent = fp.read()
> > > > >             fp.close()
>
> > > > > should read:
>
> > > > >         try:
> > > > >             fp = open(t, 'rb')
> > > > >             parent = fp.read()
> > > > >             fp.close()
>
> > > > > - Yarko
>
> > > > > On Thu, Aug 6, 2009 at 7:29 PM, Bottiger 
> > wrote:
>
> > > > > > I am trying to incorporate OpenID into Auth.
>
> > > > > > In my attempt to implement a CAS style plugin into auth, I stumbled
> > > > > > upon a bizzare error.
>
> > > > > > On line 628 of gluon.tools, there is the following line:
>
> > > > > > "users = self.db(table_user[username] == keys[username]).select()"
>
> > > > > > username is defined to be "username" if you have a username and
> > > > > > "email" if you have email specified. However, when I looked at the
> > > > > > auth_user table, there is no "username" column.
>
> > > > > > The closest thing to a username column is first_name or last_name,
> > but
> > > > > > obviously this isn't the same thing.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28122] Re: Bizzare Auth Bug. Could Fix But Need Massimo's Ok

2009-08-06 Thread Yarko Tymciurak
yes, I think you are correct -
since "username" is not in the default table definition,

table access should be in a try / except,
with some reasonable behavior...

there are at least 3 places this exists...

What woiuld be reasonable?  if username doesn't exist in your tables, try
'email' next, and generate a silent ticket, or just fail the user?

On Thu, Aug 6, 2009 at 8:38 PM, Yarko Tymciurak  wrote:

> I see - so you would want an exception to be raised?   What do you propose?
>
>
> On Thu, Aug 6, 2009 at 8:26 PM, Bottiger  wrote:
>
>>
>> The function takes a dictionary where if the username key is defined,
>> then it assumes that your database has a "username" column which is
>> incorrect behavior.
>>
>> On Aug 6, 6:16 pm, Yarko Tymciurak  wrote:
>> > On Thu, Aug 6, 2009 at 8:09 PM, Bottiger  wrote:
>> >
>> > > I am using the latest version.
>> >
>> > By "latest version" do you mean revision 1062 from Launchpad, or do you
>> > mean
>> >
>> >
>> >
>> > > I know there is a check, but the check is useless. If you specify a
>> > > username in the dictionary that comes with the argument, then it will
>> > > automatically assume that your auth_users table has a username column,
>> > > which isn't the case.
>> >
>> > You you define the auth_users table, then you can define this additional
>> > field;
>> > if not, it uses the email field.
>> > This is how it is designed.
>> >
>> > Am I missing something?
>> >
>> >
>> >
>> > > On Aug 6, 5:58 pm, Yarko Tymciurak  wrote:
>> > > > Which version of web2py are you looking at?
>> >
>> > > > First - in the most current version, I think you are talking about
>> line
>> > > 653,
>> > > > in
>> > > > get_or_create_user();
>> >
>> > > > You will note at the beginning of that function:
>> >
>> > > > if 'username' in keys:
>> > > > username = 'username'
>> > > > elif 'email' in keys:
>> > > > username = 'email'
>> > > > else:
>> > > > raise SyntaxError, "user must have username or email"
>> >
>> > > > (there are 2 other places with lines like this, and they do similar
>> > > checks;
>> > > > so you can define a username in your auth, or by default it uses
>> email).
>> >
>> > > > You might want to get a look at:
>> > >http://bazaar.launchpad.net/~mdipierro/web2py/devel/annotate/head%3A/
>> .> .>
>> > > ..
>> >
>> > > > BEWARE:  if you get the latest revision from launchpad, there is a
>> bug in
>> > > > template.py - which I'm waiting for Massimo to apply the patch
>> for...
>> > >  You
>> > > > can remove the ".read()" portion of line 120 yourself in the
>> meantime,
>> > > that
>> > > > is in parse_template():
>> >
>> > > > try:
>> > > > fp = open(t, 'rb').read()
>> > > > parent = fp.read()
>> > > > fp.close()
>> >
>> > > > should read:
>> >
>> > > > try:
>> > > > fp = open(t, 'rb')
>> > > > parent = fp.read()
>> > > > fp.close()
>> >
>> > > > - Yarko
>> >
>> > > > On Thu, Aug 6, 2009 at 7:29 PM, Bottiger 
>> wrote:
>> >
>> > > > > I am trying to incorporate OpenID into Auth.
>> >
>> > > > > In my attempt to implement a CAS style plugin into auth, I
>> stumbled
>> > > > > upon a bizzare error.
>> >
>> > > > > On line 628 of gluon.tools, there is the following line:
>> >
>> > > > > "users = self.db(table_user[username] == keys[username]).select()"
>> >
>> > > > > username is defined to be "username" if you have a username and
>> > > > > "email" if you have email specified. However, when I looked at the
>> > > > > auth_user table, there is no "username" column.
>> >
>> > > > > The closest thing to a username column is first_name or last_name,
>> but
>> > > > > obviously this isn't the same thing.
>> >>
>>
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28123] Re: Bizzare Auth Bug. Could Fix But Need Massimo's Ok

2009-08-06 Thread Yarko Tymciurak
On Thu, Aug 6, 2009 at 8:42 PM, Bottiger  wrote:

>
> Well you see, unlike the "username" column, the "email" column is
> actually defined.
>
> So there are 3 possible solutions.
>
> 1. Define a "username" column in the "auth_user" table by default.


well, the problem then is that if you WANT to use email as username, you
have duplicate fields;
I don't like this solution;


>
> 2. Change "username" to a column that is actually defined, such as
> "first_name"


It would have to be unique, and this isn't reasonable constraint for
first_name or last_name (or even a combination of the two);
I don't like this either;

>
> 3. Remove the "username" check and usage completely.


I think I like my action:  try username if that is what is passed in the
dict, perhaps raise a ticket a single time,
and fall back to 'email' if 'username' doesn't exist.

What do others think?


>
>
> On Aug 6, 6:38 pm, Yarko Tymciurak  wrote:
> > I see - so you would want an exception to be raised?   What do you
> propose?
> >
> > On Thu, Aug 6, 2009 at 8:26 PM, Bottiger  wrote:
> >
> > > The function takes a dictionary where if the username key is defined,
> > > then it assumes that your database has a "username" column which is
> > > incorrect behavior.
> >
> > > On Aug 6, 6:16 pm, Yarko Tymciurak  wrote:
> > > > On Thu, Aug 6, 2009 at 8:09 PM, Bottiger 
> wrote:
> >
> > > > > I am using the latest version.
> >
> > > > By "latest version" do you mean revision 1062 from Launchpad, or do
> you
> > > > mean
> >
> > > > > I know there is a check, but the check is useless. If you specify a
> > > > > username in the dictionary that comes with the argument, then it
> will
> > > > > automatically assume that your auth_users table has a username
> column,
> > > > > which isn't the case.
> >
> > > > You you define the auth_users table, then you can define this
> additional
> > > > field;
> > > > if not, it uses the email field.
> > > > This is how it is designed.
> >
> > > > Am I missing something?
> >
> > > > > On Aug 6, 5:58 pm, Yarko Tymciurak  wrote:
> > > > > > Which version of web2py are you looking at?
> >
> > > > > > First - in the most current version, I think you are talking
> about
> > > line
> > > > > 653,
> > > > > > in
> > > > > > get_or_create_user();
> >
> > > > > > You will note at the beginning of that function:
> >
> > > > > > if 'username' in keys:
> > > > > > username = 'username'
> > > > > > elif 'email' in keys:
> > > > > > username = 'email'
> > > > > > else:
> > > > > > raise SyntaxError, "user must have username or email"
> >
> > > > > > (there are 2 other places with lines like this, and they do
> similar
> > > > > checks;
> > > > > > so you can define a username in your auth, or by default it uses
> > > email).
> >
> > > > > > You might want to get a look at:
> > > > >
> http://bazaar.launchpad.net/~mdipierro/web2py/devel/annotate/head%3A/
> 
> > > .<
> http://bazaar.launchpad.net/%7Emdipierro/web2py/devel/annotate/head%3A/
> > > .>
> > > > > ..
> >
> > > > > > BEWARE:  if you get the latest revision from launchpad, there is
> a
> > > bug in
> > > > > > template.py - which I'm waiting for Massimo to apply the patch
> for...
> > > > >  You
> > > > > > can remove the ".read()" portion of line 120 yourself in the
> > > meantime,
> > > > > that
> > > > > > is in parse_template():
> >
> > > > > > try:
> > > > > > fp = open(t, 'rb').read()
> > > > > > parent = fp.read()
> > > > > > fp.close()
> >
> > > > > > should read:
> >
> > > > > > try:
> > > > > > fp = open(t, 'rb')
> > > > > > parent = fp.read()
> > > > > > fp.close()
> >
> > > > > > - Yarko
> >
> > > > > > On Thu, Aug 6, 2009 at 7:29 PM, Bottiger 
> > > wrote:
> >
> > > > > > > I am trying to incorporate OpenID into Auth.
> >
> > > > > > > In my attempt to implement a CAS style plugin into auth, I
> stumbled
> > > > > > > upon a bizzare error.
> >
> > > > > > > On line 628 of gluon.tools, there is the following line:
> >
> > > > > > > "users = self.db(table_user[username] ==
> keys[username]).select()"
> >
> > > > > > > username is defined to be "username" if you have a username and
> > > > > > > "email" if you have email specified. However, when I looked at
> the
> > > > > > > auth_user table, there is no "username" column.
> >
> > > > > > > The closest thing to a username column is first_name or
> last_name,
> > > but
> > > > > > > obviously this isn't the same thing.
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more optio

[web2py:28124] Re: Bizzare Auth Bug. Could Fix But Need Massimo's Ok

2009-08-06 Thread Bottiger

> well, the problem then is that if you WANT to use email as username, you
> have duplicate fields;

Actually as I am implementing OpenID, I am finding a need for a
separate field. In websites where you need to publicly display the
person's username, such as with comments etc... your users might not
like it if you displayed their email or First/Last name to the whole
Internet.


On Aug 6, 6:47 pm, Yarko Tymciurak  wrote:
> On Thu, Aug 6, 2009 at 8:42 PM, Bottiger  wrote:
>
> > Well you see, unlike the "username" column, the "email" column is
> > actually defined.
>
> > So there are 3 possible solutions.
>
> > 1. Define a "username" column in the "auth_user" table by default.
>
> well, the problem then is that if you WANT to use email as username, you
> have duplicate fields;
> I don't like this solution;
>
>
>
> > 2. Change "username" to a column that is actually defined, such as
> > "first_name"
>
> It would have to be unique, and this isn't reasonable constraint for
> first_name or last_name (or even a combination of the two);
> I don't like this either;
>
>
>
> > 3. Remove the "username" check and usage completely.
>
> I think I like my action:  try username if that is what is passed in the
> dict, perhaps raise a ticket a single time,
> and fall back to 'email' if 'username' doesn't exist.
>
> What do others think?
>
>
>
> > On Aug 6, 6:38 pm, Yarko Tymciurak  wrote:
> > > I see - so you would want an exception to be raised?   What do you
> > propose?
>
> > > On Thu, Aug 6, 2009 at 8:26 PM, Bottiger  wrote:
>
> > > > The function takes a dictionary where if the username key is defined,
> > > > then it assumes that your database has a "username" column which is
> > > > incorrect behavior.
>
> > > > On Aug 6, 6:16 pm, Yarko Tymciurak  wrote:
> > > > > On Thu, Aug 6, 2009 at 8:09 PM, Bottiger 
> > wrote:
>
> > > > > > I am using the latest version.
>
> > > > > By "latest version" do you mean revision 1062 from Launchpad, or do
> > you
> > > > > mean
>
> > > > > > I know there is a check, but the check is useless. If you specify a
> > > > > > username in the dictionary that comes with the argument, then it
> > will
> > > > > > automatically assume that your auth_users table has a username
> > column,
> > > > > > which isn't the case.
>
> > > > > You you define the auth_users table, then you can define this
> > additional
> > > > > field;
> > > > > if not, it uses the email field.
> > > > > This is how it is designed.
>
> > > > > Am I missing something?
>
> > > > > > On Aug 6, 5:58 pm, Yarko Tymciurak  wrote:
> > > > > > > Which version of web2py are you looking at?
>
> > > > > > > First - in the most current version, I think you are talking
> > about
> > > > line
> > > > > > 653,
> > > > > > > in
> > > > > > > get_or_create_user();
>
> > > > > > > You will note at the beginning of that function:
>
> > > > > > >     if 'username' in keys:
> > > > > > >             username = 'username'
> > > > > > >         elif 'email' in keys:
> > > > > > >             username = 'email'
> > > > > > >         else:
> > > > > > >             raise SyntaxError, "user must have username or email"
>
> > > > > > > (there are 2 other places with lines like this, and they do
> > similar
> > > > > > checks;
> > > > > > > so you can define a username in your auth, or by default it uses
> > > > email).
>
> > > > > > > You might want to get a look at:
>
> >http://bazaar.launchpad.net/~mdipierro/web2py/devel/annotate/head%3A/
> > 
> > > > .<
> >http://bazaar.launchpad.net/%7Emdipierro/web2py/devel/annotate/head%3A/
> > > > .>
> > > > > > ..
>
> > > > > > > BEWARE:  if you get the latest revision from launchpad, there is
> > a
> > > > bug in
> > > > > > > template.py - which I'm waiting for Massimo to apply the patch
> > for...
> > > > > >  You
> > > > > > > can remove the ".read()" portion of line 120 yourself in the
> > > > meantime,
> > > > > > that
> > > > > > > is in parse_template():
>
> > > > > > >         try:
> > > > > > >             fp = open(t, 'rb').read()
> > > > > > >             parent = fp.read()
> > > > > > >             fp.close()
>
> > > > > > > should read:
>
> > > > > > >         try:
> > > > > > >             fp = open(t, 'rb')
> > > > > > >             parent = fp.read()
> > > > > > >             fp.close()
>
> > > > > > > - Yarko
>
> > > > > > > On Thu, Aug 6, 2009 at 7:29 PM, Bottiger 
> > > > wrote:
>
> > > > > > > > I am trying to incorporate OpenID into Auth.
>
> > > > > > > > In my attempt to implement a CAS style plugin into auth, I
> > stumbled
> > > > > > > > upon a bizzare error.
>
> > > > > > > > On line 628 of gluon.tools, there is the following line:
>
> > > > > > > > "users = self.db(table_user[username] ==
> > keys[username]).select()"
>
> > > > > > > > username is defined to be "username" if you have a username and
> > > > > > > > "email" if you have 

[web2py:28125] Re: Bizzare Auth Bug. Could Fix But Need Massimo's Ok

2009-08-06 Thread Yarko Tymciurak
That's fine - then if you are building an OpenID application, you can
either:
manually have a separate field, or - have the OpenID solution modify what
the default auth fields are.

This way, other apps still have choice.

On Thu, Aug 6, 2009 at 8:54 PM, Bottiger  wrote:

>
> > well, the problem then is that if you WANT to use email as username, you
> > have duplicate fields;
>
> Actually as I am implementing OpenID, I am finding a need for a
> separate field. In websites where you need to publicly display the
> person's username, such as with comments etc... your users might not
> like it if you displayed their email or First/Last name to the whole
> Internet.
>
>
> On Aug 6, 6:47 pm, Yarko Tymciurak  wrote:
> > On Thu, Aug 6, 2009 at 8:42 PM, Bottiger  wrote:
> >
> > > Well you see, unlike the "username" column, the "email" column is
> > > actually defined.
> >
> > > So there are 3 possible solutions.
> >
> > > 1. Define a "username" column in the "auth_user" table by default.
> >
> > well, the problem then is that if you WANT to use email as username, you
> > have duplicate fields;
> > I don't like this solution;
> >
> >
> >
> > > 2. Change "username" to a column that is actually defined, such as
> > > "first_name"
> >
> > It would have to be unique, and this isn't reasonable constraint for
> > first_name or last_name (or even a combination of the two);
> > I don't like this either;
> >
> >
> >
> > > 3. Remove the "username" check and usage completely.
> >
> > I think I like my action:  try username if that is what is passed in the
> > dict, perhaps raise a ticket a single time,
> > and fall back to 'email' if 'username' doesn't exist.
> >
> > What do others think?
> >
> >
> >
> > > On Aug 6, 6:38 pm, Yarko Tymciurak  wrote:
> > > > I see - so you would want an exception to be raised?   What do you
> > > propose?
> >
> > > > On Thu, Aug 6, 2009 at 8:26 PM, Bottiger 
> wrote:
> >
> > > > > The function takes a dictionary where if the username key is
> defined,
> > > > > then it assumes that your database has a "username" column which is
> > > > > incorrect behavior.
> >
> > > > > On Aug 6, 6:16 pm, Yarko Tymciurak  wrote:
> > > > > > On Thu, Aug 6, 2009 at 8:09 PM, Bottiger 
> > > wrote:
> >
> > > > > > > I am using the latest version.
> >
> > > > > > By "latest version" do you mean revision 1062 from Launchpad, or
> do
> > > you
> > > > > > mean
> >
> > > > > > > I know there is a check, but the check is useless. If you
> specify a
> > > > > > > username in the dictionary that comes with the argument, then
> it
> > > will
> > > > > > > automatically assume that your auth_users table has a username
> > > column,
> > > > > > > which isn't the case.
> >
> > > > > > You you define the auth_users table, then you can define this
> > > additional
> > > > > > field;
> > > > > > if not, it uses the email field.
> > > > > > This is how it is designed.
> >
> > > > > > Am I missing something?
> >
> > > > > > > On Aug 6, 5:58 pm, Yarko Tymciurak  wrote:
> > > > > > > > Which version of web2py are you looking at?
> >
> > > > > > > > First - in the most current version, I think you are talking
> > > about
> > > > > line
> > > > > > > 653,
> > > > > > > > in
> > > > > > > > get_or_create_user();
> >
> > > > > > > > You will note at the beginning of that function:
> >
> > > > > > > > if 'username' in keys:
> > > > > > > > username = 'username'
> > > > > > > > elif 'email' in keys:
> > > > > > > > username = 'email'
> > > > > > > > else:
> > > > > > > > raise SyntaxError, "user must have username or
> email"
> >
> > > > > > > > (there are 2 other places with lines like this, and they do
> > > similar
> > > > > > > checks;
> > > > > > > > so you can define a username in your auth, or by default it
> uses
> > > > > email).
> >
> > > > > > > > You might want to get a look at:
> >
> > >http://bazaar.launchpad.net/~mdipierro/web2py/devel/annotate/head%3A/
> 
> > > <
> http://bazaar.launchpad.net/%7Emdipierro/web2py/devel/annotate/head%3A/>
> > > > > .<
> > >http://bazaar.launchpad.net/%7Emdipierro/web2py/devel/annotate/head%3A/
> > > > > .>
> > > > > > > ..
> >
> > > > > > > > BEWARE:  if you get the latest revision from launchpad, there
> is
> > > a
> > > > > bug in
> > > > > > > > template.py - which I'm waiting for Massimo to apply the
> patch
> > > for...
> > > > > > >  You
> > > > > > > > can remove the ".read()" portion of line 120 yourself in the
> > > > > meantime,
> > > > > > > that
> > > > > > > > is in parse_template():
> >
> > > > > > > > try:
> > > > > > > > fp = open(t, 'rb').read()
> > > > > > > > parent = fp.read()
> > > > > > > > fp.close()
> >
> > > > > > > > should read:
> >
> > > > > > > > try:
> > > > > > > > fp = open(t, 'rb')
> > > > > > > > 

[web2py:28126] Re: Bizzare Auth Bug. Could Fix But Need Massimo's Ok

2009-08-06 Thread Yarko Tymciurak
maybe a fifth option is to make the username a settable item, much like
auth_table_name is,
have a username_name item, and thus the tables can be defined this way?

The advantage is it would simplify the tools code (instead of adding
try/except), and
I think would serve the need you point out.  What do you think?

Still just thinking out loud...

On Thu, Aug 6, 2009 at 9:00 PM, Yarko Tymciurak  wrote:

> That's fine - then if you are building an OpenID application, you can
> either:
> manually have a separate field, or - have the OpenID solution modify what
> the default auth fields are.
>
> This way, other apps still have choice.
>
>
> On Thu, Aug 6, 2009 at 8:54 PM, Bottiger  wrote:
>
>>
>> > well, the problem then is that if you WANT to use email as username, you
>> > have duplicate fields;
>>
>> Actually as I am implementing OpenID, I am finding a need for a
>> separate field. In websites where you need to publicly display the
>> person's username, such as with comments etc... your users might not
>> like it if you displayed their email or First/Last name to the whole
>> Internet.
>>
>>
>> On Aug 6, 6:47 pm, Yarko Tymciurak  wrote:
>> > On Thu, Aug 6, 2009 at 8:42 PM, Bottiger  wrote:
>> >
>> > > Well you see, unlike the "username" column, the "email" column is
>> > > actually defined.
>> >
>> > > So there are 3 possible solutions.
>> >
>> > > 1. Define a "username" column in the "auth_user" table by default.
>> >
>> > well, the problem then is that if you WANT to use email as username, you
>> > have duplicate fields;
>> > I don't like this solution;
>> >
>> >
>> >
>> > > 2. Change "username" to a column that is actually defined, such as
>> > > "first_name"
>> >
>> > It would have to be unique, and this isn't reasonable constraint for
>> > first_name or last_name (or even a combination of the two);
>> > I don't like this either;
>> >
>> >
>> >
>> > > 3. Remove the "username" check and usage completely.
>> >
>> > I think I like my action:  try username if that is what is passed in the
>> > dict, perhaps raise a ticket a single time,
>> > and fall back to 'email' if 'username' doesn't exist.
>> >
>> > What do others think?
>> >
>> >
>> >
>> > > On Aug 6, 6:38 pm, Yarko Tymciurak  wrote:
>> > > > I see - so you would want an exception to be raised?   What do you
>> > > propose?
>> >
>> > > > On Thu, Aug 6, 2009 at 8:26 PM, Bottiger 
>> wrote:
>> >
>> > > > > The function takes a dictionary where if the username key is
>> defined,
>> > > > > then it assumes that your database has a "username" column which
>> is
>> > > > > incorrect behavior.
>> >
>> > > > > On Aug 6, 6:16 pm, Yarko Tymciurak  wrote:
>> > > > > > On Thu, Aug 6, 2009 at 8:09 PM, Bottiger 
>> > > wrote:
>> >
>> > > > > > > I am using the latest version.
>> >
>> > > > > > By "latest version" do you mean revision 1062 from Launchpad, or
>> do
>> > > you
>> > > > > > mean
>> >
>> > > > > > > I know there is a check, but the check is useless. If you
>> specify a
>> > > > > > > username in the dictionary that comes with the argument, then
>> it
>> > > will
>> > > > > > > automatically assume that your auth_users table has a username
>> > > column,
>> > > > > > > which isn't the case.
>> >
>> > > > > > You you define the auth_users table, then you can define this
>> > > additional
>> > > > > > field;
>> > > > > > if not, it uses the email field.
>> > > > > > This is how it is designed.
>> >
>> > > > > > Am I missing something?
>> >
>> > > > > > > On Aug 6, 5:58 pm, Yarko Tymciurak  wrote:
>> > > > > > > > Which version of web2py are you looking at?
>> >
>> > > > > > > > First - in the most current version, I think you are talking
>> > > about
>> > > > > line
>> > > > > > > 653,
>> > > > > > > > in
>> > > > > > > > get_or_create_user();
>> >
>> > > > > > > > You will note at the beginning of that function:
>> >
>> > > > > > > > if 'username' in keys:
>> > > > > > > > username = 'username'
>> > > > > > > > elif 'email' in keys:
>> > > > > > > > username = 'email'
>> > > > > > > > else:
>> > > > > > > > raise SyntaxError, "user must have username or
>> email"
>> >
>> > > > > > > > (there are 2 other places with lines like this, and they do
>> > > similar
>> > > > > > > checks;
>> > > > > > > > so you can define a username in your auth, or by default it
>> uses
>> > > > > email).
>> >
>> > > > > > > > You might want to get a look at:
>> >
>> > >http://bazaar.launchpad.net/~mdipierro/web2py/devel/annotate/head%3A/
>> 
>> > > <
>> http://bazaar.launchpad.net/%7Emdipierro/web2py/devel/annotate/head%3A/>
>> > > > > .<
>> > >
>> http://bazaar.launchpad.net/%7Emdipierro/web2py/devel/annotate/head%3A/
>> > > > > .>
>> > > > > > > ..
>> >
>> > > > > > > > BEWARE:  if you get the latest revision from launchpad,
>> there is
>> > > a
>> > > > > bug in
>> > > > > > 

[web2py:28127] Re: Bizzare Auth Bug. Could Fix But Need Massimo's Ok

2009-08-06 Thread Bottiger

At this point I think it would just be easier to let Massimo decide.

Anyway, OpenID integration with Auth is coming along. It is usable but
has some security concerns because people can change their OID in
their profile.

http://bitbucket.org/bottiger/web2py-openid-cas/overview/

On Aug 6, 7:05 pm, Yarko Tymciurak  wrote:
> maybe a fifth option is to make the username a settable item, much like
> auth_table_name is,
> have a username_name item, and thus the tables can be defined this way?
>
> The advantage is it would simplify the tools code (instead of adding
> try/except), and
> I think would serve the need you point out.  What do you think?
>
> Still just thinking out loud...
>
> On Thu, Aug 6, 2009 at 9:00 PM, Yarko Tymciurak  wrote:
> > That's fine - then if you are building an OpenID application, you can
> > either:
> > manually have a separate field, or - have the OpenID solution modify what
> > the default auth fields are.
>
> > This way, other apps still have choice.
>
> > On Thu, Aug 6, 2009 at 8:54 PM, Bottiger  wrote:
>
> >> > well, the problem then is that if you WANT to use email as username, you
> >> > have duplicate fields;
>
> >> Actually as I am implementing OpenID, I am finding a need for a
> >> separate field. In websites where you need to publicly display the
> >> person's username, such as with comments etc... your users might not
> >> like it if you displayed their email or First/Last name to the whole
> >> Internet.
>
> >> On Aug 6, 6:47 pm, Yarko Tymciurak  wrote:
> >> > On Thu, Aug 6, 2009 at 8:42 PM, Bottiger  wrote:
>
> >> > > Well you see, unlike the "username" column, the "email" column is
> >> > > actually defined.
>
> >> > > So there are 3 possible solutions.
>
> >> > > 1. Define a "username" column in the "auth_user" table by default.
>
> >> > well, the problem then is that if you WANT to use email as username, you
> >> > have duplicate fields;
> >> > I don't like this solution;
>
> >> > > 2. Change "username" to a column that is actually defined, such as
> >> > > "first_name"
>
> >> > It would have to be unique, and this isn't reasonable constraint for
> >> > first_name or last_name (or even a combination of the two);
> >> > I don't like this either;
>
> >> > > 3. Remove the "username" check and usage completely.
>
> >> > I think I like my action:  try username if that is what is passed in the
> >> > dict, perhaps raise a ticket a single time,
> >> > and fall back to 'email' if 'username' doesn't exist.
>
> >> > What do others think?
>
> >> > > On Aug 6, 6:38 pm, Yarko Tymciurak  wrote:
> >> > > > I see - so you would want an exception to be raised?   What do you
> >> > > propose?
>
> >> > > > On Thu, Aug 6, 2009 at 8:26 PM, Bottiger 
> >> wrote:
>
> >> > > > > The function takes a dictionary where if the username key is
> >> defined,
> >> > > > > then it assumes that your database has a "username" column which
> >> is
> >> > > > > incorrect behavior.
>
> >> > > > > On Aug 6, 6:16 pm, Yarko Tymciurak  wrote:
> >> > > > > > On Thu, Aug 6, 2009 at 8:09 PM, Bottiger 
> >> > > wrote:
>
> >> > > > > > > I am using the latest version.
>
> >> > > > > > By "latest version" do you mean revision 1062 from Launchpad, or
> >> do
> >> > > you
> >> > > > > > mean
>
> >> > > > > > > I know there is a check, but the check is useless. If you
> >> specify a
> >> > > > > > > username in the dictionary that comes with the argument, then
> >> it
> >> > > will
> >> > > > > > > automatically assume that your auth_users table has a username
> >> > > column,
> >> > > > > > > which isn't the case.
>
> >> > > > > > You you define the auth_users table, then you can define this
> >> > > additional
> >> > > > > > field;
> >> > > > > > if not, it uses the email field.
> >> > > > > > This is how it is designed.
>
> >> > > > > > Am I missing something?
>
> >> > > > > > > On Aug 6, 5:58 pm, Yarko Tymciurak  wrote:
> >> > > > > > > > Which version of web2py are you looking at?
>
> >> > > > > > > > First - in the most current version, I think you are talking
> >> > > about
> >> > > > > line
> >> > > > > > > 653,
> >> > > > > > > > in
> >> > > > > > > > get_or_create_user();
>
> >> > > > > > > > You will note at the beginning of that function:
>
> >> > > > > > > >     if 'username' in keys:
> >> > > > > > > >             username = 'username'
> >> > > > > > > >         elif 'email' in keys:
> >> > > > > > > >             username = 'email'
> >> > > > > > > >         else:
> >> > > > > > > >             raise SyntaxError, "user must have username or
> >> email"
>
> >> > > > > > > > (there are 2 other places with lines like this, and they do
> >> > > similar
> >> > > > > > > checks;
> >> > > > > > > > so you can define a username in your auth, or by default it
> >> uses
> >> > > > > email).
>
> >> > > > > > > > You might want to get a look at:
>
> >> > >http://bazaar.launchpad.net/~mdipierro/web2py/devel/annotate/head%3A/
> >> 

[web2py:28128] View Pagination Help

2009-08-06 Thread FERNANDO VILLARROEL

Hello.

I am trying to implementing the example pagination:

http://www.web2py.com/AlterEgo/default/show/95

How i use backward and forward in the view:

{{extend 'layout.html'}}
Pagos Cliente


 
 {{for row in rows:}}
 ..
 .




{{=nav}} 

previous

next

How i use backward and forward ?

Fernando




  

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28129] Re: How does db.table.field.represent work in the view?

2009-08-06 Thread DenesL

event.creator in the view is not a field, it is just an element in a
row
besides represent is only used by SQLFORM and SQLTABLE (the later
explains why BEAUTIFY works).

If you want to use represent in the view you would have to do so
explicitly:

{{ for e in events: }}
        {{ =db.event.creator.represent(e.creator) }} :
{{ =e.description }}
{{ pass }}

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28130] IS_EMAIL validator problem

2009-08-06 Thread DenesL

IS_EMAIL does not follow the RFC specs for valid email addresses
(see http://en.wikipedia.org/wiki/E-mail_address)

even a simple a...@b.com fails

it is kinda late to work on the regex now, maybe tomorrow.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28131] session forgetMeNot

2009-08-06 Thread rb

Section 4.8 from the Web2py Manual states that session data remains
until/unless the user deletes the session cookie or else the session
expires. When does a session expire - or what causes a session to
expire? Do I have any control over maintaining the life of a session ?
I guess I can delete a session with "session.forget" but do I have a
"session.forgetMeNot" ? Below I show a snippet from section 4.8 which
talks about this.

===
4.8 session

is another instance of the Storage  class. Whatever is stored into
session for example:

session.myvariable="hello"

can be retrieved at a later time:

a=session.myvariable

as long as the code is executed within the same session by the same
user
(provided the user has not deleted session cookies and the session did
not
expire).
===

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28132] Re: session forgetMeNot

2009-08-06 Thread Richard

try auth.settings.expiration = X


On Aug 7, 2:35 pm, rb  wrote:
> Section 4.8 from the Web2py Manual states that session data remains
> until/unless the user deletes the session cookie or else the session
> expires. When does a session expire - or what causes a session to
> expire? Do I have any control over maintaining the life of a session ?
> I guess I can delete a session with "session.forget" but do I have a
> "session.forgetMeNot" ? Below I show a snippet from section 4.8 which
> talks about this.
>
> ===
> 4.8 session
>
>     is another instance of the Storage  class. Whatever is stored into
> session for example:
>
> session.myvariable="hello"
>
> can be retrieved at a later time:
>
> a=session.myvariable
>
> as long as the code is executed within the same session by the same
> user
> (provided the user has not deleted session cookies and the session did
> not
> expire).
> ===
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28133] Images page 60 list index out of range

2009-08-06 Thread jayvandal

Error ticket for "images"
Ticket 127.0.0.1.2009-08-06.23-39-06.cf3dcbd3-ce73-4175-8d61-
ff5aca00c066


Hello,
I am reworking the tutorials in the web2py manual. In this Images
3.6 , I am following the  code and I am lost atthis point.
Thanks for any help
Jim


Error traceback
1.2.3.4.5.6.7. Traceback (most recent call last):  File "gluon/
restricted.py", line 178, in restricted  File "C:/web2py_win(2)/web2py/
applications/images/controllers/default.py", line 19, in 
File "gluon/globals.py", line 101, in   File "C:/web2py_win(2)/
web2py/applications/images/controllers/default.py", line 6, in
showIndexError: list index out of range



In file: C:\web2py_win(2)\web2py\applications\images/controllers/
default.py
1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20. def index():
images=db().select(db.image.ALL,orderby=db.image.title) return dict
(images=images) def show(): image=db(db.image.id==request.args
[0]).select()[0] form=SQLFORM(db.comment,fields=
['author','email','body']) form.vars.image_id=image.id if form.accepts
(request.vars,session):   response.flash='your comment is posted'
comments=db(db.comment.image_id==image.id).select() return dict
(image=image,comments=comments,form=form)  def download(): import os
path=os.path.join(request.folder,'uploads',request.args[0]) return
response.stream(path)response._vars=response._caller(show)

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28134] Re: Images page 60 list index out of range

2009-08-06 Thread Yarko Tymciurak
did you create an image with the admin interface, as shown on p. 56?

If you did not, then the select on line 6 would return NO records, and
therefore select()[0] would create an
index out of range.

You can check / change this by re-writing the select in the show() procedure
to something like this (I have not tried, so it might not be quite right):

def show():
images = db(db.image.id == request.args[0]).select()
if len(images) < 1:
   session.flash = T('No images to show!')
   return dict()
image = images[0]
# the rest as is

Regards,
- Yarko

On Fri, Aug 7, 2009 at 12:54 AM, jayvandal  wrote:

>
> Error ticket for "images"
> Ticket 127.0.0.1.2009-08-06.23-39-06.cf3dcbd3-ce73-4175-8d61-
> ff5aca00c066
>
>
> Hello,
> I am reworking the tutorials in the web2py manual. In this Images
> 3.6 , I am following the  code and I am lost atthis point.
> Thanks for any help
> Jim
>
>
> Error traceback
> 1.2.3.4.5.6.7. Traceback (most recent call last):  File "gluon/
> restricted.py", line 178, in restricted  File "C:/web2py_win(2)/web2py/
> applications/images/controllers/default.py", line 19, in 
> File "gluon/globals.py", line 101, in   File "C:/web2py_win(2)/
> web2py/applications/images/controllers/default.py", line 6, in
> showIndexError: list index out of range
>
>
>
> In file: C:\web2py_win(2)\web2py\applications\images/controllers/
> default.py
> 1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20. def index():
> images=db().select(db.image.ALL,orderby=db.image.title) return dict
> (images=images) def show(): image=db(db.image.id==request.args
> [0]).select()[0] form=SQLFORM(db.comment,fields=
> ['author','email','body']) form.vars.image_id=image.id if form.accepts
> (request.vars,session):   response.flash='your comment is posted'
> comments=db(db.comment.image_id==image.id).select() return dict
> (image=image,comments=comments,form=form)  def download(): import os
> path=os.path.join(request.folder,'uploads',request.args[0]) return
> response.stream(path)response._vars=response._caller(show)
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28135] Re: IS_EMAIL validator problem

2009-08-06 Thread Jonathan Lundell

On Aug 6, 2009, at 9:32 PM, DenesL wrote:

> IS_EMAIL does not follow the RFC specs for valid email addresses
> (see http://en.wikipedia.org/wiki/E-mail_address)
>
> even a simple a...@b.com fails
>
> it is kinda late to work on the regex now, maybe tomorrow.

The RFC is fairly hard to validate. If that's what we really want, I  
found this one on the web that looks about right:

^(?!\.)("([^"\r\\]|\\["\r\\])*"|([-a-z0-9!#$%&'*+/=?^_`{|}~]|(?...@[a- 
z0-9][\w\.-]*[a-z0-9]\.[a-z][a-z\.]*[a-z]$

It assumes the case-insensitive flag.

http://haacked.com/archive/2007/08/21/i-knew-how-to-validate-an-email-address-until-i.aspx

Overkill? Or, what the heck?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28136] Re: Web2py Plug-in system

2009-08-06 Thread mdipierro

We talk about this over and over but no progress. It is not an issue
of coding. We define a plugin as a piece of an application stored in:

models/plugin_[name].py
controllers/plugin_[name].py
views/plugin_[name]/*.html
modules/plugin_[name]/*
static/plugin_[name]/*

We also need a convention for metadata about the exposed functions/
urls. This was never done.
Until we have clear specs we cannot say we have a decent plugin
system.

Massimo


On Aug 6, 5:37 pm, b00m_chef  wrote:
> Is this being worked on? Who is involved? Is there a specification
> somewhere?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28137] Re: Left Join Failures

2009-08-06 Thread mdipierro

Please try a new version of web2py (I remember addressing a bug about
this in the past). if you still have a problem, try print the _select
and let us see the generate sql. This should definitively be possible.

Massimo


On Aug 6, 6:15 pm, howesc  wrote:
> Hi all,
>
> I'm writing several queries with multiple tables, and left joins, and
> the generated SQL is not working with postgres:
>
> ProgrammingError: invalid reference to FROM-clause entry for table
> "concert"
> LINE 1: ..., artist LEFT JOIN audiofile ON
> audiofile.concert=concert.id...
>                                                              ^
> HINT:  There is an entry for table "concert", but it cannot be
> referenced from this part of the query.
>
> my query is:
>     query = db((db.concert_purchases.auth_user == auth.user.id) &
>                (db.concert.id == db.concert_purchases.concert) &
>                (db.concert_purchases.expires > now) &
>                (db.artist.id == db.concert.artist) &
>                (db.venue.id == db.concert.venue))
>     rows = query.select(db.concert.name, db.concert.id,
>                         db.concert_purchases.date,
>                         db.artist.name,
>                         db.venue.name,
>                         db.concert.date,
>                         db.audiofile.file,
>                         left=db.audiofile.on(db.audiofile.concert ==
> db.concert.id),
>                         orderby=~db.concert_purchases.date)
>
> I have web2py Version 1.63.5 (2009-06-03 23:35:00)
>
> so, is there a way i can write the query to make the left join work,
> or should i just do multiple queries?
>
> thanks for the help,
>
> christian
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---