[web2py] insert multiple records to a new db.table from an existing table

2016-03-10 Thread Yibing Liu
Hello everyone, I have an existing table named db.news. I want to insert multiple rows which are selected from the existing db.news to another table. My code is like following: news=db(db.news.id>=0).select(orderby=~db.news.release_time)[0:15] db.news_temp.truncate() db.news_temp.insert(news) Thi

[web2py] Re: how to call LOAD from one controller to access other with pagination as an example

2016-03-10 Thread Anthony
On Wednesday, March 9, 2016 at 11:32:46 PM UTC-5, Ron Chatterjee wrote: > > Later, I see. So, if I have to call a function within a function I need to > define the other one in the model. > No, that's not the case. You said you need to use the function in multiple controllers, so you cannot ther

[web2py] Re: insert multiple records to a new db.table from an existing table

2016-03-10 Thread Anthony
for row in news: db.news_temp.insert(**db.news_temp._filter_fields(row)) Anthony On Thursday, March 10, 2016 at 5:37:36 AM UTC-5, Yibing Liu wrote: > > Hello everyone, I have an existing table named db.news. I want to insert > multiple rows which are selected from the existing db.news to ano

[web2py] Re: Scheduler mysql error

2016-03-10 Thread Alfonso Serra
Ive tried on a paid account and it works even with that error. It might be the amount of processes limitation on free accounts. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/li

[web2py] Re: how to call LOAD from one controller to access other with pagination as an example

2016-03-10 Thread Ron Chatterjee
I was going to call the pagination from multiple controller. I have about 10 of them use pagination and tired of keep typing up the same over and over again and clutter the page. Okay...so, these what I understood so far: (1) I can make a call to pagination from multiple controller inside defau

[web2py] set difference using db

