Re: [web2py] The Mystery of the Hidden View

2012-07-23 Thread Alec Taylor
On Mon, Jul 23, 2012 at 12:17 PM, howesc wrote: > 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 web2

[web2py] Production vs Localhost Working differently

2012-07-23 Thread lyn2py
Hello guys, I'm using the latest stable version, and need some assistance I'm using args to validate and I found the following behavior: On Localhost (copied directly from response toolbar, "request") args: edit 3 new-test-discussion On Production args: 3 new-test-discussion I'm using a

[web2py] How to hide items in Production?

2012-07-23 Thread lyn2py
I have the code working on Localhost, but along with localhost there are the response toolbar, the link to the admin site and the database used. What code should I use to "test" if the code is being executed on the production server, so that I can "hide" or switch to use a different database?

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

2012-07-23 Thread Michele Comitini
The simplest thing to do is give a name of choice put that in the developers.facebook.com configuration panel of you application. THEN if you want to test just add a record in you /etc/hosts file pointing to localhost when testing locally, pointing to your server when testing production. For inst

[web2py] (virtualenv problems) ImportError for file in application/myapp/modules

2012-07-23 Thread Peter O
Help please. I am preparing for a PaaS deployment on Heroku or Dotcloud. I am following the setup on this page (https://devcenter.heroku.com/articles/django), which is essentially the same steps as in scripts/setup-virtualenv-web2py.sh. However, I am getting an import error within virtualenv.

[web2py] Re: (virtualenv problems) ImportError for file in application/myapp/modules

2012-07-23 Thread Peter O
The problem is limited to the "import mymodule" line in models, but not in controllers. I am using "mymodule = local_import("mymodule")" to get by. --

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

2012-07-23 Thread david waldrop
Massimo, I finally got it to work last night. I am not sure what I did to get it working or why, but I manually modified the postgres tables(making sure the fields are in the same order as the extra_fileds AND played with combinations of Migrate=True and Fake_migrate=True. I ended up manu

[web2py] prettydate question

2012-07-23 Thread ctrlSoft
datetime format is: 2012-07-18 10:00:00 hi in view i have following code: {{=prettydate(row.deadline,T)}} but result is : %d days ago %d days ago %d days ago %d days ago ... 1 week ago 1 week ago ... %d weeks ago %d weeks ago %d weeks ago how to display 4 days ago 5 days ago ... 2

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

2012-07-23 Thread Alec Taylor
Okay, this is a little strange. Just did a bit morre troubleshooting, found that: - That IP Address isn't associated with my domain in any way (I emailed my host to confirm) - The client ID is the one I'm using for my local web2py server, not the one I modified it too in "fbappauth.py" - There wer

[web2py] Re: Question about an xml file in use with a JS(jquery) Mappicker in web2py ...

2012-07-23 Thread Don_X
Finally, to solve this issue ... I did two things : ( considering there are only 2 languages that are taken into considerations so .. ) 1st ) I embeded the js script inside the html page and put in some python codes into it, and also to solve the xml url calling inside the js script ( with co

[web2py] Re: SQLFORM.grid pagination refresh

2012-07-23 Thread Anthony
When you submit a form in an Ajax component, only the component will refresh -- so if you make a filter form contained in the component with the grid, when the form is submitted, it will reload the whole component. You can also customize the grid search widget to do whatever you want -- both "s

[web2py] Re: Foreign Key fields as null?

2012-07-23 Thread joe
The key error was because it was '%(name)' not '%(name)s'. Everything works now! Thanks! On Friday, July 20, 2012 3:37:11 PM UTC-5, Anthony wrote: > > Actually, I would think that would have caused an AttributeError (trying > to access an attribute of a NoneType object). Not sure where the KeyE

[web2py] Re: How to hide items in Production?

2012-07-23 Thread Anthony
request.is_local indicates whether the request is coming from localhost, so that can often be used to distinguish between development and production. Anthony On Monday, July 23, 2012 3:53:49 AM UTC-4, lyn2py wrote: > > I have the code working on Localhost, but along with localhost there are > t

[web2py] Re: Production vs Localhost Working differently

2012-07-23 Thread Anthony
Can you show the code where the args are generated (presumably via the URL function)? Is anything happening inside a request.is_local condition? Anthony On Monday, July 23, 2012 3:49:44 AM UTC-4, lyn2py wrote: > > Hello guys, > > I'm using the latest stable version, and need some assistance > >

Re: [web2py] How to hide items in Production?

2012-07-23 Thread Jonathan Lundell
On 23 Jul 2012, at 12:53 AM, lyn2py wrote: > I have the code working on Localhost, but along with localhost there are the > response toolbar, the link to the admin site and the database used. > > What code should I use to "test" if the code is being executed on the > production server, so that I

[web2py] Re: (virtualenv problems) ImportError for file in application/myapp/modules

2012-07-23 Thread Massimo Di Pierro
Which web2py and python versions? Looks like custom_import is not doing its job. Could also be a path issue. On Monday, 23 July 2012 04:51:48 UTC-5, Peter O wrote: > > The problem is limited to the "import mymodule" line in models, but not in > controllers. > > I am using "mymodule = local_impor

[web2py] Re: prettydate question

2012-07-23 Thread Massimo Di Pierro
Are you saying you actually get "%d" in the output? On Monday, 23 July 2012 05:32:08 UTC-5, ctrlSoft wrote: > > datetime format is: 2012-07-18 10:00:00 > > hi in view i have following code: > {{=prettydate(row.deadline,T)}} > > but result is : > %d days ago > %d days ago > %d days ago > %d

[web2py] Re: Production vs Localhost Working differently

2012-07-23 Thread Massimo Di Pierro
You definitively have different routes.py On Monday, 23 July 2012 02:49:44 UTC-5, lyn2py wrote: > > Hello guys, > > I'm using the latest stable version, and need some assistance > > I'm using args to validate and I found the following behavior: > > On Localhost (copied directly from response tool

[web2py] Unit Testing Database Best Practices

2012-07-23 Thread Mark Li
I'm fairly new to test-driven development and have decided it is the best way to go for my new webapp. While functional tests with selenium seem to be more straightforward (as far as what the tests want to accomplish), I'm lost on what unit tests for the database should test for. For example, i

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

2012-07-23 Thread Cliff Kachinske
Annet, Thanks for the response. How do you handle sorting in the joined rows? Thanks, Cliff Kachinske On Monday, July 23, 2012 1:37:03 AM UTC-4, Annet wrote: > > 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

Re: [web2py] Unit Testing Database Best Practices

2012-07-23 Thread Richard Vézina
I am interesting in what will come out of this thread... But, to me I think your last question on fact that database will have undertermined set of data mean that you maybe not validate your app base on the entries of the database but on a testing database with a set of known data, that you can ev

[web2py] Re: Production vs Localhost Working differently

2012-07-23 Thread lyn2py
Massimo is right. I updated the routes.py (now both files are exactly the same) and now a different problem. This is my routes.py file: routers = dict( BASE = dict( default_controller = 'default', default_function = 'index' ), myapp = dict( default_control

[web2py] Re: Production vs Localhost Working differently

2012-07-23 Thread Anthony
I think you have to list all the functions in the default controller if you want the default function removed from the URL when there are URL args. Not sure why it would work on localhost, though. Anthony On Monday, July 23, 2012 11:56:09 AM UTC-4, lyn2py wrote: > > Massimo is right. > > I upda

Re: [web2py] Re: Production vs Localhost Working differently

2012-07-23 Thread Jonathan Lundell
On 23 Jul 2012, at 8:56 AM, lyn2py wrote: > Massimo is right. > > I updated the routes.py (now both files are exactly the same) and now a > different problem. > > This is my routes.py file: > > routers = dict( > BASE = dict( > default_controller = 'default', > default_fun

Re: [web2py] Re: Production vs Localhost Working differently

2012-07-23 Thread Jonathan Lundell
On 23 Jul 2012, at 9:02 AM, Anthony wrote: > I think you have to list all the functions in the default controller if you > want the default function removed from the URL when there are URL args. Not > sure why it would work on localhost, though. Yeah, but discussion is the function; it's default

Re: [web2py] Re: Production vs Localhost Working differently

2012-07-23 Thread lyn2py
Thanks Jonathan! Your answer worked! I've reloaded routes all the time, but I forgot it this time. :( On Tuesday, July 24, 2012 12:05:04 AM UTC+8, Jonathan Lundell wrote: > > On 23 Jul 2012, at 8:56 AM, lyn2py wrote: > > Massimo is right. > > I updated the routes.py (now both files are exactly th

[web2py] Re: prettydate question

2012-07-23 Thread ctrlSoft
> > yes. >> > http://i.imgur.com/jaeop.jpg http://i.imgur.com/xPBG1.jpg --

Re: [web2py] Unit Testing Database Best Practices

2012-07-23 Thread vinicius...@gmail.com
+1 On 07/23/2012 11:40 AM, Richard Vézina wrote: I am interesting in what will come out of this thread... But, to me I think your last question on fact that database will have undertermined set of data mean that you maybe not validate your app base on the entries of the database but on a testin

[web2py] Re: How to hide items in Production?

2012-07-23 Thread lyn2py
Thank you both. It works. If I want to keep the response toolbar available to the logged in admin, how should I perform the IF test? On Monday, July 23, 2012 9:57:55 PM UTC+8, Anthony wrote: > > request.is_local indicates whether the request is coming from localhost, > so that can often be used

[web2py] None ?

2012-07-23 Thread Ashraf Mansour
Hi, I just received 'None', when accessing certain page. is this an error? there is no ticket as normal. Please explain... Regards, Ashraf --

Re: [web2py] None ?

2012-07-23 Thread Jonathan Lundell
On 23 Jul 2012, at 9:53 AM, Ashraf Mansour wrote: > I just received 'None', when accessing certain page. > is this an error? > > there is no ticket as normal. > Please explain... > Most likely a function that returns None or a function without a return value. --

Re: [web2py] Re: prettydate question

2012-07-23 Thread Bruno Rocha
do you have an it-it.py in languages folder? looks like the encoding of translations file is corrupted. try replacing T with lamba x: x for testing {{=prettydate(row.deadline, lambda x: x)}} On Mon, Jul 23, 2012 at 1:28 PM, ctrlSoft wrote: > yes. >>> >> http://i.imgur.com/jaeop.jpg > > http

[web2py] Logic check in View, to check if auth.user.group_id...

2012-07-23 Thread Alec Taylor
I'm confused at how I'm meant to do logic checks, e.g. with a test-case model: auth.settings.extra_fields['auth_user']= [Field('member_of', 'list:reference db.group_of_events', requires=IS_IN_DB(db, db.group_of_events, '%(group_name)s', multiple=True))] db.define_table( 'group_of_events',

Re: [web2py] Logic check in View, to check if auth.user.group_id...

2012-07-23 Thread vinicius...@gmail.com
If your doubt is about view syntax, it's just the way you outlined, with a few changes. 1) Change {{T(...)}} by {{=T(...)}} 2) Close the "else" with {{PASS}} Always remember web2py views can have normal Python code. But don't overuse it, ok? -- Vinicius Assef On 07/23/2012 02:55 PM, Alec T

Re: [web2py] Logic check in View, to check if auth.user.group_id...

2012-07-23 Thread Alec Taylor
Thanks, but unfortunately that didn't work. I forgot to mention my error before: 'NoneType' object has no attribute 'member_of' On Tue, Jul 24, 2012 at 4:03 AM, vinicius...@gmail.com < vinicius...@gmail.com> wrote: > If your doubt is about view syntax, it's just the way you outlined, with a > f

Re: [web2py] Unit Testing Database Best Practices

2012-07-23 Thread Mark Li
Thanks Richard, for now I am going to create a special database table that will follow the structure of the actual data tables, but with a fixed data set like you suggested (controls for count very well). I'm still interested in any real examples people use for unit testing databases and contro

Re: [web2py] Logic check in View, to check if auth.user.group_id...

2012-07-23 Thread Bruno Rocha
there is no request.auth_user by default, did you created this? I think you can do (with trunk) {{if thisgroupid in auth.user_groups:}} --

[web2py] Documentation nit

2012-07-23 Thread MichaelF
The last sentence of section 6.17 says, "Yes this is unusual and not rarely needed." It should read something like, "Yes this is unusual and rarely needed," or "Yes this is unusual and not often needed." --

Re: [web2py] Unit Testing Database Best Practices

2012-07-23 Thread Martín Mulone
> > I'm following http://www.web2py.com/AlterEgo/default/show/260 > that guide is too old, have execfile() :S. Search in the group on how to use modules in your app. 2012/7/22 Mark Li > I'm fairly new to test-driven development and have decided it is the best > way to go for my new webapp. Whil

[web2py] validate_and_insert() question

2012-07-23 Thread tiadobatima
Hi guys, I'm trying to understand what validate_and_insert() and validate_and_update() are doing to see if I can use it reliably. I'm writing an API, and I have no need for form validation. So after spending sometime reading the DAL code, I still have a few questions: - When I insert a record

Re: [web2py] Logic check in View, to check if auth.user.group_id...

2012-07-23 Thread Alec Taylor
On Tue, Jul 24, 2012 at 5:09 AM, Bruno Rocha wrote: > > there is no request.auth_user by default, did you created this? > > I think you can do (with trunk) > > {{if thisgroupid in auth.user_groups:}} > > Unfortunately that didn't work either... I'm running Version 2.0.0 (2012-07-20 17:37:48) dev:

Re: [web2py] Logic check in View, to check if auth.user.group_id...

2012-07-23 Thread Alec Taylor
Just noticed I had underscore instead of point, still isn't working though: 'NoneType' object has no attribute 'member_of' On Tue, Jul 24, 2012 at 5:36 AM, Alec Taylor wrote: > On Tue, Jul 24, 2012 at 5:09 AM, Bruno Rocha wrote: > >> >> there is no request.auth_user by default, did you created t

[web2py] Confused re. "Validators in model not good MVC"

2012-07-23 Thread MichaelF
The documentation says, in section 6.17.4 (my highlighting): 1 {{extend 'layout.html'}} > 2 Records > 3 {{=SQLTABLE(rows)}} > SQLTABLE converts the rows into an HTML table with a header containing the > column names and one row per record. ... The values extracted from the database are also f

Re: [web2py] validate_and_insert() question

2012-07-23 Thread Alec Taylor
What kind of features are you looking to get from web2py? To me it sounds like Twisted might be a better solution for you. On Tue, Jul 24, 2012 at 5:27 AM, tiadobatima wrote: > > Hi guys, > > I'm trying to understand what validate_and_insert() > and validate_and_update() are doing to see if I c

Re: [web2py] Logic check in View, to check if auth.user.group_id...

2012-07-23 Thread Bruno Rocha
Do you have a member_of field in your auth_user table? On Mon, Jul 23, 2012 at 4:40 PM, Alec Taylor wrote: > Just noticed I had underscore instead of point, still isn't working though: > 'NoneType' object has no attribute > 'member_of' > On Tue, Jul 24, 2012 at 5:36 AM, Alec Taylor wrote: > >>

[web2py] load deletes the values of submit-buttons

2012-07-23 Thread Martin Weissenboeck
Hi, I have a simple form with two submit-buttons. First try: def index(): form=FORM( INPUT(_type='submit', _value='A', _name='AA'), INPUT(_type='submit', _value='B', _name='BB'), ) if form.accepts(request, session): return dict(AA=form.vars.AA, BB=form.vars.BB

[web2py] Re: Confused re. "Validators in model not good MVC"

2012-07-23 Thread Cliff Kachinske
Caveat: my opinions. I am not a spokesperson for Web2py. That said: 1. No. MVC provides separation of functions as a way of organizing code. Usually programmers work together with designers, and MVC provides a way for them to interact without too much stepping on each other's toes. Typica

[web2py] Re: load deletes the values of submit-buttons

2012-07-23 Thread Anthony
This is not specific to the LOAD() helper but a limitation of the jQuery serialize() method used to post form data via Ajax. See https://groups.google.com/d/msg/web2py/708hxAdDGKY/2bNwbQVXc04J (includes link to possible workaround). Anthony On Monday, July 23, 2012 3:48:56 PM UTC-4, mweissen w

[web2py] Re: validate_and_insert() question

2012-07-23 Thread Niphlod
If you can't understand the code, just try it: web2py.py -M -S mytestapp db.define_table( 'tests', Field('uniquefield', unique=True), Field('withvalidator', requires=IS_NOT_IN_DB(db, 'tests.withvalidator')) ) >>> ret = db.tests.validate_and_insert(uniquefield='a', withvalidator='b') >

[web2py] Re: Confused re. "Validators in model not good MVC"

2012-07-23 Thread Anthony
In a previous edition of the book, that view example included the following: {{=db().select(db.person.ALL)}} I believe the note was referring to that usage of the db object in the view. I have removed the note, as the view has been updated since then and no longer refers directly to the db obje

Re: [web2py] Unit Testing Database Best Practices

2012-07-23 Thread Richard Vézina
I know it is not exactly what you want, but there is this tutorial for TDD and web2py : http://killer-web-development.com/section/4/3 Richard On Mon, Jul 23, 2012 at 3:13 PM, Martín Mulone wrote: > I'm following http://www.web2py.com/AlterEgo/default/show/260 >> > > that guide is too old, have

Re: [web2py] Logic check in View, to check if auth.user.group_id...

2012-07-23 Thread Alec Taylor
Yes I do. I have also tried with a bunch of other permutations. Reading through the `Auth` reference, I found a few useful functions, most helpful being: {{=auth._get_user_id()}} Using that I will be able to query the db, but will need to put the reference on the group side rather than the user

[web2py] Pagination with no database

2012-07-23 Thread adohertyd
I have an application that returns a list of between 50-100 items. I have no database layer it isn't required for my app. I want to display 10 of those items on a page, and only generate the number of pages needed to view those results. Can anyone point me in the right direction (not the docs,

Re: [web2py] Unit Testing Database Best Practices

2012-07-23 Thread Richard Vézina
http://ncdegroot.blogspot.ca/2011/09/web2py-automate-unittesting-doctesting.html http://www.web2pyslices.com/slice/show/1392/unit-testing On Mon, Jul 23, 2012 at 4:17 PM, Richard Vézina wrote: > I know it is not exactly what you want, but there is this tutorial for TDD > and web2py : > > http:/

[web2py] Re: validate_and_insert() question

2012-07-23 Thread Niphlod
With that statement ("""if you don't understand the code, try it""") I meant that you can always check a functionality testing it before loosing your mind on the code. All the "magic" is done by: gluon/dal.py (validate_and_insert()) ... for key,value in fields.items(): value,error

Re: [web2py] Logic check in View, to check if auth.user.group_id...

2012-07-23 Thread Anthony
Have you tried: {{if thisgroupid in auth.user.member_of:}} Once the user is logged in, auth.user contains the user record from the auth_user table, so auth.user.member_of should be the list of group_of_events id's for the logged in user. Anthony On Monday, July 23, 2012 4:20:36 PM UTC-4, Alec

[web2py] Re: Documentation nit

2012-07-23 Thread Anthony
Thanks. Fixed. On Monday, July 23, 2012 3:13:00 PM UTC-4, MichaelF wrote: > > The last sentence of section 6.17 says, "Yes this is unusual and not > rarely needed." It should read something like, "Yes this is unusual and > rarely needed," or "Yes this is unusual and not often needed." --

[web2py] Re: Pagination with no database

2012-07-23 Thread Niphlod
That's math! e.g. records_per_page = 10 records all_records = 137 records pages_needed = all_records / records_per_page (division) last_page = all_records % records_per_page (module) that is 13 "full pages" + 1 page with 7 records. So, you'll have to count the total of your records, divide it by

Re: [web2py] None ?

2012-07-23 Thread Ashraf Mansour
Right, there was no return statement. Thank you, nice community. Ashraf --

[web2py] Re: How to hide items in Production?

2012-07-23 Thread Anthony
Maybe: {{if auth.user and auth.has_membership(role='admin'):}}{{=response.toolbar ()}}{{pass}} Anthony On Monday, July 23, 2012 12:51:18 PM UTC-4, lyn2py wrote: > > Thank you both. It works. > If I want to keep the response toolbar available to the logged in admin, > how should I perform the I

[web2py] Re: Pagination with no database

2012-07-23 Thread adohertyd
Thank you for that makes perfect sense. This might be a stupid question but do I need to create an individual HTML page for each result set? The whole pagination thing is a mystery to me! On Monday, 23 July 2012 21:33:34 UTC+1, Niphlod wrote: > > That's math! > e.g. > records_per_page = 10 recor

[web2py] Re: Confused re. "Validators in model not good MVC"

2012-07-23 Thread Massimo Di Pierro
Anthony is right. That comment makes little sense in that context. On Monday, 23 July 2012 15:16:29 UTC-5, Anthony wrote: > > In a previous edition of the book, that view example included the > following: > > {{=db().select(db.person.ALL)}} > > I believe the note was referring to that usage of th

[web2py] Re: Confused re. "Validators in model not good MVC"

2012-07-23 Thread MichaelF
My thoughts exactly, hence my confusion with the highlighted sentence. As explained by Anthony in another reply, that sentence was let over from a previous version of the doc. I like the idea of putting validators in the model, assuming they are valid throughout the app (which makes sense). Tha

[web2py] Empty Database value is not None, but an empty string

2012-07-23 Thread Mark Li
I have a table defined in the following manner: db.define_table('songinfo', Field('songtitle'), Field('artist')) When I add an empty entry, or upload a CSV with empty values, I can only access those values with a database call like songs = db(db.songinfo.artist=="").select() as opposed to db(d

[web2py] Re: Empty Database value is not None, but an empty string

2012-07-23 Thread Anthony
default=None means that no default is specified, not that a default value of None will be inserted. Anthony On Monday, July 23, 2012 5:02:33 PM UTC-4, Mark Li wrote: > > I have a table defined in the following manner: > > db.define_table('songinfo', > Field('songtitle'), > Field('artist')) > > W

[web2py] Re: Empty Database value is not None, but an empty string

2012-07-23 Thread Anthony
To enter a value of None, this might work: default=lambda: None Anthony On Monday, July 23, 2012 5:04:44 PM UTC-4, Anthony wrote: > > default=None means that no default is specified, not that a default value > of None will be inserted. > > Anthony > > On Monday, July 23, 2012 5:02:33 PM UTC-4,

[web2py] Re: SQLFORM.grid pagination refresh

2012-07-23 Thread dave
the problem is whatever I do, the clicking the pagination triggers a whole page refresh, the links are not trapped, This describes the problem Trapped Ajax links A Ajax links Normally a link is not trapped, and by clicking in a link inside a component, the entire linked page is loaded. Someti

[web2py] Re: Empty Database value is not None, but an empty string

2012-07-23 Thread Mark Li
Unfortunately the lambda method didn't work, Anthony. Any other ideas for having a None default for empty entries? On a side note, if the 'integer' field type is used, then a blank entry results in a None. Don't know if that helps but it's something I've noticed. On Monday, July 23, 2012 2:07:

[web2py] Auth has no attribute signature

2012-07-23 Thread David
I just upgraded my web2py to latest trunk. I get an exception S'("\'Auth\' object has no attribute \'signature\'",)' did something change. I tried the mailing list archive to see, but maybe I missed something. Thanks. --

Re: [web2py] Re: Empty Database value is not None, but an empty string

2012-07-23 Thread vinicius...@gmail.com
As far as I know, let "notnull=False" and "required=False" for your fields and don't set "default" property. On 07/23/2012 06:32 PM, Mark Li wrote: Unfortunately the lambda method didn't work, Anthony. Any other ideas for having a None default for empty entries? On a side note, if the 'inte

[web2py] weird behavior in crud update

2012-07-23 Thread Najtsirk
Hi, each time i want to update crud, i have to submit changes twice to get it actually updated. I set crud.settings.detect_record_change = False, which helps with 'text' fields, but the problem presists with 'boolean'. Boolean field get changed each time i update form, even though I do not cha

Re: [web2py] Re: Empty Database value is not None, but an empty string

2012-07-23 Thread Mark Li
Aren't those the default values for a Field Contructor? I tried explicitly adding "notnull=False" and "required=False", and didn't set the default property, but empty values still come out as an empty string instead of None. On Monday, July 23, 2012 2:48:56 PM UTC-7, viniciusban wrote: > > As f

[web2py] Re: Pagination with no database

2012-07-23 Thread Niphlod
Usually you have some means to "order" the records (e.g., a "id" field that is 1,2,3,4,5, a "name" field that is a,b,c,d, an inserted_on datetime field that is 2012-07-23m, 2012-07-24, etc etc etc). When the order of the records is established in a list: all_records = ['a','b','c','d',...]

Re: [web2py] Re: Multi-tenant social-network?

2012-07-23 Thread Cliff Kachinske
> Separate DBs sounds messy. Some elaboration on that point. Methinks you will lose the advantage of connection pooling. Every request will need its own connection, and performance will suffer. How will you avoid duplicate db names? You will need a central repository, which probably should b

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

2012-07-23 Thread howesc
are you explicitly setting the redirect_uri for the FB call? you should beand then you can control it to be what you want it to be. how you set it depends on exactly which version of the FB APIs you are using, but it's been a config option in most of the calls i have ever done. On Monday,

[web2py] Select Distinct for more than 1 distinct value

2012-07-23 Thread Mark Li
I have a database setup with id and 'dogname.' I would like to retrieve distinct values of dogname, but allow for 2 of each dogname. So instead of limiting it to one distinct value, there could be 2 identical dognames that are retrieved, but no more than that. Is there a way to set this kind of

[web2py] Re: Select Distinct for more than 1 distinct value

2012-07-23 Thread villas
I can't see how distinct would help there because it only returns unique rows. I would say that the main question is how much data you have. I mean, it is probably easier to grab all the data and then discard (or simply loop over) the data you do not need. However, if you have a huge number

[web2py] Re: Select Distinct for more than 1 distinct value

2012-07-23 Thread Mark Li
I'll be looping over them for now, is there anyway to use a query or select() to return a set with no more than 2 of each name? On Monday, July 23, 2012 3:43:38 PM UTC-7, villas wrote: > > I can't see how distinct would help there because it only returns unique > rows. > > I would say that the m

Re: [web2py] Re: Multi-tenant social-network?

2012-07-23 Thread pbreit
On Monday, July 23, 2012 3:01:40 PM UTC-7, Cliff Kachinske wrote: > > > Separate DBs sounds messy. > > Some elaboration on that point. > Everything that is simple to do on one DB becomes complicated to do on multiple DBs. For example, I run a multi-tenant site that I constantly run queries again

[web2py] Re: bootstrap and user panel

2012-07-23 Thread juaneduardo
Great Martin... I will test right now. El lunes, 23 de julio de 2012 20:02:47 UTC-4, Martin.Mulone escribió: > > I want to share this two applications* > > Bootstrap welcome application* > > I made my own welcome scatfold app, using twitter bootstrap template. My > version is more like from the e

[web2py] Re: SQLFORM.grid pagination refresh

2012-07-23 Thread Anthony
I see. I was responding to your request for filtering (e.g., showing only 50 records). If you put the grid in a web2py component (e.g., via LOAD()), then the links should automatically get trapped. Is there a reason you don't want to use a component? Anthony On Monday, July 23, 2012 5:09:52 PM

Re: [web2py] Re: new plugin - web2py Form Wizard - PowerFormWizard

2012-07-23 Thread Don_X
Bruno Rocha, This is a very nice plugin ! ... very useful, thanks for sharing ! I have to create 2 registrations methods ( one short and one long method to register ) I have one problem, how would you suggest to user the wizard when there are 3 tables involved in the long signup method ?? for

Re: [web2py] Re: new plugin - web2py Form Wizard - PowerFormWizard

2012-07-23 Thread Bruno Rocha
Also, there is a nice example in the "web2py cookbook" Source code is here: https://github.com/mdipierro/web2py-recipes-source/tree/master/source/04_advanced_forms/06_Creating_a_Form_Wizard App is here: https://github.com/mdipierro/web2py-recipes-source/blob/master/apps/04_advanced_forms/web2py

Re: [web2py] Unit Testing Database Best Practices

2012-07-23 Thread Mark Li
Regarding Martin's response for anyone who is learning the ropes like me, I removed the execfile() line and placed my unit_test.py script in the module folder. On Monday, July 23, 2012 12:13:07 PM UTC-7, Martin.Mulone wrote: > > I'm following http://www.web2py.com/AlterEgo/default/show/260 >> >

Re: [web2py] Re: new plugin - web2py Form Wizard - PowerFormWizard

2012-07-23 Thread Bruno Rocha
fixed link for app: https://github.com/mdipierro/web2py-recipes-source/raw/master/apps/04_advanced_forms/web2py.app.form_wizard.w2p --

[web2py] displacement of password button [web2py twitter bootstrap]

2012-07-23 Thread Kevin Miller
Hi all, Anyone knows why the password button is displaced by the welcome message when using twitter bootstrap and Nightly Build? I have attached a picture as example. Thanks. Kevin -- <>

[web2py] Re: How to hide items in Production?

2012-07-23 Thread lyn2py
Thanks Anthony, I meant the web2py admin login, rather than the per-site login. On Tuesday, July 24, 2012 4:34:58 AM UTC+8, Anthony wrote: > > Maybe: > > {{if auth.user and auth.has_membership(role='admin'):}}{{=response.toolbar > ()}}{{pass}} > > Anthony > > On Monday, July 23, 2012 12:51:18 P

[web2py] Re: Auth has no attribute signature

2012-07-23 Thread Massimo Di Pierro
Yes. auth.signature used to be defined when Auth() is instantiated. Now it is defined when auth.define_tables() is called. There is disagreement on whether this is a breaking of backward compatibility since this is not exactly documented. There are reason for the switch. Is this a big deal? It

[web2py] Re: weird behavior in crud update

2012-07-23 Thread Massimo Di Pierro
Please do not use crud. It is not needed any more. You can do everything and better with SQLFORM().process(). We are not going to change the behavior of curd now that we have a more powerful tool (SQLFORM). On Monday, 23 July 2012 16:55:49 UTC-5, Najtsirk wrote: > > Hi, > > each time i want to u

[web2py] Re: bootstrap and user panel

2012-07-23 Thread Massimo Di Pierro
This looks great. Are you proposing it as a replacement for the current welcome? pros? cons? On Monday, 23 July 2012 19:02:47 UTC-5, Martin.Mulone wrote: > > I want to share this two applications* > > Bootstrap welcome application* > > I made my own welcome scatfold app, using twitter bootstrap t

Re: [web2py] Re: new plugin - web2py Form Wizard - PowerFormWizard

2012-07-23 Thread Don_X
Bruno, I did follow these examples already ... I tried different things ... different approaches ... but for 3 tables it seems not do-able ! I am still searching for ways for it to be done ! .. so far .. no luck ! ... I tried using the method with 3 tables like this ( by combining the method de

Re: [web2py] Re: Empty Database value is not None, but an empty string

2012-07-23 Thread Anthony
>From the code, it looks like doing an insert without specifying a field should result in a NULL, not an empty string. However, I think a CSV file with empty fields is handled differently. The .import_from_csv_file() method takes a "null" argument that defaults to "" -- so, I think if the CSV f

[web2py] Re: weird behavior in crud update

2012-07-23 Thread Anthony
Should we mark Crud as deprecated in the book? On Monday, July 23, 2012 11:55:14 PM UTC-4, Massimo Di Pierro wrote: > > Please do not use crud. It is not needed any more. You can do everything > and better with SQLFORM().process(). > We are not going to change the behavior of curd now that we hav

Re: [web2py] Re: Auth has no attribute signature

2012-07-23 Thread David
Ok. I am not going to complain about it because I fixed the app, However, I did see it in the docs. if you search the docs for auth.signature it shows the usage. But here is where it broke..I had a custom auth table, and in that table I called db.define_table( auth.settings.table_user_

Re: [web2py] Re: Empty Database value is not None, but an empty string

2012-07-23 Thread vinicius...@gmail.com
Yes, they are default settings. It's quite strange you get empty strings instead null (None, in Python). How are you inserting data into db? Are you using a SQLFORM or my_table.validate_and_insert() or simply mytable.insert()? Do you get same results (blank values) inserting it from web2py sh

[web2py] Re: bootstrap and user panel

2012-07-23 Thread murtaza52
Hello Martin, The CSS is cool so +1 for this. 1) I cloned your welcome app repo and placed it under applications, this is the summary of the error I get when I browse to the app - 127.0.0.1.2012-07-24.11-12-36.3a36305c-435d-4087-ab03-e427b4e00812 table auth_user already exists 2) Below is t

Re: [web2py] Logic check in View, to check if auth.user.group_id...

2012-07-23 Thread Alec Taylor
Thanks, that worked. I think the problem was I wasn't using `auth.user` but `auth_user`. Full working example: {{if auth.is_logged_in():}}{{if group[0].id in auth.user.member_of:}}{{=T('Welcome back Mr member!')}}{{else:}}{{=T('Become a member today')}}{{pass}}{{pass}} On Tue, Jul 24, 2012 at 6: