[web2py] Re: Cockroach DB

2017-04-21 Thread Ron McOuat
Database survives outages like the bug colony survives in life. Interesting 
analogy but the bug is still repulsive.

On Wednesday, 12 April 2017 04:43:48 UTC-7, Massimo Di Pierro wrote:
>
> Interesting... bad name
>
> On Tuesday, 11 April 2017 07:40:38 UTC-5, mcm wrote:
>>
>> This seems a real bargain (postgresql dialect and protocol).
>>
>> https://www.cockroachlabs.com/
>>
>> Sorry for the others... ;-)
>>
>>
>>

-- 
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] Re: Using validate_and_insert with a computed field

2017-04-21 Thread Chris
Many thanks Anthony!

That looks like it will work for now...I may specifically handle call that 
code just before validate_and_insert calls in the web app, so I don't get 
rid of readURL validation in a place where I need it.

On Friday, April 21, 2017 at 4:46:51 PM UTC-4, Anthony wrote:
>
> Thanks. I updated the Github issue, as there are multiple problems with 
> the current implementation of the .validate_and_ methods.
>
> For now, you should be able to get around the two issues you observe by 
> removing the validators:
>
> db.story.titleAsSlug.requires = db.story.readURL.requires = None
>
> You can probably permanently set the titleAsSlug requires to None, as it 
> will not appear in forms anyway. The default readURL validator, on the 
> other hand, may be needed if you intend to allow inserts/updates directly 
> via SQLFORM.process().
>
> The problem is that the default validator assigned to titleAsSlug 
> transforms None to '', and the default validator for readURL transforms 
> None to 'None'. These values then get inserted in the record.
>
> Anthony
>
> On Friday, April 21, 2017 at 9:48:53 AM UTC-4, Chris wrote:
>>
>> Can do, here's an example:
>>
>> # DB
>>
>> db.define_table('story',
>> Field('title',
>>   length=512,
>>   widget=lambda field, value: SQLFORM.widgets.string.widget(field
>> ,
>> value,
>> _size=40),
>>   requires=[IS_NOT_EMPTY(), IS_LENGTH(minsize=1, maxsize=512)]),
>> Field('titleAsSlug',
>>   compute=lambda(r): urls.convert_to_slug(r['title'])),
>> Field('readURL', unique=True, label=T('URL'), required=False,
>>   widget=lambda field, value:
>>   SQLFORM.widgets.string.widget(field,
>> value,
>> _size=60,
>> _placeholder='
>> http://www.example.com')),
>> )
>>
>> # Test
>>
>> class TestModels(unittest.TestCase):
>> def testStoryNewCreate(self):
>> dct_new_story = {
>>  "title": "Unit Test"}
>> new_story = db.story.validate_and_insert(**dct_new_story)
>> self.assertFalse(new_story["errors"], "Error inserting a new 
>> story: " + str(new_story)) 
>>
>> The readURL field generates an error that the entry is found in the 
>> database. Unique=True is a DB constraint according to the web2py manual and 
>> NULLs in PostgreSQL and SQL in general don't violate the unique constraint. 
>> Web2py attaches an IS_NOT_IN_DB validator that converts None to "None" 
>> instead of null, which only works until there is a row with a readURL of 
>> 'None'.
>> The titleAsSlug field is set to an empty string by the validator, which 
>> is perhaps why validate_and_insert doesn't compute it where insert does.
>>
>> Hope that's helpful, thanks for anything you can do here!
>>
>>
>> On Thursday, April 20, 2017 at 11:05:02 PM UTC-4, Anthony wrote:
>>>
>>> Need to see the fields.
>>
>>

-- 
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: force redirect after expiration login session expiration time

2017-04-21 Thread Anthony
You could include some JS in the layout that has the desired time to 
expiration in a JS variable and automatically does a client-side redirect 
to the logout URL after the expiration time.

Anthony

On Friday, April 21, 2017 at 5:04:11 AM UTC-4, A3 wrote:
>
> Using auth and auth.settings.expiration the login expires correctly, when 
> you refresh manually or click a button or menu it redirects to login.
>
> My problem is that the page last shown before it expired remains visible.
> There is no automatic redirecting just after the expiration time has 
> passed. 
>
> What can I do to automatically redirect it at expiration time?
>
> Any help is very welcome.
>

-- 
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] Re: Using validate_and_insert with a computed field

2017-04-21 Thread Anthony
Thanks. I updated the Github issue, as there are multiple problems with the 
current implementation of the .validate_and_ methods.

For now, you should be able to get around the two issues you observe by 
removing the validators:

db.story.titleAsSlug.requires = db.story.readURL.requires = None

You can probably permanently set the titleAsSlug requires to None, as it 
will not appear in forms anyway. The default readURL validator, on the 
other hand, may be needed if you intend to allow inserts/updates directly 
via SQLFORM.process().

The problem is that the default validator assigned to titleAsSlug 
transforms None to '', and the default validator for readURL transforms 
None to 'None'. These values then get inserted in the record.

Anthony

On Friday, April 21, 2017 at 9:48:53 AM UTC-4, Chris wrote:
>
> Can do, here's an example:
>
> # DB
>
> db.define_table('story',
> Field('title',
>   length=512,
>   widget=lambda field, value: SQLFORM.widgets.string.widget(field,
> value,
> _size=40),
>   requires=[IS_NOT_EMPTY(), IS_LENGTH(minsize=1, maxsize=512)]),
> Field('titleAsSlug',
>   compute=lambda(r): urls.convert_to_slug(r['title'])),
> Field('readURL', unique=True, label=T('URL'), required=False,
>   widget=lambda field, value:
>   SQLFORM.widgets.string.widget(field,
> value,
> _size=60,
> _placeholder='
> http://www.example.com')),
> )
>
> # Test
>
> class TestModels(unittest.TestCase):
> def testStoryNewCreate(self):
> dct_new_story = {
>  "title": "Unit Test"}
> new_story = db.story.validate_and_insert(**dct_new_story)
> self.assertFalse(new_story["errors"], "Error inserting a new 
> story: " + str(new_story)) 
>
> The readURL field generates an error that the entry is found in the 
> database. Unique=True is a DB constraint according to the web2py manual and 
> NULLs in PostgreSQL and SQL in general don't violate the unique constraint. 
> Web2py attaches an IS_NOT_IN_DB validator that converts None to "None" 
> instead of null, which only works until there is a row with a readURL of 
> 'None'.
> The titleAsSlug field is set to an empty string by the validator, which is 
> perhaps why validate_and_insert doesn't compute it where insert does.
>
> Hope that's helpful, thanks for anything you can do here!
>
>
> On Thursday, April 20, 2017 at 11:05:02 PM UTC-4, Anthony wrote:
>>
>> Need to see the fields.
>
>

-- 
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] GET queries other than ID

2017-04-21 Thread David Shavers
Hi, 

How do I GET data by using the "cost-per-night" url? ID works fine, but that's 
the only thing that does. 


www.example.com/app/default/api/patterns gives me this: 

/room_owner[room_owner]
/room-owner/id/{room_owner.id}
/room-owner/id/{room_owner.id}/:field
/room-owner/cost-per-night/{room_owner.cost_per_night.ge}/{room_owner.cost_per_night.lt}
/room-owner/cost-per-night/{room_owner.cost_per_night.ge}/{room_owner.cost_per_night.lt}/:field


Desired result -
 www.example.com/app/default/api/room_owner
 
Desired result - 
www.example.com/app/default/api/room-owner/id/1.json 

NOT Desired - 
www.example.com/app/default/api/room-owner/cost-per-night/25.json 

How do I make the last query work?

-- 
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] Re: 403 Forbidden?

2017-04-21 Thread A.H.Gilbert
Thanks for reply Massimo and especial thanks for making all this available;
I like it much better than Rails.

I don't think failed logins was the problem.  I have now cured it by
removing and re-installing web2py (after saving all the copies of my
working though your lectures).

--
Best Wishes,
Howard

"If you don't read the newspaper, you're uninformed. If you read the
newspaper, you're mis-informed. - Mark Twain"


On Fri, Apr 21, 2017 at 4:39 PM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> You normally get that is you fail too many logins. It resets itself after
> 15 minutes.
>
>
> On Friday, 21 April 2017 10:12:52 UTC-5, Arthur Gilbert wrote:
>>
>>
>> Just started web2py.  Going thro' Massimo di Pierro's 5 lectures on you
>> tube.  Making good progress, excited about the system and everything
>> working well.  BUT, when I went back to it, today, I clicked on Admin (of
>> the welcome page) I got a long delay and then "403 FORBIDDEN". The page is
>> showing "http://127.0.0.1:8000/admin/default/index; as it should. I am
>> not aware of changing anything on my system, I am using xubuntu and
>> Firefox. Web2py version 2.14.6-stable+timestamp.2016.05.10.00.21.47.
>>
>> Please help,
>> Thanks.
>>
> --
> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/web2py/9T4E2MS8kfY/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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: 403 Forbidden?

2017-04-21 Thread Massimo Di Pierro
You normally get that is you fail too many logins. It resets itself after 
15 minutes.

On Friday, 21 April 2017 10:12:52 UTC-5, Arthur Gilbert wrote:
>
>
> Just started web2py.  Going thro' Massimo di Pierro's 5 lectures on you 
> tube.  Making good progress, excited about the system and everything 
> working well.  BUT, when I went back to it, today, I clicked on Admin (of 
> the welcome page) I got a long delay and then "403 FORBIDDEN". The page is 
> showing "http://127.0.0.1:8000/admin/default/index; as it should. I am 
> not aware of changing anything on my system, I am using xubuntu and 
> Firefox. Web2py version 2.14.6-stable+timestamp.2016.05.10.00.21.47.
>
> Please help, 
> Thanks.
>

-- 
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] Access DB2/400 from IBM i (AS/400) PASE environment

2017-04-21 Thread Massimo Di Pierro
We do have an adapter for db2:ibm_db_dbi did you try it? Anyway, in general 
adapter are defined in 

web2py/gluon/packages/dal/pydal/adapters
You can make your own adapter. The first step is identify which existing 
adapter to extend. You want to pick the one with the closest SQL dialect. 
Then you create (in a new adapter file) a new class that extends that 
adapter. db2:ibm_db_dbi for example is defined in db2.py as follows:

@adapters.register_for('db2:ibm_db_dbi')

class DB2IBM(DB2):

drivers = ('ibm_db_dbi',)


def connector(self):

uriparts = self.ruri.split(";")

cnxn = {}

for var in uriparts:

v = var.split('=')

cnxn[v[0].lower()] = v[1]

return self.driver.connect(

cnxn['dsn'], cnxn['uid'], cnxn['pwd'], **self.driver_args)

and can be called as:

db = DAL('db2:ibm_db_dbi:dsn=;uid=...;pwd=...')





On Friday, 21 April 2017 09:50:03 UTC-5, Jim S wrote:
>
> I would love to do some work on this if there was a mentor out there 
> willing to help me get started.
>
> -Jim
>
> On Fri, Apr 21, 2017 at 5:34 AM, António Ramos  
> wrote:
>
>> Maybe Massimo will read this and give us some hints on how to make  DAL 
>> use the ibm_dbi
>>
>> Regards
>>
>>
>> 
>>  Sem 
>> vírus. www.avast.com 
>> 
>>  
>> <#CAERBpoB9XHiZLmMc2ZRmOb=JTAwUc+3=AKTvYoVXpYzostc8gQ@mail.gmail.com_m_-8595142087007992887_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>>
>> 2017-03-17 21:06 GMT+00:00 Jim S :
>>
>>> Hi
>>>
>>> In a former (and somewhat current) life I was an AS/400 guy.  Our shop 
>>> still uses the platform though most of my time is spent on Python and 
>>> web2py now.
>>>
>>> Recently Python became available and officially supported on IBM i and 
>>> I'm trying to get web2py running there accessing the local DB2/400 
>>> database.  Using the local python on the system I can create a database 
>>> connection to the local database doing this:
>>>
>>> import ibm_db_dbi as db
>>>
>>> conn = db.connect(database='*LOCAL')
>>>
>>> I'm hoping to find an easy way to convert this into a connectstring for 
>>> the DAL so I can have my database created there.  The SQL-flavor it should 
>>> use would be the same as ODBC-flavored SQL.  
>>>
>>> Can anyone give me a clue how to modify the DAL code to connect to my 
>>> db?  Any pointers to other articles or links would really be appreciated.  
>>> It would be exciting for me to get this working since I could then show RPG 
>>> developers how easy it would be to get an application on the web from the 
>>> AS/400 using python/web2py.
>>>
>>> -Jim
>>>
>>> -- 
>>> 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.
>>>
>>
>> -- 
>> 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 a topic in the 
>> Google Groups "web2py-users" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/web2py/qrlN5TSSBgs/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> web2py+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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] Re: Open Sourced dating website

2017-04-21 Thread David Shavers
Haha thanks a lot Massimo, your acknowledgement makes me want to code better 

-- 
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: Could I use SQLFORM.factory to update 2 tables in a single form

2017-04-21 Thread Massimo Di Pierro
You can do form = SQLFORM.factory(db.item, db.subscription_item) as long 
the two tables do not have fields with the same name. Then after

if form.process().accepted:
db.item.insert()
db.subscription_item.insert()

where ... should be replaced by the proper fields in form.vars

On Monday, 17 April 2017 12:09:58 UTC-5, Rudy wrote:
>
> Hi there,
>
> I am building an accounting system. When I create a quotation, if the item 
> is in 'subscription' category, i want to use SQLFORM.factory(db.item, 
> db.subscription_item) to generate a create form for submitting the 
> necessary values. Now i want to edit these 2 tables(item and 
> subscription_item have 1-1 relationship), does SQLFORM.factory() takes any 
> constraint or query to specify which item I want to edit?  If not, what's 
> the best way to do it? Thanks in advance!
>
> Below is the simplified database tables:
> db.define_table('company',
> Field('company_name', requires=IS_NOT_EMPTY()), # 
> unique=True
> format='%(company_name)s')
>
> db.define_table('quotation',
> Field('company', 'reference company'),
> Field('project_name', requires=IS_NOT_EMPTY()),
> Field('quote_amount', 'double', default=0, writable=False),
> auth.signature)
>
> db.define_table('category',
> Field('category_name', ondelete='NO ACTION'), # eg. 
> project or subscription
> format='%(category_name)s')
>
> db.define_table('item',
> Field('quotation', 'reference quotation',  writable=False, 
> label='Quote Id'),
> Field('category', 'reference category', 
> requires=IS_IN_DB(db, 'category.id', '%(category_name)s')),
> Field('description'),
> Field('amount', 'double', default=0),
> auth.signature)
>
> db.define_table('subscription_item',
> Field('item', 'reference item',  writable=False, 
> label='Item Id'),
> Field('start_date', 'date'),
> Field('end_date', 'date'),
> auth.signature)
>
>

-- 
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] Re: Open Sourced dating website

