Re: [web2py] Re: Making a phone call from within Web2Py

2014-02-17 Thread António Ramos
i did the oposite http://www.youtube.com/watch?v=vCNoAyKN86o 2014-02-18 6:40 GMT+00:00 黄祥 : > i think can (not tested), if you had a pbx server running : > - pstn / digium card installed > - asterisk and dahdi configured > - pstn line connected to your modem /switch > > and then use asterisk ca

[web2py] Re: Making a phone call from within Web2Py

2014-02-17 Thread 黄祥
i think can (not tested), if you had a pbx server running : - pstn / digium card installed - asterisk and dahdi configured - pstn line connected to your modem /switch and then use asterisk call function from / within web2py using python function : subprocess best regards, stifan -- Resources:

Re: [web2py] Re: Free opensource Janrain alternative - Python Social auth

2014-02-17 Thread Quint
I'm working on a plugin. I expect to have an initial version somewhere this week.. Quint -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received th

[web2py] apache windows 2.8.2 sending email blocks the server?

2014-02-17 Thread Tim Richardson
I've noticed that apache 2.4 with mod_wsgi and python 2.7 does not respond to other requests while a controller is doing mail.send mod_wsgi on windows is one process and threads, which means that python is blocking on sending mail. Could this be correct? -- Resources: - http://web2py.com - htt

[web2py] Setting default function in default controller with parametric router

2014-02-17 Thread HittingSmoke
I would like to change my 'index' function to 'page' so that when someone calls a specific page and the router doesn't remove the controller name from the url it will say 'page/1' instead of 'index/1'. I found this answer via a search: https://stackoverflow.com/questions/17050196/web2py-change

Re: [web2py] Re: Social Login - Twitter logs out plus some other issues- web2py 2.8.2 / Mac OS X 10.9.1

2014-02-17 Thread Luciano Laporta Podazza
Hi Tito, Actually yes but I forgot to tell you guys :P I don't know if it's the best, compliant way of doing it but it works for me. I just ended up using flags taking advantage of 'session' and under the db.py. For instance: *db.py:* if session.facebook == 1: auth.settings.login_form = Fac

[web2py] Re: SQLFORM.grid Search

2014-02-17 Thread Anthony
Note, if you don't want to create a new search widget but just want to remove the default Javascript widget and instead have a basic search input field, you can do: search_input = grid.element('#w2p_directory_keywords') search_input and search_input.attributes.pop('_onfocus') That simpl

[web2py] Re: SQLFORM.grid Search

2014-02-17 Thread Anthony
Yes. The "searchable" argument can be a callable that builds a query based on the keywords, and there is a "search_widget" argument you can use to generate a custom search widget. I suggest you check out the SQLFORM.grid code in gluon.sqlhtml to see how they work. Anthony On Monday, February 1

[web2py] Making a phone call from within Web2Py

2014-02-17 Thread NeoToren
Maybe I am pushing the limits here...but I wonder, if we have an address book, with phone numbers ...and today most apps (W2P included) run quite well in browsers (NOT as native app but HTML)then can user just click on the number and the "smart "phone will make the call ? Like a ...native a

[web2py] SQLFORM.grid Search

2014-02-17 Thread horridohobbyist
I'm using SQLFORM.grid for my application. It's very powerful and saves me a lot of work. However, I would like to alter/customize the search function in the grid. Is there a way for me to do this? Thanks. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://gith

[web2py] How can I run postgresql VACUUM from web2py?

2014-02-17 Thread User
I'm trying to run postgresql vacuum from web2py (ultimately to be run by a scheduled task) and I get the following error: db.executesql('VACUUM sometable;') *** ProgrammingError: ('ERROR', '25001', 'VACUUM cannot run inside a transaction block') How can I run VACUUM from web2py? -- Resources

[web2py] Re: Proper jQuery syntax in a component.load to refer an element in the containing HTML file?

