[web2py] Use web2py as a reverse proxy

2018-02-12 Thread LoveWeb2py
Django has a reverse proxy module... Wondering if web2py has something 
similar?
https://djangopackages.org/grids/g/reverse-proxy/

I want to make web2py the single interface to multiple applications.

Any help is appreciated :)

-- 
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 message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] PYTHON 3

2018-02-12 Thread LoveWeb2py
With that said, Thank you for all of your hard work and to all the 
contributors for making such a wonderful framework. :)

On Monday, February 12, 2018 at 3:58:30 PM UTC-5, LoveWeb2py wrote:
>
> Makes sense, Anthony. Please don't ever call anything web3py. It doesn't 
> make any sense and all new users won't understand what it means. If you 
> want to have a brainstorming session I'd be happy to help. I bet all the 
> users on this forum have a lot of great ideas!!
>
> On Monday, February 12, 2018 at 3:44:13 PM UTC-5, Anthony wrote:
>>
>> On Sunday, February 11, 2018 at 4:10:45 PM UTC-5, Carlos Cesar Caballero 
>> wrote:
>>>
>>>
>>> > PS: For the love of all that's holy,  please don't name it web3py. 
>>>
>>
>> The name "web3py" was just a placeholder name for a completely new 
>> framework -- it was not intended to be the name for web2py with Python 3 
>> support.
>>
>> Anthony
>>
>

-- 
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 message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] PYTHON 3

2018-02-12 Thread LoveWeb2py
Makes sense, Anthony. Please don't ever call anything web3py. It doesn't 
make any sense and all new users won't understand what it means. If you 
want to have a brainstorming session I'd be happy to help. I bet all the 
users on this forum have a lot of great ideas!!

On Monday, February 12, 2018 at 3:44:13 PM UTC-5, Anthony wrote:
>
> On Sunday, February 11, 2018 at 4:10:45 PM UTC-5, Carlos Cesar Caballero 
> wrote:
>>
>>
>> > PS: For the love of all that's holy,  please don't name it web3py. 
>>
>
> The name "web3py" was just a placeholder name for a completely new 
> framework -- it was not intended to be the name for web2py with Python 3 
> support.
>
> Anthony
>

-- 
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 message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] PYTHON 3

2018-02-12 Thread Anthony
On Sunday, February 11, 2018 at 4:10:45 PM UTC-5, Carlos Cesar Caballero 
wrote:
>
>
> > PS: For the love of all that's holy,  please don't name it web3py. 
>

The name "web3py" was just a placeholder name for a completely new 
framework -- it was not intended to be the name for web2py with Python 3 
support.

Anthony

-- 
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 message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Just a silly thread to say... thanks to all web2py developers team

2018-02-12 Thread nethugolol
I couldn't agree more. web2py is an excellent web framework. I always use 
it for both personal and business stuff.

Thanks a lot Massimo and all the contributors! I promise I will be 
contributing in everything I can.

El viernes, 9 de febrero de 2018, 6:42:10 (UTC-3), Jaime Sempere escribió:
>
> Hi,
>
> this is gonna sound a littile silly, but I have been wanting to publish a 
> thread like this from years ago.
>
> I just wanna say to Massimo and all the web2py developers one thing: 
> thanks. Thanks a lot.
>
> I love web2py and I enjoy programming and developing with it.
>
> I can notice all the effort and all the work you have made to create a 
> super simple, easy, fun, and good programmed framework like web2py.
>
> Everytime I need to develop a new personal project, I always choose web2py 
> if I can.
>
> I see magic and simplicity in every aspect of web2py. I could not imagine 
> a quicker framework than web2py.
>
> And everytime I need to do something new, when I look to the book, I 
> always find a very easy and simple way to do it. And that's something I 
> love: I find that you have worked a lot to build something simple and 
> powerful. Programming should be like that: simple, non verbose, and fun. 
> Like 'just focus  on the logic and forget about verbose, and extra code, or 
> anything too complicated'... keep it simple, stupid!
>
> And the integrations that you have made possible with GAE or Heroku... oh 
> come on, someone gives these guys a medal!
>
> Or any time that I need to make a customization, or touch anything from 
> the core, I always think to myself: 'this is perfectly programmed, this is 
> exactly how I would develop it', it is like web2py read my mind or if it 
> had same way of thinking as me.
>
> I find magic and roids in every aspect of web2py.
>
> And by the way, vim and web2py make a wonderful team. I feel like a super 
> fanatic boy of both of them...
>
> Well I do not know if this sounds too foolish, but I just want to say to 
> all the members that made and make web2py a solid framework that: thanks, 
> my respects and keep making this framework a reality.
>
> Plus, this group is wonderful support.
>
> Well, that's enough, maybe this can sound awkward or a typical fan-boy 
> thread... but for a last time, thanks to all of you.
>
> Jaime
>

-- 
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 message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: postgres not making new table in model