2017-04-21 Thread Massimo Di Pierro
Nice work! I am not sure I can sign up to try without getting in trouble. 
;-)

On Monday, 27 February 2017 16:13:33 UTC-6, Fabiano Almeida wrote:
>
> Wow! Thanks for sharing! New ideas! New features!
>
> Thanks a lot and best regards!
>
> Fabiano
>
> 2017-02-26 21:03 GMT-03:00 Jaimee S :
>
>> Yea, dude. There definitely aren't ‎many new ideas under the sun so its 
>> always best to find one and improve it a little.
>>
>> David Shavers
>> Founder, Just Between Us 
>> jbthelpp...@gmail.com
>> www.jbtus.com
>> *From: *Donald McClymont
>> *Sent: *Sunday, February 26, 2017 4:18 PM
>> *To: *web2py-users
>> *Reply To: *web2py@googlegroups.com
>> *Subject: *[web2py] Re: Open Sourced dating website
>>
>> Thanks for sharing - I will take a look.  No plans to start a dating 
>> website for people - however currently quite enjoying reading "The 
>> evolution of everything" and this argues that human progress arises when 
>> ideas have sex - so perhaps it could be adapted to a dating site for ideas.
>>
>> Donald
>>
>>
>>
>> On Sunday, February 26, 2017 at 6:17:15 AM UTC, David Shavers wrote:
>>>
>>> Good Evening, 
>>>
>>> I made a dating website when i was heavily into web2py. My original goal 
>>> was to overthrow Plenty of Fish. Didn't happen lol. Currently I'm into 
>>> android development and release new apps almost weekly. My dating website 
>>> has over 300 users and it's still growing even though i don't advertise or 
>>> put any effort into marketing. If you are interested/single/curious/looking 
>>> for love/etc, it's http://www.jbtus.com 
>>>
>>>
>>> About an hour ago, i open sourced it on github because i figured some 
>>> other developer may be trying to overtake pof too and would need a 
>>> jumpstart to help them get past all of the arbitraries. I'm also looking 
>>> for employment! The website has many features such as: user to user 
>>> messaging, a forum, a user feed similar to that of Facebook, bootstrap 
>>> slideshow, jumbotrons, sorting based on gender/preference, stripe(payment) 
>>> integration, featured users, user login page, and much more! This website 
>>> is easily customizable and i did most of the hard work for you. Also, this 
>>> app uses NO PLUGINS! Enjoy!
>>>
>>>
>>> https://github.com/frontEndDevv/dating_website
>>>
>>>
>>>
>>>
>>>
>>> PS.. if you encounter any issues that you aren't able to fix, please 
>>> contact me so i can try my best to help!  And if you are into android 
>>> development, let me know and we can collaborate or swap ideas or something
>>>
>> -- 
>> 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 a topic in the 
>> Google Groups "web2py-users" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/web2py/fKisIOIL1qE/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> web2py+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>> -- 
>> 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.
>>
>
>

