Re: [web2py] uWSGI and routes.py

2012-07-22 Thread Neil
Well, I got routes.py logging working, but today I can't reproduce any of my strange behaviour from yesterday. I have no idea what could have been causing it. I was moving around a lot between different servers/configurations/domains/webfaction applications, so perhaps something was being cache

Re: [web2py] Re: problem with left join and SQlFORM.grid

2012-07-22 Thread david waldrop
I downloaded the Windows Nightly build. I will try running form source, so am unsure how to do so. Trying now. Massimo Di Pierro Saturday, July 21, 2012 9:51 PM Source version of windows binary version? (the latter is not supposed to work yet) On Saturday,

[web2py] HOWTO: getting web2py to run on Android mobile devices

2012-07-22 Thread Luc Chase
Hi, Just out of curiosity (before seeing your pst) I tried to run web2py on my Galaxy Note. I extracted the web2py source to the SL4A scripts folder. Run the SL4A application then click on the web2py.py script. Although it complains of a missing Tk library and problems with cache files, it runs

Re: [web2py] Re: problem with left join and SQlFORM.grid

2012-07-22 Thread david waldrop
Massimo, the orderby clause on SQLFORM.grid works like a charm. 1000 thank you's for you support and help. /david david waldrop Sunday, July 22, 2012 5:45 AM I downloaded the Windows Nightly build. I will try running form source, so am unsure how to do so. Tryin

Re: [web2py] HOWTO: getting web2py to run on Android mobile devices

2012-07-22 Thread Bruno Rocha
That works on my Galaxy S -> http://www.web2pyslices.com/slice/show/1490/how-to-install-web2py-on-android-for-fun-without-rooting-the-device --

[web2py] Re: Unions and select from tables

2012-07-22 Thread Massimo Di Pierro
Not without some hacks I would not suggest. On Saturday, 21 July 2012 23:15:26 UTC-5, Cliff Kachinske wrote: > > I didn't ask the question correctly. > > In raw sql it would be something like > > SELECT name FROM table, CONCAT (first_name, last_name) FROM othertable AS > name WHERE blah ... > > I

Re: [web2py] Re: problem with left join and SQlFORM.grid

2012-07-22 Thread Massimo Di Pierro
Thanks for checking. This should be made a little easier. Sorry the nightly windows binary is still broken but it is in my todo list to fix it by tomorrow. Massimo On Sunday, 22 July 2012 05:23:00 UTC-5, david.waldrop wrote: > > Massimo, the orderby clause on SQLFORM.grid works like a charm. 1

[web2py] Facebook login no longer works when done on remote host?

2012-07-22 Thread Alec Taylor
I generated a new application on Facebook—added in the new CLIENT_ID and CLIENT_SECRET—but when I tried to login, the URL said: https://graph.facebook.com/oauth/authorize?scope=user_photos%2Cfriends_photos&redirect_uri=http%3A%2F%2F58.168.6.57%2Fuser%2Flogin&response_type=code&client_id= And the

[web2py] Re: HOWTO: getting web2py to run on Android mobile devices

2012-07-22 Thread Massimo Di Pierro
This is great! I am going to try on my phone asap. On Thursday, 19 January 2012 10:56:18 UTC-6, fpp wrote: > > > In response to a question in another thread, here is a summary of how > I got web2py running on my Android device (a Samsung Note), using > hints found here and there. > > Maybe it c

[web2py] Re: HOWTO: getting web2py to run on Android mobile devices

2012-07-22 Thread Massimo Di Pierro
BTW can you email me the instructions as a setup-androind.txt and I will include them in scripts/? On Thursday, 19 January 2012 10:56:18 UTC-6, fpp wrote: > > > In response to a question in another thread, here is a summary of how > I got web2py running on my Android device (a Samsung Note),

Re: [web2py] uWSGI and routes.py

2012-07-22 Thread Alec Taylor
When I start the uwsgi server and have the routes.py in place, I get the problems. However, when I start the uwsgi server, then add in the routes.py, then go to admin and click "reload routes"; it all works. On Sun, Jul 22, 2012 at 7:09 PM, Neil wrote: > Well, I got routes.py logging working, bu

[web2py] Re: Selective removing sessions

2012-07-22 Thread JaapP
i found the answer, thought to post in case somebody is struggling with the same problem. you can access the session.session_data with cPickle.loads(sessie.session_data)['auth']['user']['id'] --

Re: [web2py] Re: DAL select queries abstraction is getting fiddly... your advice?

2012-07-22 Thread Alec Taylor
Took another look, realised a join wasn't need for this sort of information, so rewrote the function thus: def d(): group = db(db.group_of_events.group_name == request.args(0)).select() or redirect(URL('', 'groups')) events = db(db.event.group_id == group[0].id).select() return dict(gr

[web2py] The Mystery of the Hidden View

2012-07-22 Thread Alec Taylor
My `group` controller located at: "/social/controllers/group.py", has a view located at: "/social/views/group/d.html". For the event page (routed off group), I am calling a function with an argument. Unfortunately I can't seem to find where I can overwrite its default view. I've tried: "/socia