2018-02-12 Thread Anthony
You don't want fake_migrate_all=True if you want to do a real migration -- 
that instead does a fake migration of all tables, meaning it generates the 
*.table metadata files in the /databases folder but does not actually do 
anything to the database. So, get rid of the *.table file of the table you 
want to create, make sure you do not have fake_migrate_all=True, and then 
run a request and the migration will happen.

Anthony

On Monday, February 12, 2018 at 2:50:06 PM UTC-5, Jordan Ladora wrote:
>
> I've got a postgres server running which has been working fine the last 
> month or so with no issues. 
>
> I just added a new table in a model but cannot get the migration to work. 
> Everything was updated correctly in the databases folder after doing this, 
> and I've got 
>
> migrate=True
>
> ...in all my table declarations and 
>
> migrate=True
> fake_migrate_all=True
>
> ...in my DAL string. 
>
> I tried trashing all the files in the databases folder (which were 
> recreated properly by w2p, including making a new one for the new table), 
> restarting postgres, and turning migrate and fake_migrate_all to either 
> True or False. But I kept getting tickets with 'relation  does 
> not exist' when trying to do an insert. Listing all the tables in postgres 
> does not show the new table, so I'm thinking I'm probably missing something 
> in a model. 
>
> Thanks for any suggestions,
> -jl
>
>

-- 
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 message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] postgres not making new table in model

2018-02-12 Thread Jordan Ladora
I've got a postgres server running which has been working fine the last 
month or so with no issues. 

I just added a new table in a model but cannot get the migration to work. 
Everything was updated correctly in the databases folder after doing this, 
and I've got 

migrate=True

...in all my table declarations and 

migrate=True
fake_migrate_all=True

...in my DAL string. 

I tried trashing all the files in the databases folder (which were 
recreated properly by w2p, including making a new one for the new table), 
restarting postgres, and turning migrate and fake_migrate_all to either 
True or False. But I kept getting tickets with 'relation  does 
not exist' when trying to do an insert. Listing all the tables in postgres 
does not show the new table, so I'm thinking I'm probably missing something 
in a model. 

Thanks for any suggestions,
-jl

-- 
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 message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Convert languages.lazyT object to string

2018-02-12 Thread Jordan Ladora
Thank you both for your help and patience with this. Oversight on my part-- 

I was mistaken by the ticket thrown - the first ticket I got when running 
this was for the 'message' (which i tried to cast to string to fix it 
before i posted here) param in the email, but then after that i was getting 
very similar tickets for other fields, at least some of which were still 
lazyT (e.g. subject). So, i'd actually begun to fix the problem by casting 
to str() as you both suggested, but kept throwing tickets and didn't look 
at those additional tickets closely enough to realize that i'd already 
begun to fix the problem.. :0  Then i started messing around in the console 
and posted here about those errors, too. 

Bottom line - problems went away by casting the lazyT to str() like you 
recommended. :)



On Thursday, February 8, 2018 at 6:37:37 PM UTC-7, Anthony wrote:
>
> On Thursday, February 8, 2018 at 2:49:52 PM UTC-5, Jordan Ladora wrote:
>>
>> Trying to get this to work but not getting anywhere-
>>
>> *from gluon import languages  # EDITED from '*
>>
>> *from gluon import *'abc = languages.lazyT("abc")*
>>
>
> The lazyT class takes a "T" argument, which should be in instance of the 
> "translator" class.
>  
>
>> I have a library that expects a basestring object but w2p in that context 
>> returns a lazyT (this is for password reset using a commercial service as a 
>> mailer). Specifically, this is gluon/tools.py line 3637 - the 'message' 
>> param is a lazyT object and I need a string.
>>
>
> auth.messages is an instance of gluon.storage.Messages -- when you 
> retrieve an attribute, it passes the value to current.T, which yields the 
> lazyT object. You can simply pass the value to str() to convert it to the 
> translated string.
>
> Anthony
>

-- 
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 message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: query to match if boolean field is not True

2018-02-12 Thread David Zejda

On Sunday, 11 February 2018 05:52:44 UTC+1, Massimo Di Pierro wrote:
>
> I would expect that too but it is not a web2py issue. It is a database 
> issue. web2py simply translate those in
>

Hi Massimo, thank you for explanation!

David

-- 
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 message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Help with cascading drop down list

2018-02-12 Thread 'Matthew J Watts' via web2py-users
Can anyone point me in the right direction with this, any good tutorial out 
there on how i can integrate java and web2py? 