-- 
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: UPDATE BOOTSTRAP VERSION FROM 3 TO 4

2017-04-21 Thread Massimo Di Pierro
Which is why I hate bootstrap and we have to move to client side generation 
of forms and grid since server side generation does not know about css.

On Sunday, 16 April 2017 16:42:12 UTC-5, Anthony wrote:
>
> Different versions of Bootstrap involve not just changes to CSS and JS 
> files -- the structure of the HTML and the class names use also change. So 
> you have to make changes to layout.html and other templates, formstyles, 
> etc.
>
> Anthony
>
> On Wednesday, April 12, 2017 at 8:46:50 AM UTC-4, Áureo Dias Neto wrote:
>>
>> Hello guys,
>>
>> How to update version 3 bootstrap to 4 on web2py?
>>
>> I tried to replace the .css and .js files, however I got a lot of bug and 
>> unrecognized classes ..
>>
>

-- 
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: Resetting the database

2017-04-21 Thread Massimo Di Pierro
In the case of sqlite it is easy enough to also delete the content of the 
databases/ folder.

On Sunday, 16 April 2017 09:37:11 UTC-5, Matthew J Watts wrote:
>
> I had to log out of my webapp before deleting the database data, otherwise 
> i would get an error message
>
> cheers
>
> On Monday, November 14, 2011 at 1:38:15 AM UTC+1, Archibald Linx wrote:
>>
>> Dear Web2py users, 
>>
>> How can I reset the database of my Web2py project ? 
>>
>> Thanks, 
>> Archibald
>
>

-- 
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] Access DB2/400 from IBM i (AS/400) PASE environment

2017-04-21 Thread António Ramos
having web2py DAL working with ibm_db would give web2py a good visibility
from IBM because they often publish documents about open source techs and
IBM
and being web2py such a good product i think IBM would also be in love as
we ALL are!!!
regards


2017-04-21 15:49 GMT+01:00 Jim Steil :

> I would love to do some work on this if there was a mentor out there
> willing to help me get started.
>
> -Jim
>
> On Fri, Apr 21, 2017 at 5:34 AM, António Ramos 
> wrote:
>
>> Maybe Massimo will read this and give us some hints on how to make  DAL
>> use the ibm_dbi
>>
>> Regards
>>
>>
>> 
>>  Sem
>> vírus. www.avast.com
>> 
>> <#m_-1570189098853613606_m_-8595142087007992887_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>>
>> 2017-03-17 21:06 GMT+00:00 Jim S :
>>
>>> Hi
>>>
>>> In a former (and somewhat current) life I was an AS/400 guy.  Our shop
>>> still uses the platform though most of my time is spent on Python and
>>> web2py now.
>>>
>>> Recently Python became available and officially supported on IBM i and
>>> I'm trying to get web2py running there accessing the local DB2/400
>>> database.  Using the local python on the system I can create a database
>>> connection to the local database doing this:
>>>
>>> import ibm_db_dbi as db
>>>
>>> conn = db.connect(database='*LOCAL')
>>>
>>> I'm hoping to find an easy way to convert this into a connectstring for
>>> the DAL so I can have my database created there.  The SQL-flavor it should
>>> use would be the same as ODBC-flavored SQL.
>>>
>>> Can anyone give me a clue how to modify the DAL code to connect to my
>>> db?  Any pointers to other articles or links would really be appreciated.
>>> It would be exciting for me to get this working since I could then show RPG
>>> developers how easy it would be to get an application on the web from the
>>> AS/400 using python/web2py.
>>>
>>> -Jim
>>>
>>> --
>>> 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.
>>>
>>
>> --
>> 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 a topic in the
>> Google Groups "web2py-users" group.
>> To unsubscribe from this topic, visit https://groups.google.com/d/to
>> pic/web2py/qrlN5TSSBgs/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> web2py+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> 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.
>