2014-02-17 Thread A36_Marty
Found the answer through playing around with a sample html file - in case future novice users find this useful. To hit a select list on an html page called "id=account_select" from a script in a component.load file, normal jQuery syntax works with the .val() function. e.g. From the componen

[web2py] Re: View performance. Helpers vs raw HTML?

2014-02-17 Thread HittingSmoke
Wow, that is thorough and answers almost all of my other questions on helpers as well. Thanks. New view is: {{for i,post in enumerate(posts):}} {{if i==items_per_page: break}} {{=post.title}} {{=

Re: [web2py] Making a complete backup of an app

2014-02-17 Thread 黄祥
another way is to be specific just copy your web2py app path from the system : e.g. rsync -avuzp web2py/app1 /backup/ or if you know exactly which path is belongs to your application, you can delete unnecessary folders on it. e.g. you can delete folders : cache, errors, sessions, etc. best rega

[web2py] Re: queries from tables

2014-02-17 Thread 黄祥
i'm so sorry my bad, it can work now, the problem is : >>> sum = db.purchase_detail.quantity.sum() print db().select(sum).first()[sum] should be : >>> sum = db.purchase_detail.quantity.sum() >>> print db().select(sum).first()[sum] the problem is occured because i create the query on the text edit

[web2py] Re: intermittent edit

2014-02-17 Thread Bruce Burkholder
I used the "instructables" procedure and used the following for setup: *wget http://web2py.googlecode.com/hg/scripts/setup-web2py-ubuntu.sh chmod +x setup-web2py-ubuntu.sh sudo ./setup-web2py-ubuntu.sh* I did get an error when running the chmod line but ran the next line and web2py setup fine.

[web2py] Allow NULL in form validator with reference Field

2014-02-17 Thread brahama von
Hi, dunno why my previous post didn't make it. Here it goes. part of my model legacy_db.define_table('courses', Field('awc_name','string'), Field('awc_version','string'), Field('awc_link','string'), Field('awc_pro_id',legacy_db.project, required=False, default=None), Field('a

[web2py] Email password on clear text?

2014-02-17 Thread sw2band
Good day: I am developing my first web application with web2py, so I follow the "Setting up mail" section of the reference manual: http://web2py.com/books/default/chapter/29/08/emails-and-sms#Setting-up-email I have a concern with the *mail.settings.login*, because this expose my password on c

[web2py] Re: Can I globally set readable = False for all 'id' fields in my database?

2014-02-17 Thread Jim S
yes, something like that. Thanks! On Monday, February 17, 2014 4:09:33 PM UTC-6, Anthony wrote: > > After all tables have been defined, maybe something like: > > [setattr(t._id, 'readable', False) for t in db] > > Anthony > > On Monday, February 17, 2014 4:21:36 PM UTC-5, Jim S wrote: >> >> Title

[web2py] Re: View performance. Helpers vs raw HTML?

2014-02-17 Thread Anthony
Yes, there should be some performance benefit to raw HTML. Also, in terms of style, I think raw HTML is preferred in views, unless you are making use of some of the special functionality of the helpers (see http://stackoverflow.com/a/8095585/440323). Anthony On Monday, February 17, 2014 5:19:1

[web2py] Re: "del db.my_table[id]" shortcut not working any more after enabling record versioning

2014-02-17 Thread Anthony
The problem is that the archive table includes a "current_record" field that references the original table, and because ondelete defaults to "CASCADE", when the original record is deleted, so are all the records that point to it. It appears the current system is designed to store previous versi

[web2py] Re: "del db.my_table[id]" shortcut not working any more after enabling record versioning

2014-02-17 Thread Horst Horst
I've just tried db.piece._enable_record_versioning(is_active = None), but this gives me yet another behavior: Backup records appear in the archive database on updates, but deleting records does not create backups but the opposite: It deletes the record from the original table as well as all bac

[web2py] View performance. Helpers vs raw HTML?

2014-02-17 Thread HittingSmoke
I'm curious if there's any notable performance overhead with using helpers. I have the following to list database entries on my home page: {{for i,post in enumerate(posts):}} {{if i==items_per_page: break}} {{=LI( DIV( A(IMG(_src=URL('static', 'content', 'thumbs', args=post.image),

Re: [web2py] Re: can't access admin interface when using nginx deployment script

2014-02-17 Thread Janos Tobias Locsei
Lol, please bear with me... I still have a question about what read/write privileges the www-data user and group should have. I changed them along the way as I was trying to get things to work, and I suspect I've given too strong permissions. The permissions as they stand now for the web2py folder

[web2py] Re: Can I globally set readable = False for all 'id' fields in my database?

2014-02-17 Thread Anthony
After all tables have been defined, maybe something like: [setattr(t._id, 'readable', False) for t in db] Anthony On Monday, February 17, 2014 4:21:36 PM UTC-5, Jim S wrote: > > Title pretty much says it all. By default, I don't ever want to display > id fields in any of my SQLFORMs. Is there

Re: [web2py] Re: Social Login - Twitter logs out plus some other issues- web2py 2.8.2 / Mac OS X 10.9.1

2014-02-17 Thread Tito Garrido
Hi Luciano, Did you find a way to use auth.settings.login_form in the controllers? I am facing the same issue. Regards, Tito On Mon, Dec 23, 2013 at 2:06 PM, Luciano Laporta Podazza < lucianopoda...@gmail.com> wrote: > Thanks for the advice Leonel!, > > You're totally right, I should change t

Re: [web2py] Re: can't access admin interface when using nginx deployment script

2014-02-17 Thread Janos Tobias Locsei
Update: actually I do have a user called www-data, and things are working as expected now. What tripped me up was that using "sudo -u www-data " gave an error "No such file or directory", and it turned out it was because I had an alias for sudo. So, using "/usr/bin/sudo -u www-data " works as expe

Re: [web2py] Re: Free opensource Janrain alternative - Python Social auth

2014-02-17 Thread Tito Garrido
Do we have any update about this integration? Thanks! Tito On Wed, Jul 31, 2013 at 4:27 PM, Massimo Di Pierro < massimo.dipie...@gmail.com> wrote: > Thank you. Will look at it asap. > > > On Wednesday, 31 July 2013 09:45:39 UTC-5, Quint wrote: >> >> I made an attempt to do this myself but i ne

Re: [web2py] A query too far? Inner join with group by...

2014-02-17 Thread Joe Barnhart
Hi Richard -- Don't need to try it... Do a thought experiment... The "belongs" matches the entire set of all affected times, event_codes and courses. It becomes the cartesian product of all combinations of time, event_code, and course. It matches N*M*K entries in the times table, where N, M

Re: [web2py] Re: Can I globally set readable = False for all 'id' fields in my database?

2014-02-17 Thread Jim S
Thanks again Richard Right now I'm just setting it after the table def but will take your advice and add it directly. -Jim On Monday, February 17, 2014 3:45:14 PM UTC-6, Richard wrote: > > So as you suggested db.table.id_field.readable=False or better in table > model directly readable=False s

Re: [web2py] Re: Can I globally set readable = False for all 'id' fields in my database?

2014-02-17 Thread Richard Vézina
So as you suggested db.table.id_field.readable=False or better in table model directly readable=False so lazy_table works better... Though, I am not sure it even works with SQLFORM.grid(), because I think it needs you tell it specifically... Richard On Mon, Feb 17, 2014 at 4:39 PM, Jim S wrote

[web2py] Re: Can I globally set readable = False for all 'id' fields in my database?

2014-02-17 Thread Jim S
Thanks Richard. I'm looking for something a bit more global, where I don't have to specify it on each SQLFORM.grid call that I make. Something on the lines of crud.settings.showid = False I thought that might work for SQLFORM.grid as well, but my testing is showing that it doesn't. -Jim On

Re: [web2py] Re: can't access admin interface when using nginx deployment script

2014-02-17 Thread Janos Tobias Locsei
Thanks Anthony, that's the problem - I hadn't opened port 443 in my iptables. I knew it would be something silly. It works now. I also had to change a couple of other things to make it work. Would either of the below compromise the security of my setup? 1. I removed the "-u www-data" option in th

[web2py] Re: "del db.my_table[id]" shortcut not working any more after enabling record versioning

2014-02-17 Thread Horst Horst
I guess I'm too dumb, but if there's a transaction before and after which referential integrity of the DB if given, and the records of all tables involved are backed up on their respective updates, why are inactive records in the original tables needed? I understand that the backup records need

Re: [web2py] Can I globally set readable = False for all 'id' fields in my database?

2014-02-17 Thread Richard Vézina
showid=False Or # top contoller showid = False and form = SQLFORM(..., showid=showid) Just once per controller file... Richard On Mon, Feb 17, 2014 at 4:21 PM, Jim S wrote: > Title pretty much says it all. By default, I don't ever want to display > id fields in any of my SQLFORMs. Is t

[web2py] Re: "del db.my_table[id]" shortcut not working any more after enabling record versioning

2014-02-17 Thread Horst Horst
Thanks, Anthony. In fact, I was completely missing the other enable_record_versioning section in the DAL chapter. Am Montag, 17. Februar 2014 14:02:36 UTC+1 schrieb Anthony: > > On Monday, February 17, 2014 7:24:24 AM UTC-5, Horst Horst wrote: >> >> I don't understand the rationale behind the w

[web2py] Can I globally set readable = False for all 'id' fields in my database?

2014-02-17 Thread Jim S
Title pretty much says it all. By default, I don't ever want to display id fields in any of my SQLFORMs. Is there a setting to globally turn this off? -Jim -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code

Re: [web2py] Re: how to get globals like "request" available in my own modules ?

2014-02-17 Thread Stef Mientki
thanks guys, "current" works perfect, I missed it in the huge amount of information cheers, Stef On 17-02-14 1:40, Anthony wrote: Note, instead of this method, you can now use gluon.current. Anthony On Sunday, February 16, 2014 6:32:13 PM UTC-5, Julio F. Schwarzbeck wrote: I assume t

Re: [web2py] cache issue

2014-02-17 Thread Richard Vézina
Nop! :( Richard On Mon, Feb 17, 2014 at 3:54 PM, Richard Vézina wrote: > Hmm, I think I find my issue... > > if form.process().accepts: > db.commit() > factory_cached_dict(0) # Because in this form I just add a value to > the table use to create the python dict > > > On Mon, Feb 17,

[web2py] Re: "del db.my_table[id]" shortcut not working any more after enabling record versioning

2014-02-17 Thread Niphlod
the is_active = 0 is actually a good rationale because of relational integrity. Dropping a row with dependants record on it would mean dropping also the dependant record(s), that can't be then "archived" properly. On Monday, February 17, 2014 2:02:36 PM UTC+1, Anthony wrote: > > On Monday, Febr

[web2py] Re: View does not display datetime in format chosen in database.

2014-02-17 Thread Niphlod
the rows are rendered without calling explicitely the formatter because you **could** want to do something with a "pure" python date object (e.g. operations, etc). Serializing using the grid instead calls the represent routine, so it gets serialized according to the formatting. BTW: beware (onl

Re: [web2py] cache issue

2014-02-17 Thread Richard Vézina
Hmm, I think I find my issue... if form.process().accepts: db.commit() factory_cached_dict(0) # Because in this form I just add a value to the table use to create the python dict On Mon, Feb 17, 2014 at 3:41 PM, Richard wrote: > Hello, > > I have an issue with app design and global var

Re: [web2py] A query too far? Inner join with group by...

2014-02-17 Thread Richard Vézina
But what you do in the join should be reproducible in a where clause... I start rewriting your join into a where clause at first and realize that I would need to rewrite 3-4 for time the same subquery in sql or I had to write a recursive query that would not help in translation into web2py query...

[web2py] Re: Question on linking fields

2014-02-17 Thread Jim S
Not tested, but something like this maybe?? def calls(): form = SQLFORM(db.calls) if form.process().accepted: id = form.vars.id redirect(URL('leads',vars={'id':id})) def leads(): call_id = request.get_vars.id db.leads.business.default = call_id form = SQLFORM(db.leads) if form.process().accepte

[web2py] cache issue

2014-02-17 Thread Richard
Hello, I have an issue with app design and global variable cached python dict... I use web2py 2.4.7 I use to create cached python dict in models like so : update_cached_dict_if_elapsed_time = 900 cached_dict = cache.ram('cached_dict', lambda: {r[0]: r[1] fo

Re: [web2py] A query too far? Inner join with group by...

2014-02-17 Thread Joe Barnhart
Hi Richard -- I thought about a subquery... But I've never seen or heard of the trick of using "subquery[0]" to pick out one column of the subquery. I see your approach is to materialize the subquery as a Rows object and then pick out elements. I don't think this will work as expected tho

[web2py] Re: Reusing a prefilled, readonly SQLFORM.factory form?

2014-02-17 Thread mjm
I observed the same behavior for SQLFORM.factory generated read-only forms. I ran into this when I had a table with lots of fields for which I wanted to create forms that displayed/edited only a selection of the fields. SQLFORM.factory is the way to go. Having the readonly form ignore the prepo

[web2py] Re: If session cookie exists /user/register redirects to /user/profile even if user has been deleted.

2014-02-17 Thread Anthony
Yes, we should probably have a friendlier error in that case. You can submit a Google Code issue about it. For now, you can include logic in the /default/user function to check the db for a valid record whenever the "profile" action is called. Anthony On Monday, February 17, 2014 1:45:42 PM UT

[web2py] Re: A few suggestions for fixes to the web2py book

2014-02-17 Thread Horst Horst
That's what I'd indeed do if if was my book. Am Sonntag, 16. Februar 2014 05:49:23 UTC+1 schrieb Tim Richardson: > > Perhaps we just delete the entire reference to pyjamas and see if a 0.9 > release ever happens? > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - h

[web2py] Re: can't access admin interface when using nginx deployment script

2014-02-17 Thread Anthony
Why are you port forwarding? Is SSL still on port 443? Anthony On Monday, February 17, 2014 5:48:02 AM UTC-5, Tobias Locsei wrote: > > Hi, > > I'm new to web2py and I really like how easy it is to use and how > excellent the documentation is. > > However, I'm having some trouble deploying my "

[web2py] Re: can't access admin interface when using nginx deployment script

2014-02-17 Thread Tobias Locsei
Hi Tim, I'm using ubuntu 13.10. Is there an error log or something I can post here to help figure out what went wrong? Tobias On Monday, February 17, 2014 6:41:32 PM UTC, Tim Richardson wrote: > > What OS? I've used ubuntu 12.04 a few times and the apache script works > perfectly. -- Resourc

[web2py] Accessing views in "Legacy" tables

2014-02-17 Thread pythonic . jonathan
Hi List, So, I have a sqlite database which has some views in that I want to access. The database isn't a web2py one (and can't be made so). I use the web2py extract_sqlite_models.py script to create the models. This creates a long file looking something like this: legacy_db = DAL('sqlite://db.

[web2py] If session cookie exists /user/register redirects to /user/profile even if user has been deleted.

2014-02-17 Thread HittingSmoke
This appears to be a bug. You can recreate it by creating a user with auth then logging in with the "remember me" box checked. Then empty the user table in the database. Go to /user/register and you will be redirected to /user/profile with an "Object not found" error. Clearing cookies fixes th

[web2py] can't access admin interface when using nginx deployment script

2014-02-17 Thread Tim Richardson
What OS? I've used ubuntu 12.04 a few times and the apache script works perfectly. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this mess

[web2py] Re: View does not display datetime in format chosen in database.

2014-02-17 Thread HittingSmoke
It was {{=P(post.date)}} but I've since changed it to prettydate. I'm still curious what the solution is though. On Monday, February 17, 2014 3:13:33 AM UTC-8, Niphlod wrote: > > how is it "called" in the view ? > > On Sunday, February 16, 2014 8:23:53 PM UTC+1, HittingSmoke wrote: >> >> I have t

[web2py] Re: Custom login form - How to detect login failure?

2014-02-17 Thread desta
I am just reporting back to say that using if response.flash == auth.messages.invalid_login: as Anthony suggested worked. I don't find it very elegant but hey it works! Thanks again! On Sunday, February 16, 2014 6:20:00 PM UTC+2, Anthony wrote: > > On Sunday, February 16, 2014 11:07:21 AM UTC-

[web2py] Re: logout error

2014-02-17 Thread ajith c t
Thanks for the help , I will look into it. Anything that helps improve my code is always welcome. On Monday, 17 February 2014 22:26:42 UTC+5:30, Anthony wrote: > > I wrapped the code in try/ except so that I could log everything and save >> it in a file, and in case of an error redirect to ano

[web2py] Re: logout error

2014-02-17 Thread Anthony
> > I wrapped the code in try/ except so that I could log everything and save > it in a file, and in case of an error redirect to another page. If there is > a better workaround please let me know. > See http://web2py.com/books/default/chapter/29/04/the-core#Routes-on-error for more sophistica

Re: [web2py] Making a complete backup of an app

2014-02-17 Thread Richard Vézina
tar -pczvf web2py/ That way you get web2py and applications folder... w2p package is just a kind of tar.gz compression... If you want to be sure you don't lost anything shut down your webserver (apache, nginx, uwsgi) before making your tar ball. So there is not request that pop up during the com

[web2py] Making a complete backup of an app

2014-02-17 Thread BlueShadow
Hi, I got several problems with my current web2py version: I can't disable apps, I can't use the package all command, or the update command and a few other minor things. So I wanted to delete web2py completly and reinstall it. But I'm not sure how I get all things from my app (database (sqlite))

Re: [web2py] A query too far? Inner join with group by...

2014-02-17 Thread Richard Vézina
Hello Joe, Found your plain sql query already convoluted, there is not simpler way to express it in SQL first? You seem to use join as if it was a where, join not intent for this, using it like that will make thing slower... Could this work : subquery = db.executesql('''select course, event_code

Re: [web2py] Re: queries from tables

2014-02-17 Thread Richard Vézina
Maybe db.executeslq(''' Plain SQL Query Here ''') Richard On Sun, Feb 16, 2014 at 9:24 AM, 黄祥 wrote: > tried to simplyfied test the query in the shell but got no result (no > error occured). > e.g. > In [4] : sum = db.purchase_detail.quantity.sum() > print db().select(sum).first()[sum] > > In

Re: [web2py] Bunch/Batch/Bulk insert Re-use db.define_table field definition in SQLFORM.factory() ?

2014-02-17 Thread Richard Vézina
That an option... The other option is to wrap IS_IN_DB() into IS_EMPTY_OR()... But it is not garanti that the concerning field will be filled... Richard On Sat, Feb 15, 2014 at 3:48 PM, ksotiris wrote: > Hello web2py-users, I am new to web2py framework. I have a question about > the following

Re: [web2py] My db wont allow to enter decimals lower than 1.0

2014-02-17 Thread Richard Vézina
But your field is decimal type right? So I guess you should use decimal in your SIZES calculation... Something like this : from deciaml import * [v*Decimal('0.05') for v in range(0,int(50/Decimal('0.05')))] Richard On Fri, Feb 14, 2014 at 3:43 PM, greenpoise wrote: > requires=IS_IN_SET(SIZ

[web2py] Re: logout error

2014-02-17 Thread ajith c t
I too raised the HTTP class and its working fine now, thank you to all for your continued support. I wrapped the code in try/ except so that I could log everything and save it in a file, and in case of an error redirect to another page. If there is a better workaround please let me know. On M

[web2py] Re: Web2py Separating Controller and View Layer

2014-02-17 Thread Anthony
Well, SQLFORM doesn't really provide a complete separation between controller and view (i.e., you typically end up specifying some display related parameters in the controller). You can do some manipulation of the form object in the view via the server side DOM. For example: {{form['_class'] =

[web2py] Web2py Separating Controller and View Layer

2014-02-17 Thread Juslin Guo
Hi All, I making the switch from cakephp to web2py, one of the things i struggle with is the form module... Is there a way i could override it without having to touch the controller. This requires the controller to know the css class.. form = SQLFORM(db.post,_class="form-horizontal bucket-form"

[web2py] Re: GAE localhost mysql instance

2014-02-17 Thread Juslin Guo
Thanks, finally i understand. Need to set my local sql with the option parameter when starting GAE. On Sunday, 16 February 2014 05:06:51 UTC+8, Christian Foster Howes wrote: > > did you invoke dev_appserver.py with the options to enable mysql? there's > a couple of options that you must pass to

[web2py] can't access admin interface when using nginx deployment script

2014-02-17 Thread Tobias Locsei
Hi, I'm new to web2py and I really like how easy it is to use and how excellent the documentation is. However, I'm having some trouble deploying my "hello world" app on a vps (digital ocean droplet). I used the script scripts/setup-web2py-nginx-uwsgi-ubuntu.sh from http://web2py.com/book/de

[web2py] Re: Insert on related tables by code

2014-02-17 Thread Anthony
Hard to say without seeing your code and the error. Please provide more detail. On Monday, February 17, 2014 1:37:32 AM UTC-5, Luca Guerrieri wrote: > > Goodmorning, > i:m trying to fill a table record by code. All the basic test went > good,but now i'm trying to fill a table that has a field wi

[web2py] Re: Web2py instead of MS Access?

2014-02-17 Thread Anthony
Good advice. Sounded like this was going to be used on a local network by a couple people sitting in a room together, so didn't want to complicate things with Auth and logins, but yes this is the way to go if you need to control access and permissions. Anthony On Monday, February 17, 2014 2:33

[web2py] Re: logout error

2014-02-17 Thread Anthony
To avoid catching the HTTP exceptions, you can do something like this: except Exception as e: if isinstance(e, HTTP): raise e Anyway, why are you wrapping all of you code in try/except statements -- web2py already catches all exceptions? Anthony On Monday, February 17, 2014

[web2py] Re: Can't delete records in appadmin any more after enabling auth.enable_record_versioning

2014-02-17 Thread Anthony
> > Perhaps appadmin could simply get an additional checkbox to toggle > ignore_common_filters for each query/action? It'd be actually quite > useful to be able to work on both levels of abstractions, > database-as-seen-by-app and database-as-is. > I believe appadmin does ignore_common_filters

[web2py] Re: Can't delete records in appadmin any more after enabling auth.enable_record_versioning

2014-02-17 Thread Anthony
See https://groups.google.com/d/msg/web2py/XqNkiPQq8v4/XwoluXJruToJ. On Monday, February 17, 2014 7:09:36 AM UTC-5, Horst Horst wrote: > > I understand that enable_record_versioning() simply makes delete set the > records' is_active flags to False, but I'm surprised that this also affects > adda

[web2py] Re: "del db.my_table[id]" shortcut not working any more after enabling record versioning

2014-02-17 Thread Anthony
On Monday, February 17, 2014 7:24:24 AM UTC-5, Horst Horst wrote: > > I don't understand the rationale behind the way record versioning is > implemented: If you delete a record, it is marked as is_active=False in the > original table, but it is also copied to the my_table_archive table. > > Why t

[web2py] Re: Can't delete records in appadmin any more after enabling auth.enable_record_versioning

2014-02-17 Thread Horst Horst
(Please excuse the self follow-up.) Perhaps appadmin could simply get an additional checkbox to toggle ignore_common_filters for each query/action? It'd be actually quite useful to be able to work on both levels of abstractions, database-as-seen-by-app and database-as-is. What's weird currentl

[web2py] Re: "del db.my_table[id]" shortcut not working any more after enabling record versioning

2014-02-17 Thread Horst Horst
I don't understand the rationale behind the way record versioning is implemented: If you delete a record, it is marked as is_active=False in the original table, but it is also copied to the my_table_archive table. Why this doubling of data? And /if/ data is doubled, why then not immediately whe

[web2py] Can't delete records in appadmin any more after enabling auth.enable_record_versioning

2014-02-17 Thread Horst Horst
I understand that enable_record_versioning() simply makes delete set the records' is_active flags to False, but I'm surprised that this also affects addadmin. This means I can't delete records any more for real. As a web2py newbie, this, together with my other record versioning problem (https:/

[web2py] Re: Running a web2py command after sleep

2014-02-17 Thread LightDot
Err... don't do this like you did :) There are some "do's" and "don'ts" in the programming books and you've touched most of the "don'ts" with your code. Use the scheduler: http://web2py.com/books/default/chapter/29/04#Scheduler You'll also most likely be using ajax to poll the database and chec

[web2py] Re: logout error

2014-02-17 Thread ajith c t
Thank you LightDot, saved my day and work at the right time. Read in forums that redirect() is internally calling a 303 exception, but didn't realise that I was catching that too and redirecting to errorpage. Thanks for the support. On Monday, 17 February 2014 17:02:41 UTC+5:30, LightDot wrote:

[web2py] A query too far? Inner join with group by...

2014-02-17 Thread Joe Barnhart
So I'm trying to use the DAL to create all of my queries, but I may have just exceeded its capability. My task is to create a view of "best times" for a particular sport. The sport has multiple events and the user is interested in collecting their best times over the entire database, organized

[web2py] Re: logout error

2014-02-17 Thread LightDot
Keep in mind that redirect() is an equivalent to raising an HTTP(303) exception. In other words, an intentional exception is raised to create a redirect. Looks like it's your own code doing a traceback and creating an error page on every exception, including the cases of the intentional redire

[web2py] Running a web2py command after sleep

2014-02-17 Thread Robin Manoli
Hey, I would like to create a background timer, and when it finishes I would like web2py to do something. I have tried numerous ways to do this, without succeeding. The closest one to success looked like this: 1. import urllib; urllib.urlopen(url).read() # read url which is a php script that ca

[web2py] Re: How to fix DAL, datetime error

2014-02-17 Thread Niphlod
all gotchas with databases are largely and explicitely documented in the book. SQLite is cool because it doesn't need any setup. That being said, I work with Postgresql wherever I can . On Sunday, February 16, 2014 5:07:21 PM UTC+1, A36_Marty wrote: > > Thanks Niphlod. Deleting the database fixe

[web2py] Re: View does not display datetime in format chosen in database.

2014-02-17 Thread Niphlod
how is it "called" in the view ? On Sunday, February 16, 2014 8:23:53 PM UTC+1, HittingSmoke wrote: > > I have the following in my model: > >Field('date', 'date', default=datetime.date.today(), requires = IS_DATE > (format=('%B %-d, %Y')), writable=False,readable=False), > > > ...and in the ap

[web2py] Re: postgres beginner questions: passwords, peer authentication, dev/production

2014-02-17 Thread Niphlod
a simple fabric file that pulls git and renames private/models/0_prod.py to models/0_db.py On Sunday, February 16, 2014 10:20:05 PM UTC+1, Tim Richardson wrote: > > postgres has peer authentication. > If I have mapped OS user www-data to a postgres role, and if apache runs > as www-data, can I