Re: [web2py] db.define_table Advanced Field

2015-12-10 Thread Massimiliano
Take a look here:

http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#One-to-many-relation

You will find that you need to set the *format* value for the table leader
just to inform web2py how to represent the record.

So in your example:

db.define_table(‘LEADER’,
… your fields,
format=‘%(yourfield)s’)


where *yourfield* is the LEADER’s field that you want to see instead the id.

Ciao

On Thu, Dec 10, 2015 at 1:35 AM, Alessandro Leonetti <
ale.leonett...@gmail.com> wrote:

> Good evening,
>
> I'm running into a problem quite uncomfortable but I'm pretty sure there
> is a fairly simple way to resolve it.
> I defined the various tables within my database and put them in relation
> with each other (one to many, many to many etc.).
> The problem is that when I insert a new record in a table that requires me
> to a field in another table, I have to specify that field in the record ID
> which will be linked to the record that I am creating.
>
> Example:
>
> Tables: Worker & Leader
> I want to specify, creating a new record in the table worker who is the
> head of the worker that I am entering:
>
> Name: BOB
> Surname: DYLAN
> Leader: 3 --> HOW DO I APPEAR TO A MENU 'CURTAIN FROM
> WHICH CAN CHOOSE ONE OF THE LEADERS ALREADY' INCLUDED IN THE DATABASE
> INSTEAD OF DOVER INSERT EXACT LEADER ID ???
>
> Dovrò specificare qualcosa all'interno di
> db.define_table('Worker',
> Field('Name',requires=IS_NOT_EMPTY()),
> Field('Surname',requires=IS_NOT_EMPTY()),
> Field('LEADER', db.LEADER ..
>)
> ?
>
> Thanks for any answers, it would be great if you could help me, I'm losing
> a lot of time!
>
> Best Regard and sorry for my disappointing english,
> Alessandro
>
> --
> 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.
>



-- 
Massimiliano

-- 
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] Accessing / connecting to web2py database with GUI

2015-12-10 Thread Sam Heather
Hi there,
Is it possible to access the Web2Py database remotely using a GUI tool? 
Web2Py doesn't seem to use the normal instance of mysql installed on the 
server - how can I find that instance and connect to it via an SSH tunnel 
using the SQL GUIs on my Mac? I don't want to have to write queries for the 
tiniest of maintenance changes...
Thanks!
Sam

-- 
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: Accessing / connecting to web2py database with GUI

2015-12-10 Thread Niphlod
if you're using sqlite, by default the file is stored under the databases/ 
directory of your app.


On Thursday, December 10, 2015 at 11:41:27 AM UTC+1, Sam Heather wrote:
>
> Hi there,
> Is it possible to access the Web2Py database remotely using a GUI tool? 
> Web2Py doesn't seem to use the normal instance of sqlite (which isn't 
> installed on the server) - how can I find that instance and connect to it 
> via an SSH tunnel using the SQL GUIs on my Mac? I don't want to have to 
> write queries for the tiniest of maintenance changes...
> Thanks!
> Sam
>

-- 
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: problem while adding a radio button in login form

2015-12-10 Thread Jonathan R
It's what I'm using right now (I can log with users from both servers) but 
I use the same credentials to process the queries that gather datas for my 
app (list of users, list of computers,...) and I need to know on which 
server the user is authenticated to in order to use the correct information 
for my queries.
I'm seeing 2 ways: 
- automatically determine which ldap_auth was successful (I posted a 
question on the group for this as I linked before in this thread)
- let the user decide and try auth only on the server the user chose.

but I can't get any of these to work.

On Wednesday, December 9, 2015 at 11:49:32 AM UTC-5, Richard wrote:
>
> What about setting 2 ldap authentication ?
>
> In web2py you can login with multiple login methods and web2py use them in 
> the order they are specified in auth.settings.login_methods... If password 
> fail for one it tries with the other...
>
> Here my settings :
> auth.settings.login_methods = \
> [auth,
>  ldap_auth(...)]
>
> You may try just to do :
> auth.settings.login_methods = \
> [ldap_auth(...),
>  ldap_auth(...)]
>
> You define you 2 differents ldap servers...
>
> Richard
>
>
>
> On Tue, Dec 8, 2015 at 4:19 PM, Jonathan R > 
> wrote:
>
>> I have two distinct sources of authentication ( 2 ldap servers) and I use 
>> the credentials provided by the user to perform the query that gather 
>> information on the ldap server on which the user is authenticated.
>> In an effort to follow the DRY concept my function that gather 
>> information can query both server and chose the correct one by using a 
>> boolean set to True for one server and False for the other. 
>> I asked another question on this group about the best way to determine 
>> which auth_method was successful (when using 
>> auth.settings.auth_methods[auth_ldap(server 1), auth_ldap(server2)]) but no 
>> one has provided an answer yet. 
>> That let me with the present option to customize the login form to let 
>> the user chose on which server launch the query.
>>
>> I asked about the variable storing the value before processing the form 
>> because I was exploring on the jQuery side ( onchange event) which doesn't 
>> seems to be able to do the job.
>>
>> I hope I clarified the situation :p
>>  
>> On Tuesday, December 8, 2015 at 3:18:04 PM UTC-5, Richard wrote:
>>>
>>> :)
>>>
>>> For what...
>>>
>>>
>>>
>>> On Tue, Dec 8, 2015 at 2:18 PM, Jonathan R  wrote:
>>>
 I need to have this radio button, 
 is there a variable that stores the value of the radio button before 
 processing the form ? 

 On Tuesday, December 8, 2015 at 11:03:40 AM UTC-5, Richard wrote:
