Re: [web2py] Re: Is this possible?

2012-01-13 Thread Anthony
Thanks for sharing. That's good to know.

On Friday, January 13, 2012 11:32:55 PM UTC-5, Detectedstealth wrote:
>
> Well as a test I got my new designer to try using web2py without any help 
> from me, he was successful so that was one bonus point.
>
> Second if you were to look at the code base from 4 developers which 2 had 
> python background, one PHP, and the other Java, you can imagine how bad the 
> code is running the site.
>
> So the primary reason is pyramid gives you to much freedom, and forces you 
> to do way to much manual work yourself. The freedom is good when everyone 
> on the team is VERY strong with python, however it causes more problems 
> when trying to teach someone and launch a product at the same time. Oh and 
> I forgot my main pet pev with pyramid is it has way to many dependences on 
> 3rd party packages, making it very hard to track down bugs.
>
> Finally, since the company launched it is been brining in a lot of money 
> and has to many feature requests to continue reinventing the wheel with 
> pyramid (IE: spending to much time developing things web2py already has) We 
> needed more security, a faster development cycle, easier 
> internationalization support, and tools that allow designers to work faster.
>
> Don't get my wrong I have projects I have developed running on pyramid 
> (invoicing system), and django (dating site, personal journalling app where 
> daily journal entries are encrypted)  that are clean and easy to work 
> with etc... However, my projects are getting bigger and more demanding, so 
> far I am liking web2py more then django and pyramid.
>
> I am also developing a fitness application using web2py I will post a link 
> once we get the new brochure up and running.
>
> On Fri, Jan 13, 2012 at 8:14 PM, Anthony  wrote:
>
>> Glad it worked. Out of curiosity, what prompted you to move from Pyramid 
>> to web2py for this app?
>>
>>
>> On Friday, January 13, 2012 10:59:43 PM UTC-5, Detectedstealth wrote:
>>
>>> Thank you Anthony,
>>>
>>> That works exactly how I was want. I didn't even think to use 
>>> request.vars. Just trying to see how many different ways this is going to 
>>> save my team development time.
>>>
>>> We are moving youadworld.com from pyramid to web2py here is the start 
>>> so far if you are interested in watching the progress: 
>>> http://176.34.12.39/
>>>
>>> NOTE: There will be LOTS of changes and the database will be deleted and 
>>> rebuilt often over the next few months. youadworld.com however is live 
>>> and free to register to see what the current functionality is, and will be 
>>> in the new version with web2py.
>>>
>>> On Fri, Jan 13, 2012 at 2:47 PM, Anthony  wrote:
>>>
 db.define_table('user_account',
> 
> )
> db.define_table('distributors',
> Field('account_id', db.user_account),
> Field('uadpoints_balance_**avail**able', 'integer', default=0),
> )
> db.define_table('ads',
> Field('member_id', db.user_account),
> Field('points', 'integer', default=0),
> )
> db.ads.points.requires = IS_INT_IN_RANGE(0, 
> db(db.distributors.account_id==db.ads.member_id).select()[0]
> .uadpoints_balance_available)
>

 If 'ads' records will be added via form submission, then you might try:

 db.ads.points.requires = IS_INT_IN_RANGE(0,
 db(db.distributors.account_id==request.vars.member_id).**
 select().first()**.uadpoints_**balance_available)

 You might want to set this in the form controller only when 
 request.vars is not empty to avoid unnecessary db hits.

 Anthony


>>>
>>>
>>> -- 
>>> -- 
>>> Regards,
>>> Bruce Wade
>>> http://ca.linkedin.com/in/**brucelwade
>>> http://www.wadecybertech.com
>>> http://www.warplydesigned.com
>>> http://www.**fitnessfriendsfinder.com
>>>  
>>
>
>
> -- 
> -- 
> Regards,
> Bruce Wade
> http://ca.linkedin.com/in/brucelwade
> http://www.wadecybertech.com
> http://www.warplydesigned.com
> http://www.fitnessfriendsfinder.com
>  


Re: [web2py] Re: Is this possible?

2012-01-13 Thread Bruce Wade
Well as a test I got my new designer to try using web2py without any help
from me, he was successful so that was one bonus point.

Second if you were to look at the code base from 4 developers which 2 had
python background, one PHP, and the other Java, you can imagine how bad the
code is running the site.

So the primary reason is pyramid gives you to much freedom, and forces you
to do way to much manual work yourself. The freedom is good when everyone
on the team is VERY strong with python, however it causes more problems
when trying to teach someone and launch a product at the same time. Oh and
I forgot my main pet pev with pyramid is it has way to many dependences on
3rd party packages, making it very hard to track down bugs.

Finally, since the company launched it is been brining in a lot of money
and has to many feature requests to continue reinventing the wheel with
pyramid (IE: spending to much time developing things web2py already has) We
needed more security, a faster development cycle, easier
internationalization support, and tools that allow designers to work faster.

Don't get my wrong I have projects I have developed running on pyramid
(invoicing system), and django (dating site, personal journalling app where
daily journal entries are encrypted)  that are clean and easy to work
with etc... However, my projects are getting bigger and more demanding, so
far I am liking web2py more then django and pyramid.