-- 
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] Help with creating a Select within the Web2Py DAL for a SQL query that uses an 'exists' clause

2017-04-21 Thread George D Elig
I have a simple SQL query that pulls a column value from a secondary table, 
based on a ID being equal in both tables. The query uses an exists clause 
on a subquery.

select sites.domain_name, batch.batch_name from sites, batch

where exists (select batch.id from batch

  where sites.batchid = batch.id) limit 1

-- 
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] How can I create a DAL Select statement from a SQL exists clause?

2017-04-21 Thread George D Elig
 

I have the following SQL statement that I'm having difficulty converting to 
a db()Select statement. I could use a left join but I can only return one 
row, which is being addressed with 'limit 1'


select sites.domain_name, batch.batch_name from sites, batch

where exists (select batch.id from batch

  where sites.batchid = batch.id) limit 1


Thanks in advance for any assistance.

D.

-- 
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: How to upload a file into web2py?

2017-04-21 Thread fastcard lastname
I have same issue, but I changed controller .py to following, it works
def uploading_file():
from gluon.sqlhtml import form_factory
form=form_factory(SQLField('import_csv','upload', uploadfolder = 
'c:\\temp\\uploading'))
if form.accepts(request.vars,session):
request.flash='Received: %s'%request.vars.import_csv
print (request.vars.import_csv.filename)
print (len(request.vars.import_csv.file.read()),'bytes')
#return dict(form=form)
return locals()