>
> You should have a look at web2py auth... I guess no one really need to 
> customize login form... There is surely a way to customize it, and you 
> seems to have found a way... You may also, ask yourself about why you do 
> that and if you really need to do it... Or could it be crafted 
> differently... For instance would your user really want to change setting 
> at each login?? Maybe you can have a preference profile page for each 
> user 
> to them set there prefered way of login...
>
> Richard
>
> On Tue, Dec 8, 2015 at 10:56 AM, Jonathan R  wrote:
>
>> Yes I did, and nothing changed on the login screen, I still had None 
>> displayed instead of the radio button.
>>
>> I feel like there is a simple easy way to add a field in the login 
>> screen and save it but I can't see it...
>>
>>
>>
>>
>> On Monday, December 7, 2015 at 9:42:51 PM UTC-5, Richard wrote:
>>>
>>> Did you try by simply specify :

 Field('radio_button', ..., readable=True, writable=True)

>>>
>>> ?
>>>
>>> Richard
>>>
>>> On Mon, Dec 7, 2015 at 5:19 PM, Jonathan R  wrote:
>>>
 I successfully added the radio button i wanted on my login page but 
 instead of using a column in the auth_user table I only created a 
 radio 
 button that will assign its value in a session variable. To do so I 
 need to 
 modify the if form.accepts(): block to gather the value on submission 
 but 
 I'm not sure where to find this piece of code (or what should be in a 
 custom one to keep the authentication process working).

 my default.py :
 user():

 if request.args(0)== "login":
 form=auth()
 form.elements()[0].insert(0,LABEL('text1',_class='radioButton'))
 
 form.elements()[0].insert(0,INPUT(_type='radio',_class='radioButton',_value='text1'))
 #same for all values 

 #frest of the form (username and password) same as Richard 
 implementation
 
 return dict(form=form)

 [...]

 then if I want to gather the data in a session variable I'll have 
 to 

Re: [web2py] db.define_table Advanced Field

2015-12-10 Thread Anthony
On Thursday, December 10, 2015 at 3:48:44 AM UTC-5, Massimiliano wrote:
>
> Take a look here:
>
>
> http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#One-to-many-relation
>
> You will find that you need to set the *format* value for the table 
> leader just to inform web2py how to represent the record.
>
> So in your example:
>
> db.define_table(‘LEADER’,
> … your fields,
> format=‘%(yourfield)s’)
>
>
> where *yourfield* is the LEADER’s field that you want to see instead the 
> id.
>

Note, by specifying the "format" argument in the LEADER table definition, 
that will give you a default IS_IN_DB validator as well as a default 
"represent" function for any reference field that references the LEADER 
table. The IS_IN_DB validator itself is responsible for generating the 
select widget in forms.

Alternatively, you could explicitly define your own IS_IN_DB validator 
and/or "represent" function. You could also explicitly define your own form 
widget by specifying the "widget" argument in the field definition.

All of these options are documented in the book.

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: How does auth.signature work? deletion of inactive records

2015-12-10 Thread Anthony
Can you show your Auth setup code. Merely adding auth.signature to a table 
should not enable record versioning nor result in deleted records merely 
being marked inactive. Rather, you must explicitly enable record 
versioning. If you enable record versioning and the versioned table 
contains an "is_active" field, then deleted records will not be deleted but 
instead marked as inactive. If you want record versioning but do not want 
to preserve deleted records, then you can simply make sure there is no 
"is_active" field in the table. You won't be able to use auth.signature as 
is, as it includes the "is_active" field, but you could do something like 
this:

signature_fields = [f for f in auth.signature if f.name != 'is_active']

And then add signature_fields to your tables.

Anthony

On Wednesday, December 9, 2015 at 1:17:17 AM UTC-5, at wrote:
>
> Hi,
>
> I am unable to find explanation of how does auth.signature works anywhere 
> including web2py documentation. I can see that after adding it to a 
> database table definition, it starts maintaining a revision history of the 
> records. I've also seen that deletion of a record does not actually delete 
> it from the database but it is marked as inactive; what is the recommended 
> way or configuration that allows me delete the *inactive* records from 
> the database?
>
> Thanks,
> AT
>