Re: [web2py] The Mystery of the Hidden View

2012-07-22 Thread vinicius...@gmail.com
Your d.html view must certainly be located in /your_app/views/group/ dir. What do you want exactly to achieve? What is really happening? -- Vinicius Assef On 07/22/2012 02:49 PM, Alec Taylor wrote: My `group` controller located at: "/social/controllers/group.py", has a view located at: "/soci

Re: [web2py] The Mystery of the Hidden View

2012-07-22 Thread Alec Taylor
On Mon, Jul 23, 2012 at 3:56 AM, vinicius...@gmail.com wrote: > Your d.html view must certainly be located in /your_app/views/group/ dir. > > What do you want exactly to achieve? > What is really happening? > > Vinicius Assef I've overridden the "d.html" file for my `d()` controller, the problem

Re: [web2py] The Mystery of the Hidden View

2012-07-22 Thread Jonathan Lundell
On 22 Jul 2012, at 10:49 AM, Alec Taylor wrote: > My `group` controller located at: "/social/controllers/group.py", has a view > located at: "/social/views/group/d.html". > > For the event page (routed off group), I am calling a function with an > argument. > > Unfortunately I can't seem to fin

Re: [web2py] The Mystery of the Hidden View

2012-07-22 Thread Alec Taylor
Thanks for the advise, unfortunately that didn't work either. I have been able to get it working though, within the "d.html" template: # /social/views/group/d.html {{if 'eventpage' in globals() and 'group_name' in globals():}}{{if len(eventpage):}}{{=group_name}}{{=eventpage}}{{else:}} Error: g

Re: [web2py] The Mystery of the Hidden View

2012-07-22 Thread Anthony
Where did you set response.view -- should be something like: def d(): group = db(db.group_of_events.group_name == request.args(0)).select() orredirect (URL('', 'groups')) events = db(db.event.group_id == group[0].id).select() if request.args(1): response.view = 'group/event_pa

[web2py] Deploying on OS X Server 10.6.8

2012-07-22 Thread dancer`
Hello, I am relatively new to both web2py and web frameworks in general, so this might seem a noob question. I am trying to deploy mu web2py app on my OS x server, with no success. The server has apache set up, I installed mod_wsgi and mod_python, and running it as _www:admin. I put the web2py

Re: [web2py] Deploying on OS X Server 10.6.8

2012-07-22 Thread Alec Taylor
You might need to run a chown over the folder. If that doesn't work, give us the output of ls -al on that folder, from Terminal. On Mon, Jul 23, 2012 at 4:50 AM, dancer` wrote: > Hello, > > I am relatively new to both web2py and web frameworks in general, so this > might seem a noob question. I

[web2py] Replacing `id` with `group_name` as public key for table

2012-07-22 Thread Alec Taylor
Looking through my code I realised that I would be better served if I could lookup and reference by `group_name` instead of `id`. I have set `group_name` to: Field('group_name', notnull=True, requires=[IS_SLUG(), IS_NOT_IN_DB(db, 'group_of_events.group_name')]), So it is perfect for a public key.

Re: [web2py] Deploying on OS X Server 10.6.8

2012-07-22 Thread Jonathan Lundell
On 22 Jul 2012, at 12:12 PM, Alec Taylor wrote: > > You might need to run a chown over the folder. > > If that doesn't work, give us the output of ls -al on that folder, > from Terminal. And you don't need mod_python; it's obsolescent and not needed if you're using mod_wsgi. > > On Mon, Jul

[web2py] Re: Replacing `id` with `group_name` as public key for table

2012-07-22 Thread Anthony
Your reference is wrong -- instead of 'reference db.group_of_events', it should be 'reference group_of_events.group_name'. But I'm not sure that will work either -- as mentioned here, keyed tables can only referenc

Re: [web2py] Deploying on OS X Server 10.6.8

2012-07-22 Thread dancer`
Thank you both for your responses. I have removed mod_python, and running chown didn't change anything. This is the output of ls -al of the web2py folder on our server. On Sunday, July

Re: [web2py] Deploying on OS X Server 10.6.8

2012-07-22 Thread Jonathan Lundell
On 22 Jul 2012, at 1:03 PM, dancer` wrote: > Thank you both for your responses. I have removed mod_python, and running > chown didn't change anything. This is the output of ls -al of the web2py > folder on our server. Removing mod_python won't fix this symptom; it's just worth getting cleaned up

Re: [web2py] Re: DAL select queries abstraction is getting fiddly... your advice?

2012-07-22 Thread Cliff Kachinske
Correct, it will get you results. The drawback is you are hitting the database twice, while a join requires only one hit. In nearly every case you want to minimize database hits for performance reasons. On Sunday, July 22, 2012 1:12:39 PM UTC-4, Alec Taylor wrote: > > Took another look, real

[web2py] Best way to mix people and organizations on the same view? Opinions, please.

2012-07-22 Thread Cliff Kachinske
I have a need to provide an index of both people and organizations on the same view. In raw sql it would be something like this SELECT name FROM organizations WHERE something UNION SELECT CONCAT(first_name, last_name) AS name FROM people WHERE something ORDER BY name; DAL doesn't support CONCAT

