Re: [web2py] DAL return all Fields

2018-05-01 Thread Maurice Waka
Thanks. Doing that already. On Tue, 1 May 2018, 18:55 Richard Vézina wrote: > I really recommand you to go through this book chapiter : > > http://web2py.com/books/default/chapter/29/02/the-python-language > > You will learn a lot of thing over which you fall right now. > > You also can use type

Re: [web2py] DAL return all Fields

2018-05-01 Thread Richard Vézina
Are you querying multiple table?? You can do a join... That way you will have all the value for every fields the only catch is that when you join to disambiguate fields names dal use table.field instead of just field as field name so it migth happen that if you call "manually" vs "programmatically"

Re: [web2py] DAL return all Fields

2018-05-01 Thread Maurice Waka
Thanks. It iterates well giving some fields data, but not all as needed. I get data from some 4 fields only. I have about 60 in some db. Plus there is this: On Tue, 1 May 2018, 16:44 Richard Vézina wrote: > for f, v in row: > > Should be > > for f, v in row.iteritems(): > > k, v for key, value,

Re: [web2py] DAL return all Fields

2018-05-01 Thread Richard Vézina
for f, v in row: Should be for f, v in row.iteritems(): k, v for key, value, but I use f instead of k because you will have field_name and value in this for loop... Richard On Mon, Apr 30, 2018 at 11:39 PM, Maurice Waka wrote: > What would f, v be. > I get this error : ValueError : too many

Re: [web2py] DAL return all Fields

2018-04-30 Thread Maurice Waka
What would f, v be. I get this error : ValueError : too many values to unpack On Mon, 30 Apr 2018, 20:38 Richard Vézina wrote: > > > On Mon, Apr 30, 2018 at 1:21 PM, Maurice Waka > wrote: > >> Sorry I tried to clarify by my new question : >> >> If I have a column with data like db.persons with

Re: [web2py] DAL return all Fields

2018-04-30 Thread Maurice Waka
Thank you. Let me work on it. Regards On Mon, 30 Apr 2018, 20:38 Richard Vézina wrote: > > > On Mon, Apr 30, 2018 at 1:21 PM, Maurice Waka > wrote: > >> Sorry I tried to clarify by my new question : >> >> If I have a column with data like db.persons with data like >> Carl >> Junior >> Maggie >>

Re: [web2py] DAL return all Fields

2018-04-30 Thread Richard Vézina
On Mon, Apr 30, 2018 at 1:21 PM, Maurice Waka wrote: > Sorry I tried to clarify by my new question : > > If I have a column with data like db.persons with data like > Carl > Junior > Maggie > Tom > Derrick > > And each column name has other fields with data such as: > persons.name persons.age per

Re: [web2py] DAL return all Fields

2018-04-30 Thread Maurice Waka
Sorry I tried to clarify by my new question : If I have a column with data like db.persons with data like Carl Junior Maggie Tom Derrick And each column name has other fields with data such as: persons.name persons.age persons.location persons.occupation persons.interests Carl 23 London Neuroscie

Re: [web2py] DAL return all Fields

2018-04-30 Thread Richard Vézina
Man this is convulated... Not sure what is in name4 "name4 is a list that contains items found in db.health.name, as well as other dbs." what items are you referring at?? What other dbs? Why are you connecting to sqlite by your own... This check is just weird : if id == item in name4: I would

Re: [web2py] DAL return all Fields

2018-04-28 Thread Maurice Waka
Thanks, but I seem to be having a challenge when returning the rows from a specific id name or number. I tried this on a different app as follows: Model: db.define_table( "health", Field('name', 'string'), Field('definition', 'text', length= 100, default="We'll

Re: [web2py] DAL return all Fields

2018-04-27 Thread Richard Vézina
for f in db.table.fields: print f or rows = db(db.fruits.id > 0).select(db.fruits.ALL) # ALL means all fields for r in rows: print(r) You can control which field you want with the previous example myfields = [f for f in db.table.fields if SOME_FILTERING_CHECK_OVER_THE_FIELD_YOU_WANT]

Re: [web2py] DAL return all Fields

2018-04-27 Thread Maurice Waka
Addendum I want a single list of the items (the data from all fields) regards On Fri, Apr 27, 2018 at 5:06 PM, Maurice Waka wrote: > There are several fields in my db such as this: > > db.define_table('fruit', Field('id', 'reference auth_user'), > Field('apple','boolean',label=T('Apple')),

[web2py] DAL return all Fields

2018-04-27 Thread Maurice Waka
There are several fields in my db such as this: db.define_table('fruit', Field('id', 'reference auth_user'), Field('apple','boolean',label=T('Apple')), Field('apricot','boolean',label=T('Apricot')), Field('cherry','boolean',label=T('Cherry')), Field('fig','boolean', label=T('Fig')), Field('lyc