I am also developing a fitness application using web2py I will post a link
once we get the new brochure up and running.

On Fri, Jan 13, 2012 at 8:14 PM, Anthony  wrote:

> Glad it worked. Out of curiosity, what prompted you to move from Pyramid
> to web2py for this app?
>
>
> On Friday, January 13, 2012 10:59:43 PM UTC-5, Detectedstealth wrote:
>
>> Thank you Anthony,
>>
>> That works exactly how I was want. I didn't even think to use
>> request.vars. Just trying to see how many different ways this is going to
>> save my team development time.
>>
>> We are moving youadworld.com from pyramid to web2py here is the start so
>> far if you are interested in watching the progress: http://176.34.12.39/
>>
>> NOTE: There will be LOTS of changes and the database will be deleted and
>> rebuilt often over the next few months. youadworld.com however is live
>> and free to register to see what the current functionality is, and will be
>> in the new version with web2py.
>>
>> On Fri, Jan 13, 2012 at 2:47 PM, Anthony  wrote:
>>
>>> db.define_table('user_account',
 
 )
 db.define_table('distributors',
 Field('account_id', db.user_account),
 Field('uadpoints_balance_**avail**able', 'integer', default=0),
 )
 db.define_table('ads',
 Field('member_id', db.user_account),
 Field('points', 'integer', default=0),
 )
 db.ads.points.requires = IS_INT_IN_RANGE(0,
 db(db.distributors.account_id==db.ads.member_id).select()[0]
 .uadpoints_balance_available)

>>>
>>> If 'ads' records will be added via form submission, then you might try:
>>>
>>> db.ads.points.requires = IS_INT_IN_RANGE(0,
>>> db(db.distributors.account_id==request.vars.member_id).**
>>> select().first()**.uadpoints_**balance_available)
>>>
>>> You might want to set this in the form controller only when request.vars
>>> is not empty to avoid unnecessary db hits.
>>>
>>> Anthony
>>>
>>>
>>
>>
>> --
>> --
>> Regards,
>> Bruce Wade
>> http://ca.linkedin.com/in/**brucelwade
>> http://www.wadecybertech.com
>> http://www.warplydesigned.com
>> http://www.**fitnessfriendsfinder.com
>>
>


-- 
-- 
Regards,
Bruce Wade
http://ca.linkedin.com/in/brucelwade
http://www.wadecybertech.com
http://www.warplydesigned.com
http://www.fitnessfriendsfinder.com


Re: [web2py] Re: Is this possible?

2012-01-13 Thread Anthony
Glad it worked. Out of curiosity, what prompted you to move from Pyramid to 
web2py for this app?

On Friday, January 13, 2012 10:59:43 PM UTC-5, Detectedstealth wrote:
>
> Thank you Anthony,
>
> That works exactly how I was want. I didn't even think to use 
> request.vars. Just trying to see how many different ways this is going to 
> save my team development time.
>
> We are moving youadworld.com from pyramid to web2py here is the start so 
> far if you are interested in watching the progress: http://176.34.12.39/
>
> NOTE: There will be LOTS of changes and the database will be deleted and 
> rebuilt often over the next few months. youadworld.com however is live 
> and free to register to see what the current functionality is, and will be 
> in the new version with web2py.
>
> On Fri, Jan 13, 2012 at 2:47 PM, Anthony  wrote:
>
>> db.define_table('user_account'**,
>>> 
>>> )
>>> db.define_table('distributors'**,
>>> Field('account_id', db.user_account),
>>> Field('uadpoints_balance_**available', 'integer', default=0),
>>> )
>>> db.define_table('ads',
>>> Field('member_id', db.user_account),
>>> Field('points', 'integer', default=0),
>>> )
>>> db.ads.points.requires = IS_INT_IN_RANGE(0, 
>>> db(db.distributors.account_id=**=db.ads.member_id).select()[0]**
>>> .uadpoints_balance_available)
>>>
>>
>> If 'ads' records will be added via form submission, then you might try:
>>
>> db.ads.points.requires = IS_INT_IN_RANGE(0,
>> db(db.distributors.account_id=**=request.vars.member_id
>> ).select().first()**.uadpoints_balance_available)
>>
>> You might want to set this in the form controller only when request.vars 
>> is not empty to avoid unnecessary db hits.
>>
>> Anthony
>>
>>
>
>
> -- 
> -- 
> Regards,
> Bruce Wade
> http://ca.linkedin.com/in/brucelwade
> http://www.wadecybertech.com
> http://www.warplydesigned.com
> http://www.fitnessfriendsfinder.com
>  


Re: [web2py] Re: Is this possible?

2012-01-13 Thread Bruce Wade
Thank you Anthony,

That works exactly how I was want. I didn't even think to use request.vars.
Just trying to see how many different ways this is going to save my team
development time.

We are moving youadworld.com from pyramid to web2py here is the start so
far if you are interested in watching the progress: http://176.34.12.39/

NOTE: There will be LOTS of changes and the database will be deleted and
rebuilt often over the next few months. youadworld.com however is live and
free to register to see what the current functionality is, and will be in
the new version with web2py.