Re: [web2py] Re: problem with left join and SQlFORM.grid

2012-07-22 Thread david waldrop
Massimo, I just tried pusing COPSIS to production and the migration is acting up again. Mre specifically, I have some extra fields defined on auth_user as follows: ## create all tables needed by auth if not custom tables auth.settings.extra_fields['auth_user'] = [ Field('org_ref', 'intege

Re: [web2py] Re: problem with left join and SQlFORM.grid

2012-07-22 Thread david.waldrop
ok this is very screwy, the table definition in /databases has the "extra_filelds", but teh postgress db does not. and there doesn't seem to be a way to get web2py to add them, at least not with the migrate options I am aware of. WHat do you think about manually adding the columns to the pos

[web2py] Re: Best way to mix people and organizations on the same view? Opinions, please.

2012-07-22 Thread Jose
El domingo, 22 de julio de 2012 17:39:29 UTC-3, Cliff Kachinske escribió: > > I have a need to provide an index of both people and organizations on the > same view. > > In raw sql it would be something like this > > SELECT name FROM organizations WHERE something > UNION > SELECT CONCAT(first_nam

[web2py] DAL not migrating auth.settings.extra_fields to Postgres (nor is it creating new tables defined in

2012-07-22 Thread david.waldrop
I create extra fields in auth_user like this ## create all tables needed by auth if not custom tables auth.settings.extra_fields['auth_user'] = [ Field('org_ref', 'integer', label="Organization"), Field('phone', label="Phone"), Field('show1stpage', 'boolean', label="Show Getting Starte

Re: [web2py] Re: problem with left join and SQlFORM.grid

2012-07-22 Thread Massimo Di Pierro
Comment from models the the columns that are not in db bust must be added. Set fake_migrate=True. Run your models (visit appadmin once). Set fake_migrate=False and uncomment the columns you want to migrate. Run your models again (visit appadmin to load your app). this should fix it. On Sunday,

[web2py] Re: DAL not migrating auth.settings.extra_fields to Postgres (nor is it creating new tables defined in

2012-07-22 Thread Massimo Di Pierro
I suspect you have fake_migrate=True when you added the line: Field('phone', label="Phone"), Try the solution I just posted in the other thread. IF it does not work, you can manually do the ALTER TABLE. web2py seems to already be aware of those columns. On Sunday, 22 July 2012 19:27:54 UTC-5,

Re: [web2py] The Mystery of the Hidden View

2012-07-22 Thread howesc
Alec, the Mysterious part of this mystery is the "controller" called with a parameterin web2py land that is not really a controller, but just a helper method. in your case event_page() returns it's value to the d() method (which web2py does think is a controller), and then web2py execution

[web2py] Re: Facebook login no longer works when done on remote host?

2012-07-22 Thread howesc
facebook is a picky pain in the *** in your facebook config you set a single domain name or ip address that is associated with the facebook app. all redirects that you specify when making calls to the facebook API must be in that domain/ip address. so your facebook config would need to have h

[web2py] SQLFORM.grid pagination refresh

2012-07-22 Thread dave
Is there a way for SQLFRORM.grid pagination to not refresh the whole page without the use of LOAD function? --

[web2py] Re: Best way to mix people and organizations on the same view? Opinions, please.

2012-07-22 Thread Cliff Kachinske
Thank you Jose. I will look into this. On Sunday, July 22, 2012 7:21:29 PM UTC-4, Jose wrote: > > > > El domingo, 22 de julio de 2012 17:39:29 UTC-3, Cliff Kachinske escribió: >> >> I have a need to provide an index of both people and organizations on the >> same view. >> >> In raw sql it would

[web2py] Re: SQLFORM.grid pagination refresh

2012-07-22 Thread Massimo Di Pierro
No. On Sunday, 22 July 2012 21:38:15 UTC-5, dave wrote: > > Is there a way for SQLFRORM.grid pagination to not refresh the whole page > without the use of the LOAD function? --

[web2py] Re: SQLFORM.grid pagination refresh

2012-07-22 Thread dave
Wow, that was fast, first time asker here, I have an SQLFORM.grid in a view, when I click the pagination links at the bottom of the page 1, 2, 3 etc, the whole page refreshes. To avoid this problem, I created a component and put it in a view {{=LOAD('default','ajaxTable2.load',ajax=True, target

Re: [web2py] Re: Replacing `id` with `group_name` as public key for table

2012-07-22 Thread Alec Taylor
Thanks, my main reasoning for changing the reference is that it would save a query. I guess I'll just have to add in that query... (to grab the name from the id) On Mon, Jul 23, 2012 at 5:29 AM, Anthony wrote: > Your reference is wrong -- instead of 'reference db.group_of_events', it > should b

[web2py] Re: Best way to mix people and organizations on the same view? Opinions, please.

2012-07-22 Thread Annet
I solved a similar problem by adding a table which I called node. A node can either be a person or an organization. When I need a list of both people and organizations I use a left join for the tables person and organization. In the view I use: {{if row.person.last_name:}} {{=row.person.fir