-- 
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: problem while adding a radio button in login form

2015-12-10 Thread Richard Vézina
So, I see 2 options :
1) Define a common user that has the required level of access to both ldap
server so you can query both server doesn't matter which server user are
autheticated to...
2) Use user credentials to access data you need... This is actually is not
actually what ldap_auth is doing, but once ldap_auth has grant access to
user, you may then spawn other query to ldap server using user credentials
which you know that are correct... You can then update what ever you want
in your database from ldap_auth since it already has db available inside
the module. Though this requires more work since it is not working out of
the box, you have to code that inside ldap_auth yourself... Which even if
you code it as another module and import it, you will have to modify
ldap_auth contrib each time you upgrade web2py, since your hack will surely
not make it to the contrib as it is to specific...

Option 1 is the best to me... There is even option 0 which could be to have
only one LDAP instance, since having more then one inside the same
organisation is to me a non sens and goes against the idea of role of LDAP
instance...

Richard

On Thu, Dec 10, 2015 at 11:50 AM, Jonathan R  wrote:

> It's what I'm using right now (I can log with users from both servers) but
> I use the same credentials to process the queries that gather datas for my
> app (list of users, list of computers,...) and I need to know on which
> server the user is authenticated to in order to use the correct information
> for my queries.
> I'm seeing 2 ways:
> - automatically determine which ldap_auth was successful (I posted a
> question on the group for this as I linked before in this thread)
> - let the user decide and try auth only on the server the user chose.
>
> but I can't get any of these to work.
>
> On Wednesday, December 9, 2015 at 11:49:32 AM UTC-5, Richard wrote:
>>
>> What about setting 2 ldap authentication ?
>>
>> In web2py you can login with multiple login methods and web2py use them
>> in the order they are specified in auth.settings.login_methods... If
>> password fail for one it tries with the other...
>>
>> Here my settings :
>> auth.settings.login_methods = \
>> [auth,
>>  ldap_auth(...)]
>>
>> You may try just to do :
>> auth.settings.login_methods = \
>> [ldap_auth(...),
>>  ldap_auth(...)]
>>
>> You define you 2 differents ldap servers...
>>
>> Richard
>>
>>
>>
>> On Tue, Dec 8, 2015 at 4:19 PM, Jonathan R  wrote:
>>
>>> I have two distinct sources of authentication ( 2 ldap servers) and I
>>> use the credentials provided by the user to perform the query that gather
>>> information on the ldap server on which the user is authenticated.
>>> In an effort to follow the DRY concept my function that gather
>>> information can query both server and chose the correct one by using a
>>> boolean set to True for one server and False for the other.
>>> I asked another question on this group about the best way to determine
>>> which auth_method was successful (when using
>>> auth.settings.auth_methods[auth_ldap(server 1), auth_ldap(server2)]) but no
>>> one has provided an answer yet.
>>> That let me with the present option to customize the login form to let
>>> the user chose on which server launch the query.
>>>
>>> I asked about the variable storing the value before processing the form
>>> because I was exploring on the jQuery side ( onchange event) which doesn't
>>> seems to be able to do the job.
>>>
>>> I hope I clarified the situation :p
>>>
>>> On Tuesday, December 8, 2015 at 3:18:04 PM UTC-5, Richard wrote:

 :)

 For what...



 On Tue, Dec 8, 2015 at 2:18 PM, Jonathan R  wrote:

> I need to have this radio button,
> is there a variable that stores the value of the radio button before
> processing the form ?
>
> On Tuesday, December 8, 2015 at 11:03:40 AM UTC-5, Richard wrote:
>>
>> You should have a look at web2py auth... I guess no one really need
>> to customize login form... There is surely a way to customize it, and you
>> seems to have found a way... You may also, ask yourself about why you do
>> that and if you really need to do it... Or could it be crafted
>> differently... For instance would your user really want to change setting
>> at each login?? Maybe you can have a preference profile page for each 
>> user
>> to them set there prefered way of login...
>>
>> Richard
>>
>> On Tue, Dec 8, 2015 at 10:56 AM, Jonathan R  wrote:
>>
>>> Yes I did, and nothing changed on the login screen, I still had None
>>> displayed instead of the radio button.
>>>
>>> I feel like there is a simple easy way to add a field in the login
>>> screen and save it but I can't see it...
>>>
>>>
>>>
>>>
>>> On Monday, December 7, 2015 at 9:42:51 PM UTC-5, Richard wrote:

 Did you try by simply specify :