view file here...

{{extend 'layout.html'}}
Option Exercise CMC file uploading
{{=form}}
{{=BEAUTIFY(request.vars.import_csv.filename if request.vars.import_csv 
else '')}}


On Saturday, March 14, 2009 at 8:37:49 AM UTC+11, mdipierro wrote:
>
> Glad to hear it. 
>
> On Mar 13, 1:48 pm, Joe  Barnhart  wrote: 
> > Thanks Massimo -- 
> > 
> > I don't know what my problem was other than the view was confusing 
> > me. 
> > 
> > Your code works perfectly on my end as well (Python 2.5.2 on Mac 
> > here).  The view still reports request.var.import_csv as a 
> > "FieldStorage" object, but the form.accepts() processing gets 
> > triggered properly and the file is read. 
> > 
> > I'm a happy camper and this pattern is going into my website!  I'll 
> > have a link to it here soon so everyone can take a look.  It's not 
> > beautiful to anyone but me so far, but it makes pretty extensive use 
> > of web2py's DAL power.  The users of the site (high school swim 
> > coaches) are ecstatic to have it. 
> > 
> > Regards, 
> > 
> > -- Joe B. 
> > 
> > On Mar 13, 7:26 am, mdipierro  wrote: 
> > 
> > > I tried this: 
> > 
> > > def import_csv(): 
> > > from gluon.sqlhtml import form_factory 
> > > form=form_factory(SQLField('import_csv','upload')) 
> > > if form.accepts(request.vars,session): 
> > > request.flash='Received: %s'%request.vars.import_csv 
> > > print request.vars.import_csv.filename 
> > > print len(request.vars.import_csv.file.read()),'bytes' 
> > > return dict(form=form) 
> > 
> > > and it works great for me. Are you using python 2.6 by any chance? 
> > 
> > > On Mar 13, 3:53 am, Joe  Barnhart  wrote: 
> > 
> > > > I must be doing something very wrong.  The field I get back does not 
> > > > seem to have any of the components it should have. 
> > 
> > > > Here is my controlller: 
> > 
> > > > def import_csv(): 
> > > > from gluon.sqlhtml import form_factory 
> > > > form=form_factory(SQLField('import_csv','upload')) 
> > > > if form.accepts(request.vars,session): 
> > > > request.flash='Received: %s'%request.vars.import_csv 
> > > > #do more processing here 
> > > > return dict(form=form) 
> > 
> > > > And here is the view: 
> > 
> > > > {{extend 'layout.html'}} 
> > > > This is the meets/import_csv.html template 
> > > > {{=form}} 
> > > > {{=BEAUTIFY(request.vars.import_csv.filename if 
> > > > request.vars.import_csv else '')}} 
> > 
> > > > The if clause above was to see if the field contained anything under 
> > > > "import_csv".  It did not. 
> > 
> > > > I was trying to follow the information in the manual on page 177 but 
> > > > there seemed to be missing information (like the input field 
> itself). 
> > 
> > > > I am currently using version 1.56.3.  I plan to update as soon as 
> the 
> > > > current swim meet is over and I can take the site down for awhile as 
> I 
> > > > work on it. 
> > 
> > > > On Mar 12, 6:15 pm, mdipierro  wrote: 
> > 
> > > > > you can get the file content from 
> > 
> > > > >   request.vars.my_field_name.file.read() 
> > 
> > > > > and the file name from 
> > 
> > > > >   request.vars.my_field_name.filename 
> > 
> > > > > hope this helps. 
> > 
> > > > > On Mar 12, 7:55 pm, Joe  Barnhart  wrote: 
> > 
> > > > > > Let me preface this by explaining that I am a noob at creating 
> > > > > > websites.  This is probably so simple that anyone who's been 
> around 
> > > > > > the block knows the answer and is thus confused at the empty- 
> > > > > > headedness of my question. 
> > 
> > > > > > I wanted to take advantage of web2py's built-in handling of 
> update 
> > > > > > fields -- it pops up a file chooser and allows the user to pick 
> the 
> > > > > > the file to upload on his local computer.  The file is then 
> streamed 
> > > > > > up to the server running web2py and usually placed in the 
> "uploads" 
> > > > > > directory and linked into a database table.  In my case, rather 
> than 
> > > > > > storing the file or a reference to it in a database, I wish to 
> process 
> > > > > > the file immediately in the controller and store the processed 
> > > > > > results. 
> > 
> > > > > > I can create a form using form_factory with a single SQLField 
> > > > > > definition for a field of type "upload".  When I invoke this 
> form it 
> > > > > > correctly displays a file chooser and lets me 

