[web2py] TOMORROW: Talk to py4web's creator! Live Chat with Massimo DiPierro discussing py4web live 7/25/2020 10am PST

2020-07-24 Thread Tom Campbell
The hardest working man in the web framework business will be here for you 
to answer questions via interactive text. There will be a copy of the 
transcript available on FreeNode, plus I'll attempt to put together a 
polished version in article form. So the inevitable mistakes in my 
transcript will be counterbalanced by the actual word from Massimo.

No login or anything needed:
https://webchat.freenode.net/#py4web

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/e7bff8ca-ccdb-4550-8c4f-28b4a1b961b5o%40googlegroups.com.


Re: [web2py] Re: login expiration time

2020-07-24 Thread Warwick JC
Thanks.
Is it wrong to have iframe pages from the same app?
Regards

On Fri, 24 Jul 2020 at 15:20, villas  wrote:

> If you are using an iframe to display a page from the same app,  I have
> the impression that your design might be wrong. You will probably find a
> better way after you give this a little more thought. Sorry if this answer
> does not seem so helpful.
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/36155787-351a-479c-8534-3c0c58e333dfo%40googlegroups.com
> 
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAAcHJF81t6XNMu69TapOOSHCXe%2BrjbrFGe9FRaDi6uinfMZOzw%40mail.gmail.com.


[web2py] Re: import_from_csv_file and auth.signature

2020-07-24 Thread David Orme
Well now that is embarrassing. Thanks!

For reference, this was my recipe to put at the top of a file that is going 
to populate multiple tables:

if db(db.auth_user).count() == 0:
#Bulk load account
admin_user_id = db.auth_user.insert(first_name='Bulk uploader')
else:
admin_user_id = db(db.auth_user.first_name == 'Bulk uploader').select().
first().id

for table in ['table','names']:
table_object = db[table]
table_object.created_by.default = admin_user_id
table_object.modified_by.default = admin_user_id



On Friday, 24 July 2020 12:46:12 UTC+1, villas wrote:
>
> Did you try...
>
> db.locations.created_by.default = 1 # or 
> whateverdb.locations.modified_by.update = 1
> prior to:  import_from_csv_file
>
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/c7a44eb0-d464-4c46-a8de-51f8b72fa4d0o%40googlegroups.com.


[web2py] Re: login expiration time

2020-07-24 Thread villas
If you are using an iframe to display a page from the same app,  I have the 
impression that your design might be wrong. You will probably find a better 
way after you give this a little more thought. Sorry if this answer does 
not seem so helpful.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/36155787-351a-479c-8534-3c0c58e333dfo%40googlegroups.com.


[web2py] Re: Radio Buttons basic inline editing in SQLFORM.grid

2020-07-24 Thread villas
Are you sure you cannot use ajax?  I think that would be much easier.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/6648e088-8dbb-481a-975b-c66d87687fa0o%40googlegroups.com.


[web2py] Re: import_from_csv_file and auth.signature

2020-07-24 Thread villas
Did you try...

db.locations.created_by.default = 1 # or 
whateverdb.locations.modified_by.update = 1
prior to:  import_from_csv_file


-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/cff2e872-3944-455c-933c-a628be55a1bdo%40googlegroups.com.


[web2py] import_from_csv_file and auth.signature

2020-07-24 Thread David Orme
Hello,

I've got a table like this:

db._common_fields.append(auth.signature)

db.define_table('locations',
Field('title', 'string'),
Field('capacity', 'integer'),
Field('celcat_code', 'string'),
Field('is_external', 'boolean', default=False),
format = lambda row: f"{row.title}")

I'm trying to populate that with legacy data using:

filepath = os.path.join(request.folder, 'static', 'data', 
'teaching_staff.csv')

with open(filepath, encoding="utf8") as csvfile:
db.teaching_staff.import_from_csv_file(csvfile)

And I get a ticket:

IntegrityError(FOREIGN KEY constraint failed)

I think what is going on is that - because no-one is logged in when that 
import is run - the `auth.signature` fields are None and so that is the 
constraint that is failing. Is there a canonical way to handle this? I had 
a quick look at the code and couldn't see an option for inserting default 
values. I can write a loop and add default values myself to individual 
record inserts but is there a standard way?

Many thanks,
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/5ff89449-5883-4310-af1b-d419949acb84o%40googlegroups.com.


[web2py] Re: Radio Buttons basic inline editing in SQLFORM.grid

2020-07-24 Thread 'Matthew J Watts' via web2py-users
Hi jacob, i am trying to do the same thing, did you find a solution for 
this?

On Saturday, April 27, 2019 at 4:20:10 AM UTC+2 Jacob wrote:

> Thank you for the response it appears that they do have the same name . 
> I'm sorry I'm still new to programming in general, I've read around about 
> how to use append but I'm failing to understand how it can be applied to 
> the radio widget function which looks like this
>
>
>- def radio_widget(field,value,**kwargs):
>- return SQLFORM.widgets.radio.widget(field,value,**kwargs)
>
>
> Please if you are able to help guide me further I'll be very grateful. 
>
>
> Thursday, April 25, 2019 at 9:58:22 PM UTC+1, Dave S wrote:
>
>>
>>
>> On Wednesday, April 24, 2019 at 4:16:56 PM UTC-7, Jacob wrote:
>>>
>>> Hello I'm still new to web2py and I'm currently working on an a grid 
>>> which utilises basic inline editing using the example from 
>>> http://www.web2pyslices.com/slice/show/1928/basic-inline-editing-in-sqlformgrid-no-plugin-no-javascript
>>>  
>>>
>>> When I change the options widget to a radio widget for some reason only 
>>> one value for a whole set of seperate records can be selected rather than 
>>> each record having only 1 radio button field selected. In other words a 
>>> record has 4 possible values and they are displayed in a grid and can be 
>>> edited there is a field with a set which I'm trying to use radio buttons 
>>> for instead of a drop down menu. When I press a value for the first record 
>>> this is fine when I move onto the record beneath it the radio button value 
>>> is selected however the first one becomes empty and this carries on 
>>> throughout all the records on the grid only 1 field can be selected at a 
>>> time. If someone could help me please I would be very grateful.  
>>>
>>
>> My first thought is that you've got a bunch of buttons with the same 
>> name.  You can check this fairly easily by using your browser's inspect 
>> tool, and looking at the buttons for name=.  If that's the case, then 
>> you need to work out a way for each item's buttons to get a unique name; 
>> perhaps append item.id on the end of the name.
>>
>> /dps
>>  
>>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/8e48fbb0-488f-4f38-85e5-80eac0d0999an%40googlegroups.com.