>
> Field('radio_button', ..., readable=Tru

[web2py] Re: Pyodel announcement

2015-12-10 Thread Richard D
I / We will  extend the goodies.

On Thursday, December 10, 2015 at 5:54:23 AM UTC+1, Massimo Di Pierro wrote:
>
> This was built by some of my students. It is incomplete but has lots of 
> goodies.
>
> On Wednesday, 9 December 2015 14:53:33 UTC-6, Richard D wrote:
>>
>> Hi,
>>
>> Some years ago a discussion took place about a LMS. Since then Alan Etkin 
>> has created Pyodel.
>> I contacted Alan and decided to take this project forward.
>>
>> A Github repo https://github.com/RichDijk/pyodel is created for code 
>> management.
>>
>> This is the initial version which is exact like the last version from the 
>> Google code repo.
>>
>> A Google group has been created for collaboration 
>> https://groups.google.com/forum/#!forum/pyodel
>>
>> My idea is to create designs and builds of small parts. Because of this 
>> Pyodel will not be fully functional for quite a while, parts will be 
>> perfect.
>> A major challange is the content format. Will we use SCORM, rest of a new 
>> JSON based format?
>>
>> Hope to see you on Pyodel.
>>
>> Richard Dijkstra
>>
>

-- 
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] Unable to make primary/unique

2015-12-10 Thread Jitun John
Hi,

I am trying to create a table which accepts log files.
One of the entries that should be unique is log path. No Duplicate entries.

db.define_table('logs_db',
Field('case_num', requires=IS_NOT_EMPTY()),
Field('case_desc',),
Field('log_gen_time', writable=False, readable=False),
Field('log_uniq_name', writable=False, readable=False, 
unique=True),
Field('log_path', unique=True, requires=IS_NOT_EMPTY()),
auth.signature)


I am now using the above format.
Even with unique=True  The form gets submitted.
I would have liked the form to be able to check if there is another entry 
for log_path, but it doesn't.
I have tried *primarykey=['log_path'] *as well, but to no affect.

I am using SQLite.


-- 
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: Unable to make primary/unique

2015-12-10 Thread Anthony
>From the book:

Notice that requires=... is enforced at the level of forms, required=True 
is enforced at the level of the DAL (insert), while notnull, unique and 
ondelete are enforced at the level of the database. While they sometimes 
may seem redundant, it is important to maintain the distinction when 
programming with the DAL.

"unique" is enforced by the database and has nothing to do with forms. If 
you want validation of form input with nice error messages displayed in the 
form, you must use validators, documented in the Forms chapter. In this 
case, you want requires=IS_NOT_IN_DB(...).

Anthony

On Thursday, December 10, 2015 at 12:58:28 PM UTC-5, Jitun John wrote:
>
> Hi,
>
> I am trying to create a table which accepts log files.
> One of the entries that should be unique is log path. No Duplicate entries.
>
> db.define_table('logs_db',
> Field('case_num', requires=IS_NOT_EMPTY()),
> Field('case_desc',),
> Field('log_gen_time', writable=False, readable=False),
> Field('log_uniq_name', writable=False, readable=False, 
> unique=True),
> Field('log_path', unique=True, requires=IS_NOT_EMPTY()),
> auth.signature)
>
>
> I am now using the above format.
> Even with unique=True  The form gets submitted.
> I would have liked the form to be able to check if there is another entry 
> for log_path, but it doesn't.
> I have tried *primarykey=['log_path'] *as well, but to no affect.
>
> I am using SQLite.
>
>
>

-- 
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] Form DOM: Search selected option's text

2015-12-10 Thread Val K
Hi!
It just to help others

I wasted a pair hours to find  right matching expression for searching 
selected option's  *text*-value (not key-value ). It must be like:

selected_opt_text = form.element('[name=my_select_field_name]  option[
*selected=selected*]')[0]

just *'... option[selected]'* matches *any* option  in web2py, but work 
properly in JQuery (HTML5 at least).


-- 
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] Problem with Field UNIQUE when i'll edit

2015-12-10 Thread argenio . bosanto
I have one table in my mysql db with name "users" with this:
id - name - email
1 - luis - exam...@gmail.com
2 - steff - he...@gmail.com

the field email is unique in the DAL 
Field('email', 'string', length=255, required=True, notnull=True, 
unique=True),
 

when i try to edit the form, I only change my name, but the email it's the 
same, ok perfect,
I send 2 parameters, name is diferent and email it's the same in this case 
in the bd.
id: 1, name: pepe, email: exam...@gmail.com

result = db(db.users.id == 
params["id"]).validate_and_update(**db.users._filter_fields(params)).as_dict()