[web2py] Re: Allowing external access to web2py server ?

2017-04-21 Thread sebas mora
Help please! Im trying to access my web2py server on a Rpi from another 
device to run an application that is on the server. From local host it runs 
and executes fine, no problem, but i just cant connect to it from other 
devices. 
I do what is said in this message and I get the following error: 

*ERROR:Rocker.Errors.Port80:Socket 192.168.1.172:80 in use by other process 
and it wont share.*

What am I doing wrong? How can i get around this? 
 Please help!!

On Sunday, December 9, 2012 at 5:42:58 AM UTC-5, Richard Shea wrote:
>
> Thank you Massimo.
>
> On Saturday, December 8, 2012 5:52:28 AM UTC+13, Massimo Di Pierro wrote:
>>
>> python web2py.py -a passwd -i 0.0.0.0 -p 80
>>
>> On Friday, 7 December 2012 03:21:55 UTC-6, Richard Shea wrote:
>>>
>>> I want to start a web2py server so that it can be accessed externally
>>> to the hosting server.
>>>
>>> I've read this http://web2py.com/books/default/chapter/29/03
>>>
>>> By default, web2py runs its web server on 127.0.0.1:8000 (port 8000
 on localhost), but you can run it on any available IP address and
 port. You can query the IP address of your network interface by
 opening a command line and typing ipconfig on Windows or ifconfig on
 OS X and Linux. From now on we assume web2py is running on localhost
 (127.0.0.1:8000). Use 0.0.0.0:80 to run web2py publicly on any of your
 network interfaces.

>>>
>>> but I can't find how to "Use 0.0.0.0:80" ?
>>>
>>> There doesn't seem to be a command line argument which does that ? 
>>>
>>> I'm aware of the command line arg to change the port but how do I allow 
>>> access from all addresses.
>>>
>>> thanks
>>>
>>> Richard.
>>>
>>>

-- 
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] 403 Forbidden?

2017-04-21 Thread Arthur Gilbert

Just started web2py.  Going thro' Massimo di Pierro's 5 lectures on you 
tube.  Making good progress, excited about the system and everything 
working well.  BUT, when I went back to it, today, I clicked on Admin (of 
the welcome page) I got a long delay and then "403 FORBIDDEN". The page is 
showing "http://127.0.0.1:8000/admin/default/index; as it should. I am not 
aware of changing anything on my system, I am using xubuntu and Firefox. 
Web2py version 2.14.6-stable+timestamp.2016.05.10.00.21.47.

Please help, 
Thanks.

-- 
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] Access DB2/400 from IBM i (AS/400) PASE environment

2017-04-21 Thread Jim Steil
I would love to do some work on this if there was a mentor out there
willing to help me get started.

-Jim

On Fri, Apr 21, 2017 at 5:34 AM, António Ramos  wrote:

> Maybe Massimo will read this and give us some hints on how to make  DAL
> use the ibm_dbi
>
> Regards
>
>
> 
>  Sem
> vírus. www.avast.com
> 
> <#m_-8595142087007992887_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>
> 2017-03-17 21:06 GMT+00:00 Jim S :
>
>> Hi
>>
>> In a former (and somewhat current) life I was an AS/400 guy.  Our shop
>> still uses the platform though most of my time is spent on Python and
>> web2py now.
>>
>> Recently Python became available and officially supported on IBM i and
>> I'm trying to get web2py running there accessing the local DB2/400
>> database.  Using the local python on the system I can create a database
>> connection to the local database doing this:
>>
>> import ibm_db_dbi as db
>>
>> conn = db.connect(database='*LOCAL')
>>
>> I'm hoping to find an easy way to convert this into a connectstring for
>> the DAL so I can have my database created there.  The SQL-flavor it should
>> use would be the same as ODBC-flavored SQL.
>>
>> Can anyone give me a clue how to modify the DAL code to connect to my
>> db?  Any pointers to other articles or links would really be appreciated.
>> It would be exciting for me to get this working since I could then show RPG
>> developers how easy it would be to get an application on the web from the
>> AS/400 using python/web2py.
>>
>> -Jim
>>
>> --
>> 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.
>>
>
> --
> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/web2py/qrlN5TSSBgs/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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] Re: Using validate_and_insert with a computed field

2017-04-21 Thread Chris
Can do, here's an example:
# DB