On Fri, Jan 13, 2012 at 2:47 PM, Anthony  wrote:

> db.define_table('user_account'**,
>> 
>> )
>> db.define_table('distributors'**,
>> Field('account_id', db.user_account),
>> Field('uadpoints_balance_**available', 'integer', default=0),
>> )
>> db.define_table('ads',
>> Field('member_id', db.user_account),
>> Field('points', 'integer', default=0),
>> )
>> db.ads.points.requires = IS_INT_IN_RANGE(0, db(db.distributors.account_id=
>> **=db.ads.member_id).select()[0]**.uadpoints_balance_available)
>>
>
> If 'ads' records will be added via form submission, then you might try:
>
> db.ads.points.requires = IS_INT_IN_RANGE(0,
> db(db.distributors.account_id=**=request.vars.member_id
> ).select().first()**.uadpoints_balance_available)
>
> You might want to set this in the form controller only when request.vars
> is not empty to avoid unnecessary db hits.
>
> Anthony
>
>


-- 
-- 
Regards,
Bruce Wade
http://ca.linkedin.com/in/brucelwade
http://www.wadecybertech.com
http://www.warplydesigned.com
http://www.fitnessfriendsfinder.com


[web2py] Re: Is this possible?

2012-01-13 Thread Anthony

>
> db.define_table('user_account',
> 
> )
> db.define_table('distributors',
> Field('account_id', db.user_account),
> Field('uadpoints_balance_available', 'integer', default=0),
> )
> db.define_table('ads',
> Field('member_id', db.user_account),
> Field('points', 'integer', default=0),
> )
> db.ads.points.requires = IS_INT_IN_RANGE(0, 
> db(db.distributors.account_id==db.ads.member_id).select()[0].uadpoints_balance_available)
>

If 'ads' records will be added via form submission, then you might try:

db.ads.points.requires = IS_INT_IN_RANGE(0,
db(db.distributors.account_id==request.vars.member_id
).select().first().uadpoints_balance_available)

You might want to set this in the form controller only when request.vars is 
not empty to avoid unnecessary db hits.

Anthony



[web2py] Re: Is this possible?

2011-12-27 Thread lyn2py
Thank you Joseph and Jonathan - I'll look into the methods you both
suggested! :)

On Dec 27, 11:39 pm, Jonathan Lundell  wrote:
> On Dec 27, 2011, at 2:49 AM, lyn2py wrote:
>
>
>
>
>
>
>
>
>
> > I already have in routes.py:
> > routers = dict(
> >    BASE = dict(
> >        default_controller='default',
> >        default_function='index'
> >    )
> > )
>
> > How should my code be organized so that I can achieve:
> > website.com/items --> shows all the items
> > website.com/items/127 --> displays details of item #127
>
> > Right now, it's being done this way:
> > website.com/items --> shows all the items
> > website.com/items/display/127 --> displays details of item #127
>
> > Must the changes be made to routes.py or can the code base be slightly
> > modified to achieve it?
>
> An easy way is to put the item number in a query string: website.com/items?127
>
> Another way would be to use the function default/items instead of items/index.
>
> If you really, really want items to be a controller and have the URL syntax 
> you're looking for, use something like this:
>
> routers = dict(
>    yourapp = dict(
>        functions = { 'items' : ['index', ... ] }
>    )
> )
>
> The idea is that you need to inform the router of the function names in the 
> items controller.
>
> Suggestion: website.com/item/127 looks a little more natural than items/127, 
> at least to me. Easiest to do by putting your code in default/item and 
> default/items.


[web2py] Re: Is this possible?

2011-12-27 Thread Joseph Jude
Your code base should be adjusted. Both Anthony & Jonathan helped me with 
similar problem for me.

Here is my 
routes.py: 
https://bitbucket.org/id804097/minnaedu/src/570149716878/webapp/routes.py
here is my 
controller/index: 
https://bitbucket.org/id804097/minnaedu/src/570149716878/webapp/applications/init/controllers/default.py

here is the final application: minnaedu.appspot.com

Hope these help

Joseph


[web2py] Re: is this possible with computed

2011-02-05 Thread Massimo Di Pierro
Long ago I made a widget for that. It got lost. If I cannot find it
will re-write it.

On Feb 4, 11:47 am, Richard Vézina 
wrote:
> Hello Dear web2py users,
>
> I would like to achieve this.
>
> I have a referenced field 1 to many
>
> The referenced table is mostly for storing the dropdown option.
>
> So I have :
>
> IS_IN_DB(choice1, choice2, etc.)
>
> I would like to add on the same form a empty choice field that could
> populate the referenced choice table...
>
> Field ('choice_id', db.choice),
> db.choice # That let add new choice.
>
> But
>
> 1) If the db.choice input is empty don't want add NULL value
> 2) I would if no choice is made and a new choice is added that choice_id
> takes the id of the new added choice...
>
> Can I get something to work with "compute" that seems reserved for only one
> table.
> How to prevent a empty db.choice input to be inserted... Is there any
> validator that could applied??
>
> Thanks
>
> Richard