i search the register with the id, perfect, but when "update the email" i 
got the error

 (1062, u"Duplicate entry 
' exam...@gmail.com' for key 'email_UNIQUE'")

because "exam...@gmail.com exist in the databases BUT IS THAT REGISTER 
WHERE IS THE SAME! and I PUT THE SAME!

maybe you reply if don't have change the register, delete the params and 
don't send to DAL and when change send it.
that's it's not a good practice, because when i really change the email get 
code innecesary. and I need detecte the change in front page, (ios, 
andriod, web, etc) 

now, how can i solved my problems? 

I have one solutions but i don't like:
search the register in DB, read the field email and is the same delete 
params and dont send to insert and it's diferente send.
BUT that generate one petition aditional to the server

summarized: I check manually the unique in db.

Please I need help, thx very much
note: I dont talk good the english.




-- 
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: Handle runtimeErrors with try/except

2015-12-10 Thread argenio . bosanto
Ok i understand that, but if my service of mysql is SHUTDOWN, i need one 
exepction for that! because generate one traceback, and I need handle this, 
maybe return one string saying "mysql its shutdown, page 404"

-- 
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: Accessing / connecting to web2py database with GUI

2015-12-10 Thread Dave S


On Thursday, December 10, 2015 at 3:42:09 AM UTC-8, Niphlod wrote:
>
> if you're using sqlite, by default the file is stored under the databases/ 
> directory of your app.
>
>
And for a shell running on the webserver machine, cd to that directory 
allows you to use the standard SQLite3 command line tool.  I've not tried 
GUI tools, but I can vouch that SQLite3 seems happy (Fedora 16, Centos 65, 
and Windows 7 so far).

/dps


> On Thursday, December 10, 2015 at 11:41:27 AM UTC+1, Sam Heather wrote:
>>
>> Hi there,
>> Is it possible to access the Web2Py database remotely using a GUI tool? 
>> Web2Py doesn't seem to use the normal instance of sqlite (which isn't 
>> installed on the server) - how can I find that instance and connect to it 
>> via an SSH tunnel using the SQL GUIs on my Mac? I don't want to have to 
>> write queries for the tiniest of maintenance changes...
>> Thanks!
>> Sam
>>
>

-- 
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: Accessing / connecting to web2py database with GUI

2015-12-10 Thread Sam Heather
Thanks for the tip. I'm specifically looking for a GUI, but as far as I can
tell you have to install one on the local server - it can't be done
remotely without downloading the db, editing it, and re-uploading it :(
Kinda a shame - doesn't seem a very scalable way of making small tweaks.
ᐧ

On 10 December 2015 at 21:26, Dave S  wrote:

>
>
> On Thursday, December 10, 2015 at 3:42:09 AM UTC-8, Niphlod wrote:
>>
>> if you're using sqlite, by default the file is stored under the
>> databases/ directory of your app.
>>
>>
> And for a shell running on the webserver machine, cd to that directory
> allows you to use the standard SQLite3 command line tool.  I've not tried
> GUI tools, but I can vouch that SQLite3 seems happy (Fedora 16, Centos 65,
> and Windows 7 so far).
>
> /dps
>
>
>> On Thursday, December 10, 2015 at 11:41:27 AM UTC+1, Sam Heather wrote:
>>>
>>> Hi there,
>>> Is it possible to access the Web2Py database remotely using a GUI tool?
>>> Web2Py doesn't seem to use the normal instance of sqlite (which isn't
>>> installed on the server) - how can I find that instance and connect to it
>>> via an SSH tunnel using the SQL GUIs on my Mac? I don't want to have to
>>> write queries for the tiniest of maintenance changes...
>>> Thanks!
>>> Sam
>>>
>> --
> 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/BPyJ8zCFvec/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.
>



-- 
*Sam Heather* | m: +44 7585 441757 <00447585441757> | e: s...@heather.sh

-- 
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: Accessing / connecting to web2py database with GUI