db.define_table('story',
Field('title',
  length=512,
  widget=lambda field, value: SQLFORM.widgets.string.widget(field,
value,
_size=40),
  requires=[IS_NOT_EMPTY(), IS_LENGTH(minsize=1, maxsize=512)]),
Field('titleAsSlug',
  compute=lambda(r): urls.convert_to_slug(r['title'])),
Field('readURL', unique=True, label=T('URL'), required=False,
  widget=lambda field, value:
  SQLFORM.widgets.string.widget(field,
value,
_size=60,
_placeholder=
'http://www.example.com')),
)

# Test

class TestModels(unittest.TestCase):
def testStoryNewCreate(self):
dct_new_story = {
 "title": "Unit Test"}
new_story = db.story.validate_and_insert(**dct_new_story)
self.assertFalse(new_story["errors"], "Error inserting a new story: 
" + str(new_story)) 

The readURL field generates an error that the entry is found in the 
database. Unique=True is a DB constraint according to the web2py manual and 
NULLs in PostgreSQL and SQL in general don't violate the unique constraint. 
Web2py attaches an IS_NOT_IN_DB validator that converts None to "None" 
instead of null, which only works until there is a row entitled 'None'.
The titleAsSlug field is set to an empty string by the validator, which is 
perhaps why validate_and_insert doesn't compute it where insert does.


On Thursday, April 20, 2017 at 11:05:02 PM UTC-4, Anthony wrote:
>
> Need to see the fields.

-- 
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] A simple way to catch and retry a failed form submit?

2017-04-21 Thread Horst Horst
On my site (sympathetic-resonances.org), users edit complex forms. Part of 
the form is musical data passed as JSON in a hidden form field, where a JS 
frontend reads it from and writes it to. The pages themselves are submitted 
as regular forms.

I have a few users in countries with very unreliable internet connection. 
If their form submit fails, edits to the musical data are sometimes lost, 
depending on the browser. (Firefox offers a Try Again button, Chrome and 
Safari don't - I wonder why the UX is so bad here in the first place.)

Ideally, if users clicked on a submit button and the site can't be reached, 
the page with the form would remain unchanged (so you might even continue 
editing), and a dialog would pop up, indicating the problem and asking to 
try again later.

Is there a simple way to achieve this with JS and/or web2py? (I realize 
that this kind of single-page frontend would better communicate with the 
backend via AJAX, but there's quite some logic (custom validators etc.) 
tied to the controller, and unless there's a simple way to keep the 
controller mainly as-is, I don't want to spend the time for this change 
right now.)

-- 
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] Access DB2/400 from IBM i (AS/400) PASE environment

2017-04-21 Thread António Ramos
Maybe Massimo will read this and give us some hints on how to make  DAL use
the ibm_dbi

Regards


Sem
vírus. www.avast.com

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

2017-03-17 21:06 GMT+00:00 Jim S :

> Hi
>
> In a former (and somewhat current) life I was an AS/400 guy.  Our shop
> still uses the platform though most of my time is spent on Python and
> web2py now.
>
> Recently Python became available and officially supported on IBM i and I'm
> trying to get web2py running there accessing the local DB2/400 database.
> Using the local python on the system I can create a database connection to
> the local database doing this:
>
> import ibm_db_dbi as db
>
> conn = db.connect(database='*LOCAL')
>
> I'm hoping to find an easy way to convert this into a connectstring for
> the DAL so I can have my database created there.  The SQL-flavor it should
> use would be the same as ODBC-flavored SQL.
>
> Can anyone give me a clue how to modify the DAL code to connect to my db?
> Any pointers to other articles or links would really be appreciated.  It
> would be exciting for me to get this working since I could then show RPG
> developers how easy it would be to get an application on the web from the
> AS/400 using python/web2py.
>
> -Jim
>
> --
> 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.
>

-- 
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] force redirect after expiration login session expiration time

2017-04-21 Thread A3
Using auth and auth.settings.expiration the login expires correctly, when 
you refresh manually or click a button or menu it redirects to login.

My problem is that the page last shown before it expired remains visible.
There is no automatic redirecting just after the expiration time has 
passed. 

What can I do to automatically redirect it at expiration time?

Any help is very welcome.

-- 
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] Re: table already exists; 'Rows' object has no attribute 'fields'

2017-04-21 Thread pbreit
I'm still experiencing both problems.

I cloned web2py from scratch with: git clone --recursive 
https://github.com/web2py/web2py.git

I added my fairly basic table models into models.py. When i run for the 
very first time I get:
OperationalError: table "auth_user" already exists



In /appadmin jsut trying to go to one of my tables continuously gave me:
AttributeError: 'Rows' object has no attribute 'fields'



And now I'm also stuck with:
ERROR:Rocket.Errors.Port8000:Socket 127.0.0.1:8000 in use by other process



I never ran into any of these problems before a few months a


-- 
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.