On Friday, February 9, 2018 at 12:05:32 PM UTC+1, Matthew J Watts wrote:
>
> Thanks for your reponse David!
>
> On Thursday, February 8, 2018 at 8:56:19 PM UTC+1, Dave S wrote:
>>
>>
>>
>> On Thursday, February 8, 2018 at 9:55:25 AM UTC-8, Matthew J Watts wrote:
>>>
>>> Hi community
>>>
>>> I'm having a few problems trying to understand how create a cascading 
>>> drop down list. I've followed this recipe -
>>>
>>>
>>> http://www.web2pyslices.com/slice/show/1526/cascading-drop-down-lists-with-ajax-2
>>>
>>> i've managed to adapt it slightly, but i'm having trouble trying to add 
>>> more tables to the cascade/sequence 
>>>
>>
>> I'm not much of a menu person (I make use of ordinary anchor links for 
>> the most part), but that example was probably written when BootStrap2 was 
>> the css/javascript in use.  Currently,  web2py ships with BootStrap3, which 
>> doesn't support more than 1 level of submenus.  If you use stupid.css (as 
>> in applications/example), you might not have that limitation, but I can't 
>> show you what you want.
>>
>>
>>> It is quite difficult for me (a beginner) to suss out the logic behind it
>>>
>>>
>> Menus typically control what is shown by using javascript to manipulate 
>> CSS.  Simple menus may be CSS only, but then they'd be statically defined.  
>>
>> Good luck!
>>
>> /dps
>>
>>  
>>
>>> So at the moment i have the code below, what i'm trying to do is return 
>>> a list of values from  the "tax_class" table, based  on a selection 
>>> from the "tax_phylum" table( based on sececting an entry  from the 
>>> kingdom table)
>>>
>>> *model*
>>>
>>> db.define_table('tax_kingdom',
>>> Field('name'))
>>>
>>> db.define_table('tax_phylum',
>>> Field('name', 'string'),
>>> Field('kingdom_id'))
>>> db.tax_phylum.kingdom_id.requires = IS_IN_DB(db, db.tax_kingdom.id, 
>>> '%(name)s')
>>>
>>> db.define_table('tax_class',
>>> Field('name', 'string'),
>>> Field('phylum_id'))
>>> db.tax_class.phylum_id.requires = IS_IN_DB(db, db.tax_phylum.id, '%(name)s')
>>>
>>>
>>> *Controller*
>>>
>>> def index():
>>> kingdoms = db().select(db.tax_kingdom.ALL)
>>>
>>> if request.vars.kingdom_name:
>>> phylum_select = db(db.tax_phylum.id == 
>>> request.vars.kingdom_name).select(db.tax_phylum.ALL)
>>> else:
>>> phylum_select = db(db.tax_phylum.id == 1).select(db.tax_phylum.ALL)
>>> return dict(kingdoms=kingdoms, phylum_select=phylum_select)
>>>
>>>
>>> def phylum():
>>> phylums = db(db.tax_phylum.kingdom_id == 
>>> request.vars.kingdom_name).select(db.tax_phylum.ALL)
>>> result = ""
>>> for p in phylums:
>>> result += "" + p.name + 
>>> ""
>>> return XML(result)
>>>
>>>
>>>
>>> *view*
>>>
>>>
>>>
>>> {{extend 'layout.html'}}
>>>
>>> 
>>> >> onchange="jQuery('#kingdom_name').empty();
>>> ajax('phylum', ['kingdom_name'], 'phylum_name');">
>>> {{for kingdom in kingdoms:}}
>>> >> {{=" selected='selected'" if 
>>> str(kingdom.id)==request.vars.kingdom_name else ""}}>
>>> {{=kingdom.name}}
>>> 
>>> {{pass}}
>>> 
>>>
>>>
>>> 
>>> 
>>> {{for phylum in phylum_select:}}
>>> >> {{=XML(" selected='selected'") if 
>>> str(phylum.id)==request.vars.phylum_name else ""}}>
>>> {{=phylum.name}}
>>> {{pass}}
>>> 
>>>
>>>
>>> 
>>>
>>>

-- 
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 message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] grid: top + button: how to adapt dynamically & translate the title 'add record to database' ?

2018-02-12 Thread Serge Bourgeois

Hello,
The following codes changes dynamically the title of the button on the top 
left of the form in English.
But when I switch to another language (exemple FR), I get the French 
translation of 'Add record to database', and not the translation of what I 
have placed in the title of this button.

Example:
   
form = SQLFOR.smartgrid(db[my_table]..., showbuttontext=False, ...)

if not 'view' in request.args and not 'edit' in request.args and not 
'new' in request.args:
   addbutton = form.element(_title='Add record to database')
   my_table = 'my application table'
   addbutton['_title'] = '%s %s' % ( T('Add'), db[my_table]._singular 
return dict(form = form)
=> in English, the title of the + button is 'Add' + the value of 
db[my_table]._singular : This is perfect!
=> in French, I always get 'Ajout d'un enregistrement', which is the 
translation of 'Add record to database'. : this is not what I want...

I have tried the following, but, same result:
   if not 'view' in request.args and not 'edit' in request.args and not 
'new' in request.args:
   my_title = T('Add record to database)'
   addbutton = form.element(_title= my_title)
   my_table = 'my application table'
   addbutton['_title'] = '%s %s' % ( T('Add'), db[my_table]._singular 
return dict(form = form)

Thanks for any advise for translating the title of the top left '+' button 
when I change if in the controller.

-- 
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 message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.