2015-12-10 Thread Dave S
On Thursday, December 10, 2015 at 2:38:23 PM UTC-8, Sam Heather wrote:
>
> Thanks for the tip. I'm specifically looking for a GUI, but as far as I 
> can tell you have to install one on the local server - it can't be done 
> remotely without downloading the db, editing it, and re-uploading it :(
> Kinda a shame - doesn't seem a very scalable way of making small tweaks.
> ᐧ
>

What sort of small tweaks are you interested in? If you're adding/deleting 
records or editing them, the appadmin page can provide that, and with the 
right https settings you can do that remotely.  If you're changing the 
field properties, then you'd be editing the model files and using the 
migrate settings.

/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.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Accessing / connecting to web2py database with GUI

2015-12-10 Thread Sam Heather
Just the kind of tweaks where I might want to edit a value. I'm trying to
allow that kind of admin access to non-techies who don't know SQL, so the
kind of GUI that allows them to view the database like a spreadsheet (as is
available for MySQL) would ideal. I read I can actually switch Web2PY to
use proper SQL instead of SQLite here

 is that correct?
Sam
ᐧ

On 10 December 2015 at 22:54, Dave S  wrote:

> On Thursday, December 10, 2015 at 2:38:23 PM UTC-8, Sam Heather wrote:
>>
>> Thanks for the tip. I'm specifically looking for a GUI, but as far as I
>> can tell you have to install one on the local server - it can't be done
>> remotely without downloading the db, editing it, and re-uploading it :(
>> Kinda a shame - doesn't seem a very scalable way of making small tweaks.
>> ᐧ
>>
>
> What sort of small tweaks are you interested in? If you're adding/deleting
> records or editing them, the appadmin page can provide that, and with the
> right https settings you can do that remotely.  If you're changing the
> field properties, then you'd be editing the model files and using the
> migrate settings.
>
> /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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/BPyJ8zCFvec/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.
>



-- 
*Sam Heather* | m: +44 7585 441757 <00447585441757> | e: s...@heather.sh

-- 
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: Accessing / connecting to web2py database with GUI

2015-12-10 Thread Dave S


On Thursday, December 10, 2015 at 3:03:23 PM UTC-8, Sam Heather wrote:
>
> Just the kind of tweaks where I might want to edit a value. I'm trying to 
> allow that kind of admin access to non-techies who don't know SQL, so the 
> kind of GUI that allows them to view the database like a spreadsheet (as is 
> available for MySQL) would ideal. I read I can actually switch Web2PY to 
> use proper SQL instead of SQLite here 
>  
>  is that correct?  
>

Web2Py works with several databases, and the common relational databases 
with SQL interfaces (MySQL, Postgres, Oracle, and the Windders one) are 
frequently used underneath Web2Py.  SQLite3 is just the one shipped "in the 
box".  Postgres seems to be the one most favored for production databases, 
if you have a choice.  For such databases, the actual storage will probably 
not be in your application directory.

SQLite3 is a fairly robustly featured DB, but is best suited for small 
databases and development work.  All of my current efforts fit into that 
description; my only use of Postgres was where I didn't have to set up the 
server.

But before you go running around looking for Big Iron to set your DB up on, 
note that the AppAdmin interface allows values to be exported and imported 
as CSV files which your users can edit in a spreadsheet; worksfor all 
backends.  If this sort of maintenance is frequent, though, it might be 
just as well to provide a form (like using SQLFORM and SQLFORM.grid) that 
make it easy for them to *find* and *edit* the values of interest.  Such a 
form would work with any of the backends.

/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.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Accessing / connecting to web2py database with GUI

2015-12-10 Thread Dave S


On Thursday, December 10, 2015 at 3:39:07 PM UTC-8, Dave S wrote:
>
> [...] 

SQLite3 is a fairly robustly featured DB, but is best suited for small 
> databases and development work.  


Note that this has to do with scaling, not features.  It's built to use a 
conventional filesystem, and uses a more global locking scheme than the DBs 
built for heavy parallel access.

/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.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Accessing / connecting to web2py database with GUI

2015-12-10 Thread Richard Vézina
The purpose of web2py is not actually to build form to
create/update/read/deletet database value?

If you want to connect to another database then the default one that is
definte in application/welcome/models/db.py connection string which should
be sqlite if you don't have change the welcome app, you can user another
database engine by using the appropriate connection string...

Doc here :
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Connection-strings--the-uri-parameter-

You will have to define your database schema into web2py models...

Doc here :
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Table-constructor

Then chapter 7 of the book will allow you to learn how create a simple form
with database

Richard

On Thu, Dec 10, 2015 at 6:02 PM, Sam Heather  wrote:

> Just the kind of tweaks where I might want to edit a value. I'm trying to
> allow that kind of admin access to non-techies who don't know SQL, so the
> kind of GUI that allows them to view the database like a spreadsheet (as is
> available for MySQL) would ideal. I read I can actually switch Web2PY to
> use proper SQL instead of SQLite here
> 
>  is that correct?
> Sam
> ᐧ
>
> On 10 December 2015 at 22:54, Dave S  wrote:
>
>> On Thursday, December 10, 2015 at 2:38:23 PM UTC-8, Sam Heather wrote:
>>>
>>> Thanks for the tip. I'm specifically looking for a GUI, but as far as I
>>> can tell you have to install one on the local server - it can't be done
>>> remotely without downloading the db, editing it, and re-uploading it :(
>>> Kinda a shame - doesn't seem a very scalable way of making small tweaks.
>>> ᐧ
>>>
>>
>> What sort of small tweaks are you interested in? If you're
>> adding/deleting records or editing them, the appadmin page can provide
>> that, and with the right https settings you can do that remotely.  If
>> you're changing the field properties, then you'd be editing the model files
>> and using the migrate settings.
>>
>> /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 a topic in the
>> Google Groups "web2py-users" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/web2py/BPyJ8zCFvec/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.
>>
>
>
>
> --
> *Sam Heather* | m: +44 7585 441757 <00447585441757> | e: s...@heather.sh
>
> --
> 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] SELinux and web2py

2015-12-10 Thread Mark Graves
Has anyone got any experience with selinux file permissions and web2py?

Somehow my sessions are not writing for the admin app but they are for the 
welcome app...

-Mark

-- 
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] SELinux and web2py

2015-12-10 Thread Richard Vézina
Have you look to the welcome app user?

ls -al

Then

chown -Rf same_welcome_app_user:same_welcome_app_user

Richard

On Thu, Dec 10, 2015 at 7:50 PM, Mark Graves  wrote:

> Has anyone got any experience with selinux file permissions and web2py?
>
> Somehow my sessions are not writing for the admin app but they are for the
> welcome app...
>
> -Mark
>
> --
> 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.


Re: [web2py] SELinux and web2py

2015-12-10 Thread Richard Vézina
with ubuntu the default owner for web server content is www-data

Richard

On Thu, Dec 10, 2015 at 8:02 PM, Richard Vézina  wrote:

> Have you look to the welcome app user?
>
> ls -al
>
> Then
>
> chown -Rf same_welcome_app_user:same_welcome_app_user
>
> Richard
>
> On Thu, Dec 10, 2015 at 7:50 PM, Mark Graves  wrote:
>
>> Has anyone got any experience with selinux file permissions and web2py?
>>
>> Somehow my sessions are not writing for the admin app but they are for
>> the welcome app...
>>
>> -Mark
>>
>> --
>> 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.


Re: [web2py] SELinux and web2py

2015-12-10 Thread Mark Graves
Its centos.  I'll check that now.  Its owned by apache

On Thu, Dec 10, 2015 at 7:04 PM, Richard Vézina  wrote:

> with ubuntu the default owner for web server content is www-data
>
> Richard
>
> On Thu, Dec 10, 2015 at 8:02 PM, Richard Vézina <
> ml.richard.vez...@gmail.com> wrote:
>
>> Have you look to the welcome app user?
>>
>> ls -al
>>
>> Then
>>
>> chown -Rf same_welcome_app_user:same_welcome_app_user
>>
>> Richard
>>
>> On Thu, Dec 10, 2015 at 7:50 PM, Mark Graves  wrote:
>>
>>> Has anyone got any experience with selinux file permissions and web2py?
>>>
>>> Somehow my sessions are not writing for the admin app but they are for
>>> the welcome app...
>>>
>>> -Mark
>>>
>>> --
>>> 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/SKPQ0DbCguE/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] SELinux and web2py