2016-03-10 Thread Paul Green
Does anyone know if there is a way to perform set difference (ie the elements in set A that are not in set B) using database queries / DAL? for example if you had some tables defined like this: db.define_table('thing', Field('name')) db.define_table('owns', Field('p

Re: Mensaje privado sobre: [web2py] Bunch/Batch/Bulk insert Re-use db.define_table field definition in SQLFORM.factory() ?

2016-03-10 Thread Richard Vézina
The basic concept of what you need is presented here : https://groups.google.com/d/msg/web2py/oiyOIC0IH04/6-NvVOJECU8J You just have to adapt it... Add more field and change field/table names, etc. But it does basically what you need... Richard On Wed, Mar 9, 2016 at 5:04 PM, Yoel Baez wrote:

[web2py] Re: Scheduler mysql error

2016-03-10 Thread Niphlod
given that scheduler auto imports definition, it doesn't know that you are using a custom adapter. On Thursday, March 10, 2016 at 3:02:54 PM UTC+1, Alfonso Serra wrote: > > Ive tried on a paid account and it works even with that error. > > It might be the amount of processes limitation on free ac

[web2py] Re: set difference using db

2016-03-10 Thread Jim S
Maybe something like this? (not tested) already_owns = db(db.owns.person == person_id)._select(db.owns.thing) things_not_owned = db(~db.thing.id.belongs(already_owns)).select() -Jim On Thursday, March 10, 2016 at 8:49:32 AM UTC-6, Paul wrote: > > Does anyone know if there is a way to perform

[web2py] Re: unable to see sqlite tables created through console using python console using gluon

2016-03-10 Thread Niphlod
IMHO you should read the manual. no rabbit holes included. On Thursday, March 10, 2016 at 1:11:12 AM UTC+1, Shayn Raney wrote: > > This is some rabbit hole, looks like I need to do the following for some > odd reason. > > db = DAL('sqlite://TestDB.sqlite', migrate_enabled=False) > > > > On Wed

[web2py] Re: set difference using db

2016-03-10 Thread Paul
works! Thanks Jim! On Thursday, March 10, 2016 at 9:55:33 AM UTC-5, Jim S wrote: > > Maybe something like this? (not tested) > > already_owns = db(db.owns.person == person_id)._select(db.owns.thing) > > things_not_owned = db(~db.thing.id.belongs(already_owns)).select() > > > -Jim > > On Thursday

Re: [web2py] bug in IS_NOT_EMPTY() ?

2016-03-10 Thread Richard Vézina
It turns out that the issue wasn't even related to IS_NOT_EMPTY()... Since the field wasn't include it couldn't block the form to submit... Though I may have the issue in other form where it is included.. What was the root cause of my issue was in fact (as far as I can understand) that the id fiel

[web2py] web2py pygal graph

2016-03-10 Thread kecajkecaj123
Hi Guys, Trying to draw some graphs using pygal and below link: http://www.web2pyslices.com/slice/show/1634/beauty-graphics-and-charts-with-pygal It works fine, but my view display only graph, without anything else included in the view e.g. headers, styling etc. Controller: def graph():

[web2py] Re: unable to see sqlite tables created through console using python console using gluon

2016-03-10 Thread Anthony
On Wednesday, March 9, 2016 at 6:06:45 PM UTC-5, Shayn Raney wrote: > > So I take it I need to redescribe the DB again using define_table()? Ok, > it works! So strange. I'm use to web.py SQL actions. > The DAL models let you do a lot more via Python than you can do with web.py, which is not

[web2py] Re: unable to see sqlite tables created through console using python console using gluon

2016-03-10 Thread Anthony
On Wednesday, March 9, 2016 at 7:11:12 PM UTC-5, Shayn Raney wrote: > > This is some rabbit hole, looks like I need to do the following for some > odd reason. > > db = DAL('sqlite://TestDB.sqlite', migrate_enabled=False) > > No, you shouldn't need to do that (unless you want to protect against

[web2py] Re: Fields from multiple tables in a single form

2016-03-10 Thread David Orme
Thanks for the help. I'm still working on this - I will come back with some code to show what worked for me - but just wanted to correct another typo in my code. The correct syntax for referencing other tables is not: Field('project_id', 'references projects') but: Field('project_id', 'refere

[web2py] Using writable=False fields in an onupdate function

2016-03-10 Thread David Orme
Hello, I'm trying to use a variable from a form in an onupdate function, but because I've set it to writeable=False in the controller, it doesn't get passed in form.vars. In more depth: I've got a table for volunteers to post offers of help on a project. Those have to be approved by an admin b

[web2py] Re: how to call LOAD from one controller to access other with pagination as an example

2016-03-10 Thread Anthony
On Thursday, March 10, 2016 at 9:35:08 AM UTC-5, Ron Chatterjee wrote: > > I was going to call the pagination from multiple controller. I have about > 10 of them use pagination and tired of keep typing up the same over and > over again and clutter the page. Okay...so, these what I understood so f

[web2py] Re: how to call LOAD from one controller to access other with pagination as an example

2016-03-10 Thread Ron Chatterjee
Thanks. On Thursday, March 10, 2016 at 2:13:21 PM UTC-5, Anthony wrote: > > On Thursday, March 10, 2016 at 9:35:08 AM UTC-5, Ron Chatterjee wrote: >> >> I was going to call the pagination from multiple controller. I have about >> 10 of them use pagination and tired of keep typing up the same ove

Re: [web2py] Using writable=False fields in an onupdate function

2016-03-10 Thread Richard Vézina
You can't get it in you onupdate function? You already retrieve auth_user row, so I guess instead of use form.vars instance for this piece of information... Though I am not sure what is exactly you problem... Richard On Thu, Mar 10, 2016 at 1:34 PM, David Orme wrote: > Hello, > > I'm trying t

Re: [web2py] Using writable=False fields in an onupdate function

2016-03-10 Thread Richard Vézina
Not complete my sentence : You already retrieve auth_user row, so I guess instead of use form.vars instance for this piece of information you can get it from auth_user row... On Thu, Mar 10, 2016 at 2:41 PM, Richard Vézina wrote: > You can't get it in you onupdate function? > > You already ret

[web2py] Re: for those of us who do not understand ...

2016-03-10 Thread Massimo Di Pierro
Here is another piece: http://mdipierro.github.io/stupid.css/widgets/index.html The work with web2py forms if you manually add the data-format and data-range. For example for e in form.elements('.datetime'): e['_data-format'] = '{DD}/{MM}/{year} {hh}:{mm}:{ss}' for e in form.elements('.do

[web2py] Re: Using writable=False fields in an onupdate function

2016-03-10 Thread David Orme
That's the problem - the auth_user row _can't_ be retrieved because form.vars.volunteer_id is None. -- 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 r

[web2py] Re: Using writable=False fields in an onupdate function

2016-03-10 Thread Dave S
On Thursday, March 10, 2016 at 12:01:47 PM UTC-8, David Orme wrote: > > That's the problem - the auth_user row _can't_ be retrieved because > form.vars.volunteer_id is None. > Is this one of the places you should set it in your controller before calling form.process()? In regular SQLFORM, tha

Re: [web2py] Re: Using writable=False fields in an onupdate function

2016-03-10 Thread Richard Vézina
Ok, your form is not over auth_user... Sorry fast reading does that... You can use session then... session.volunteer_id = db.table(row_id).volunteer_id Or You can passe it as request vars : URL(..., vars=dict(volunteer_id=db.table(row_id).volunteer_id)) Though, I am not sure you will be able

Re: [web2py] Re: Using writable=False fields in an onupdate function

2016-03-10 Thread Richard Vézina
If you use session be aware that the value you put in session will remain there for the duration of the session, so you need to carefully reset them or init them in order to not create bug... As Dave S mention SQLFORM() wouldn't maybe suffer from this issue as you can do that : form = SQLFORM(...

[web2py] Fetching date from database table into html form

2016-03-10 Thread Snehal Ashtekar
I had done this shown below Field('dob','date',requires = IS_DATE_IN_RANGE(format=T('%Y-%m-%d'), minimum=datetime.date(1980,1,1), maximum=datetime.date(2030,12,31), i am getting an error as-

[web2py] internet access issues

2016-03-10 Thread shoaib jan Jan
I am once again in trouble. I have installed Sahana in dell poweredge R410 Rake server . with public IP. Sahana EDEN as server installation framework is (Web2py webserver, PostgreSQL as the database, Cherokee. I have done some customizations as well. Now I need to know that after 3 or 4 days i

[web2py] Advice for small database on GAE

2016-03-10 Thread Brendan
Hi I have a web2py app on GAE at the moment that takes some of its data by parsing a hard coded string constant (at the moment, it has a half a dozen rows each with half a dozen or so columns). I plan to expand this to have dozens of rows and updated every couple of months with 3 or 4 more. I

[web2py] Re: Fetching date from database table into html form

2016-03-10 Thread Dave S
On Thursday, March 10, 2016 at 1:07:01 PM UTC-8, Snehal Ashtekar wrote: > > I had done this shown below > > Field('dob','date',requires = IS_DATE_IN_RANGE(format=T('%Y-%m-%d'), > > minimum=datetime.date(1980,1,1), >

[web2py] Re: internet access issues

2016-03-10 Thread Dave S
On Thursday, March 10, 2016 at 1:07:18 PM UTC-8, shoaib jan Jan wrote: > > I am once again in trouble. I have installed Sahana in dell poweredge > R410 Rake server . with public IP. Sahana EDEN as server installation > framework > is (Web2py webserver, PostgreSQL as the database, Cherokee. I h

[web2py] Re: How i can do a form factory 2 tables with bulkdata

2016-03-10 Thread Val K
Hi! 1. it is not quite clear for me, what is the goal of client/property fields? Are they search fields? 2. If you want user to fill/edit/del all these fields (without server interaction) and submit result at once - it's impossible without having some JS-coding 3. Your Bulk

[web2py] Not welcome app

2016-03-10 Thread Dave S
If I want to remove the welcome app from my server, and have a bare hostname URLto somewhere appropriate (rather than "invalid function"), I should set up routes.py? And in 2.13.4-stable, main.py L388 +/- is where the welcome app is made the default? /dps -- Resources: - http://web2py.com -

[web2py] Re: for those of us who do not understand ...

2016-03-10 Thread eric cuver
it's nice I am impressed Le jeudi 10 mars 2016 20:43:03 UTC+1, Massimo Di Pierro a écrit : > > Here is another piece: > > http://mdipierro.github.io/stupid.css/widgets/index.html > > The work with web2py forms if you manually add the data-format and > data-range. For example > > for e in form.ele

[web2py] Smartgrid search bar without dropdown search

2016-03-10 Thread rajjmatthur
Is there a way to show the smartgrid search bar without showing the dropdown search box? I find the dropdown search can be confusing. Like the grid with search and clear button but want to exclude the drop down menu that comes in below with =,<,>, +And, Or...etc. -- Resources: - http://w

[web2py] Re: for those of us who do not understand ...

2016-03-10 Thread Leonel Câmara
Massimo you need to detect mouseleave in the number slider widget. Otherwise I can click with the mouse drag a little bit, then keeping the left mouse button pressed leave the element and, finally, let the mouse button go. Now if my mouse (which has no buttons pressed at this time) even hovers

[web2py] Re: for those of us who do not understand ...

2016-03-10 Thread Massimo Di Pierro
another piece: http://mdipierro.github.io/stupid.css/themes/dashboard.html On Thursday, 10 March 2016 18:53:54 UTC-6, eric cuver wrote: > > it's nice I am impressed > > Le jeudi 10 mars 2016 20:43:03 UTC+1, Massimo Di Pierro a écrit : >> >> Here is another piece: >> >> http://mdipierro.github.io/

[web2py] Re: Not welcome app

2016-03-10 Thread Leonel Câmara
Yes, set routes.py in your web2py folder. A very simple routes.py for you can just be: routers = dict( BASE=dict( default_application='YourApplicationName', ), ) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source

[web2py] Re: for those of us who do not understand ...

2016-03-10 Thread Dave S
On Tuesday, March 8, 2016 at 4:01:00 PM UTC-8, Dave S wrote: > > > > On Tuesday, March 8, 2016 at 1:04:50 PM UTC-8, Massimo Di Pierro wrote: >> >> I would like to buy a .ham.burger >> http://mdipierro.github.io/stupid.css/themes/hamburger.html >> > > Oh, my! > I like the card divs you added (as

[web2py] Re: Not welcome app

2016-03-10 Thread Dave S
On Thursday, March 10, 2016 at 6:42:19 PM UTC-8, Leonel Câmara wrote: > > Yes, set routes.py in your web2py folder. > > A very simple routes.py for you can just be: > > routers = dict( > BASE=dict( > default_application='YourApplicationName', > ), > ) > > Thanks! /dps -- Res

[web2py] Re: Smartgrid search bar without dropdown search

2016-03-10 Thread Leonel Câmara
Yes give it advanced_search=False as a kwarg. You can then actually make the one input text box search pretty smart if the default isn't good enough for you. You can set searchable to a function where you build a nice query from the text with your knowledge of the domain. -- Resources: -

[web2py] storing the values into database from html form

2016-03-10 Thread Snehal Ashtekar
how to store the data from html form into database? -- 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 t