[web2py] Re: Searching by date using SQLFORM.factory

2020-02-19 Thread Alex Beskopilny
import cPickle, os def put_on_disk(file_name, data): uploadfolder=os.path.join(request.folder, 'uploads') fn = os.path.join(uploadfolder, file_name) out_file = open(fn, 'w') cPickle.dump(data, out_file) out_file.close() def get_from_disk(file_name):

[web2py] Re: Searching by date using SQLFORM.factory

2020-02-19 Thread mostwanted
I have decided to make rows a session variable but I am not sure if this is a good idea! def search(): form = SQLFORM.factory( Field("start_date", type="date"), Field("end_date", type="date")) if form.process().accepted: q = ((db.birthdays.bornday >= form.vars.start_date)

[web2py] Re: Searching by date using SQLFORM.factory

2020-02-19 Thread mostwanted
I figured it out, initially I was getting an error, it told me that I can not split the date, then i did this: def search(): form = SQLFORM.factory( Field("start_date", type="date"), Field("end_date", type="date")) if form.process().accepted: q = ((db.birthdays.bornday >=

[web2py] Re: Searching by date using SQLFORM.factory

2020-02-19 Thread Clemens
Hi, is your problem receiving no result or the wrong result? How is the table definition of your birthday table and why is the birthday not just a field a corresponding person table? Best regards Clemens On Wednesday, February 19, 2020 at 10:49:11 PM UTC+1, mostwanted wrote: > > I'm trying

[web2py] Searching by date using SQLFORM.factory

2020-02-19 Thread mostwanted
I'm trying to use SQLFORM.factory to search by date but its failing, it is somehow possible to that & i'm missing something?? If so where can i rectify my code to give me results? *MY FUNCTION* def search(): form=SQLFORM.factory(Field('SEARCH', 'date') if form.accepts(request):

[web2py] Re: py4web and record versioning

2020-02-19 Thread Carlos Hanson
It looks like table inheritance is affected by the same issue: monster = db.Table(db, 'monster', Field('color'), Field('size')) db.define_table('thing', Field('name'), monster) The following traceback is the same as the error using _enable_record_versioning() starting at *table =

[web2py] Mail in separate application

2020-02-19 Thread 'Annet' via web2py-users
I have three applications all of which have mail functionality. Since this gives a lot of dupliacte code I thought of moving all mail functionality to its own mail application. I have one masterapp controlpanel with the following code; if not request.env.remote_addr in ['127.0.0.1',

Re: [web2py] Re: web2py with js framework

2020-02-19 Thread Roberto Perdomo
I made an app some time ago with Web2py/Vue is not being maintained anymore, but maybe can help you. https://github.com/robertop23/web2py_vuejs_vuetify On Wed, Feb 19, 2020 at 4:18 PM Geordanis Baño Vega wrote: > > API with web2py and SPA|PWA with Vue, could be an option. Regards > > El mié.,

[web2py] Using postgresql with py4web gives error

2020-02-19 Thread Maurice Waka
I used this string to connect to postgresql database db = DAL( "postgres://mauricewaka:b123test##@localhost:5432/mydb") as well as this db = DAL( "postgres://mauricewaka:b123##@localhost/test") But got this error: Traceback (most recent call last): File

Re: [web2py] Re: web2py with js framework

2020-02-19 Thread Geordanis Baño Vega
API with web2py and SPA|PWA with Vue, could be an option. Regards El mié., 19 feb. 2020 a las 11:16, Andrew Rogers () escribió: > I've been using Vue for just 30 mins and web2py for not much longer. I > just wanted to get something really, really simple working. All i did was > added this to

[web2py] Re: web2py with js framework

2020-02-19 Thread Andrew Rogers
I've been using Vue for just 30 mins and web2py for not much longer. I just wanted to get something really, really simple working. All i did was added this to index.html. I am sure this is bad practice - just a first step to trying to understand how things fit together. Thanks to Mirek's tip

Re: [web2py] py4web: request.now not working

2020-02-19 Thread Maurice Waka
Both do not work. So I just got this: import datetime as dt default = dt.datetime.utcnow() On Wed, Feb 19, 2020, 12:49 Alexander Hoch wrote: > Try request.now with the function call (). only "default=request.now" and > "update=request.now" > > Am Mi., 19. Feb. 2020 um 10:24 Uhr schrieb

Re: [web2py] py4web: request.now not working

2020-02-19 Thread Alexander Hoch
Try request.now with the function call (). only "default=request.now" and "update=request.now" Am Mi., 19. Feb. 2020 um 10:24 Uhr schrieb Maurice Waka < mauricew...@gmail.com>: > Hello. > > I'm still stuck at this error: > > Field('modified_on', 'datetime', default=request.now(),

[web2py] py4web: request.now not working

2020-02-19 Thread Maurice Waka
Hello. I'm still stuck at this error: Field('modified_on', 'datetime', default=request.now(), update=request.now()), File "/usr/local/lib/python3.6/dist-packages/bottle.py", line 1400, in __getattr__ raise AttributeError('Attribute %r not defined.' % name) AttributeError: Attribute 'now'