2015-12-10 Thread Mark Graves
Same permissions =(

On Thu, Dec 10, 2015 at 7:05 PM, Mark Graves  wrote:

> Its centos.  I'll check that now.  Its owned by apache
>
> On Thu, Dec 10, 2015 at 7:04 PM, Richard Vézina <
> ml.richard.vez...@gmail.com> wrote:
>
>> with ubuntu the default owner for web server content is www-data
>>
>> Richard
>>
>> On Thu, Dec 10, 2015 at 8:02 PM, Richard Vézina <
>> ml.richard.vez...@gmail.com> wrote:
>>
>>> Have you look to the welcome app user?
>>>
>>> ls -al
>>>
>>> Then
>>>
>>> chown -Rf same_welcome_app_user:same_welcome_app_user
>>>
>>> Richard
>>>
>>> On Thu, Dec 10, 2015 at 7:50 PM, Mark Graves 
>>> wrote:
>>>
 Has anyone got any experience with selinux file permissions and web2py?

 Somehow my sessions are not writing for the admin app but they are for
 the welcome app...

 -Mark

 --
 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/SKPQ0DbCguE/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] SELinux and web2py

2015-12-10 Thread Richard Vézina
Nop :

ls -Z

Should provide extended attribute : -rw-r--r--  root root
system_u:object_r:etc_t  /etc/passwd

Sorry in french :
https://fr.wikipedia.org/wiki/SELinux

I check english one and there where not this example...

Then I don't know how you chage these exented attribute, there surely other
exented command for that

:D

Richard

On Thu, Dec 10, 2015 at 8:07 PM, Mark Graves  wrote:

> Same permissions =(
>
> On Thu, Dec 10, 2015 at 7:05 PM, Mark Graves  wrote:
>
>> Its centos.  I'll check that now.  Its owned by apache
>>
>> On Thu, Dec 10, 2015 at 7:04 PM, Richard Vézina <
>> ml.richard.vez...@gmail.com> wrote:
>>
>>> with ubuntu the default owner for web server content is www-data
>>>
>>> Richard
>>>
>>> On Thu, Dec 10, 2015 at 8:02 PM, Richard Vézina <
>>> ml.richard.vez...@gmail.com> wrote:
>>>
 Have you look to the welcome app user?

 ls -al

 Then

 chown -Rf same_welcome_app_user:same_welcome_app_user

 Richard

 On Thu, Dec 10, 2015 at 7:50 PM, Mark Graves 
 wrote:

> Has anyone got any experience with selinux file permissions and web2py?
>
> Somehow my sessions are not writing for the admin app but they are for
> the welcome app...
>
> -Mark
>
> --
> 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/SKPQ0DbCguE/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] Change font size form from the user input

2015-12-10 Thread vanvan
I am trying to change the font-size of forms as they look too small for the 
user input. I am only using forms for sign-up/sign-in but would just like 
to change them. I am trying to change from  user.html but the form font 
size won't change. 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.


[web2py] Re: How does auth.signature work? deletion of inactive records

2015-12-10 Thread Massimo Di Pierro
No. By using auth.signature a deleted field is still deleted. 
auth.signature simply add extra fields. If you use a signature AND you 
auth.enable_record_versioning(db)  then records are never deleted because 
it keeps all the history.

On Wednesday, 9 December 2015 23:48:45 UTC-6, at wrote:
>
> Thank you Massimo.
>
> One quick question: When we use auth.signature, and then delete records in 
> a table, they are marked as deleted but they are not actually deleted from 
> the database. What is the recommended way to delete such records from the 
> database?
>
> Best Regards,
> AT
>
> On Thursday, 10 December 2015 09:35:15 UTC+5, Massimo Di Pierro wrote:
>>
>> It is well hidden 
>> n
>>
>> http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer?search=auth.signature#Table-inheritance
>>
>> On Wednesday, 9 December 2015 00:17:17 UTC-6, at wrote:
>>>
>>> Hi,
>>>
>>> I am unable to find explanation of how does auth.signature works 
>>> anywhere including web2py documentation. I can see that after adding it to 
>>> a database table definition, it starts maintaining a revision history of 
>>> the records. I've also seen that deletion of a record does not actually 
>>> delete it from the database but it is marked as inactive; what is the 
>>> recommended way or configuration that allows me delete the *inactive* 
>>> records from the database?
>>>
>>> Thanks,
>>> AT
>>>
>>

-- 
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: Form DOM: Search selected option's text

2015-12-10 Thread Massimo Di Pierro
good catch! Please open a bug report. we aim to make the element(..) args 
as compatible as possible to jQuery.

On Thursday, 10 December 2015 14:10:01 UTC-6, Val K wrote:
>
> Hi!
> It just to help others
>
> I wasted a pair hours to find  right matching expression for searching 
> selected option's  *text*-value (not key-value ). It must be like:
>
> selected_opt_text = form.element('[name=my_select_field_name]  option[
> *selected=selected*]')[0]
>
> just *'... option[selected]'* matches *any* option  in web2py, but work 
> properly in JQuery (HTML5 at least).
>
>
>

-- 
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: Unable to make primary/unique

2015-12-10 Thread Jitun John
Thanks Anthony.

On Friday, December 11, 2015 at 12:01:41 AM UTC+5:30, Anthony wrote:
>
> From the book:
>
> Notice that requires=... is enforced at the level of forms, required=True 
> is enforced at the level of the DAL (insert), while notnull, unique and 
> ondelete are enforced at the level of the database. While they sometimes 
> may seem redundant, it is important to maintain the distinction when 
> programming with the DAL.
>
> "unique" is enforced by the database and has nothing to do with forms. If 
> you want validation of form input with nice error messages displayed in the 
> form, you must use validators, documented in the Forms chapter. In this 
> case, you want requires=IS_NOT_IN_DB(...).
>
> Anthony
>
> On Thursday, December 10, 2015 at 12:58:28 PM UTC-5, Jitun John wrote:
>>
>> Hi,
>>
>> I am trying to create a table which accepts log files.
>> One of the entries that should be unique is log path. No Duplicate 
>> entries.
>>
>> db.define_table('logs_db',
>> Field('case_num', requires=IS_NOT_EMPTY()),
>> Field('case_desc',),
>> Field('log_gen_time', writable=False, readable=False),
>> Field('log_uniq_name', writable=False, readable=False, 
>> unique=True),
>> Field('log_path', unique=True, requires=IS_NOT_EMPTY()),
>> auth.signature)
>>
>>
>> I am now using the above format.
>> Even with unique=True  The form gets submitted.
>> I would have liked the form to be able to check if there is another entry 
>> for log_path, but it doesn't.
>> I have tried *primarykey=['log_path'] *as well, but to no affect.
>>
>> I am using SQLite.
>>
>>
>>

-- 
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: SQLFORM.grid custom buttons text

2015-12-10 Thread Анатолий Стешенко
This way change all SQLFORM.grid, so its not good enough, because i have 
more then one SQLFORM.grid, which i want to change.
I was found next
try:
for x in grid.elements('span.buttontext'):
if x.components[0] == "Edit":
x.components[0] = "Custom edit"
except Exception : pass

Its work, but i dont sure that its True way.

четверг, 10 декабря 2015 г., 8:27:48 UTC+3 пользователь Massimo Di Pierro 
написал:
>
> One way is to use internationalization. Make an en.py language file and 
> translate the strings anyway one want, using the admin languages tab. No 
> coding required.
>
>
> On Wednesday, 9 December 2015 22:57:39 UTC-6, Анатолий Стешенко wrote:
>>
>> Good day. How i can change text of buttons of the SQLFORM.grid?
>> For example i want to change "Add Record" to "Add new item","View" to 
>> "Show details".
>>
>

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