Re: [web2py] Re: Future of web2py

2019-05-12 Thread Val K
I made one: https://vuepydemo.pythonanywhere.com/todo_pwa/default/index.html
Follow the link then close the page, disconnect from internet and open again.  
Try to add/remove a todo item - you will get the alert 'Network problem'

-- 
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/5704634c-f2e0-409f-8eac-9fb1ae30dcb4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Web3py

2019-05-12 Thread Scott Hunter
Note: if the folder, translations, that is being complained about is added, 
the app still can't be reached, but there is no longer an exception 
reported: just the 404 page.

- Scott

On Saturday, May 11, 2019 at 9:55:34 PM UTC-4, 黄祥 wrote:
>
> $ ./web3py-start applications/
> Dashboard is at: http://127.0.0.1:8000/_dashboard
> Traceback (most recent call last):
>   File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 560, in 
> import_apps
> module = importlib.machinery.SourceFileLoader(app_name, init).
> load_module()
>   File "", line 407, in 
> _check_name_wrapper
>   File "", line 907, in load_module
>   File "", line 732, in load_module
>   File "", line 265, in _load_module_shim
>   File "", line 696, in _load
>   File "", line 677, in _load_unlocked
>   File "", line 728, in exec_module
>   File "", line 219, in 
> _call_with_frames_removed
>   File 
> "/Users/sugizo/learn/python/web3py/applications/_dashboard/__init__.py", 
> line 12, in 
> T = Translator(T_FOLDER)
>   File 
> "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/pluralize/__init__.py"
> , line 60, in __init__
> self.load(folder)
>   File 
> "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/pluralize/__init__.py"
> , line 65, in load
> for filename in os.listdir(folder):
> FileNotFoundError: [Errno 2] No such file or directory: 
> '/Users/sugizo/learn/python/web3py/applications/_dashboard/translations'
>
> Traceback (most recent call last):
>   File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 560, in 
> import_apps
> module = importlib.machinery.SourceFileLoader(app_name, init).
> load_module()
>   File "", line 407, in 
> _check_name_wrapper
>   File "", line 907, in load_module
>   File "", line 732, in load_module
>   File "", line 265, in _load_module_shim
>   File "", line 696, in _load
>   File "", line 677, in _load_unlocked
>   File "", line 728, in exec_module
>   File "", line 219, in 
> _call_with_frames_removed
>   File "/Users/sugizo/learn/python/web3py/applications/toys/__init__.py", 
> line 5, in 
> db = DAL('sqlite://storage.db', folder=os.path.join(os.path.dirname(
> __file__), 'databases'))
>   File 
> "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/pydal/base.py"
> , line 171, in __call__
> obj = super(MetaDAL, cls).__call__(*args, **kwargs)
>   File 
> "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/pydal/base.py"
> , line 477, in __init__
> "Failure to connect, tried %d times:\n%s" % (attempts, tb)
> RuntimeError: Failure to connect, tried 5 times:
> Traceback (most recent call last):
>   File 
> "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/pydal/base.py"
> , line 457, in __init__
> self._adapter = adapter(**kwargs)
>   File 
> "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/pydal/adapters/__init__.py"
> , line 39, in __call__
> obj = super(AdapterMeta, cls).__call__(*args, **kwargs)
>   File 
> "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/pydal/adapters/base.py"
> , line 369, in __init__
> super(SQLAdapter, self).__init__(*args, **kwargs)
>   File 
> "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/pydal/adapters/base.py"
> , line 53, in __init__
> self.reconnect()
>   File 
> "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/pydal/connection.py"
> , line 154, in reconnect
> self.connection = self.connector()
>   File 
> "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/pydal/adapters/sqlite.py"
> , line 42, in connector
> return self.driver.Connection(self.dbpath, **self.driver_args)
> sqlite3.OperationalError: unable to open database file
>
> 127.0.0.1 - - [12/May/2019 08:44

-- 
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/956c3063-6f68-43c7-883f-e8af0f0e0294%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Future of web2py

2019-05-12 Thread João Matos
I dont' think web2py can support PWA because PWA is a web app that can run 
online and offline in a mobile device.
Someone would have to build an embedded server to include in the mobile app 
(PWA) and that raises several questions due to the nature of the majority 
of web2py apps which depend on a database of some sort.
It isn't impossible but I don't see it happening in the near future.


sábado, 11 de Maio de 2019 às 08:40:35 UTC+1, mweissen escreveu:

> I think, progessive web applications are a very important way to create 
> native-like apps and it would be nice, if web3py could support pwas. There 
> is an interesting article about the future of pwas:
>
> https://enonic.com/progressive-web-apps 
>  
> Regards, Martin
>
> Am Sa., 11. Mai 2019 um 05:45 Uhr schrieb 黄祥  >:
>
>> What is pwa?
>>
>>
>> ref:
>> https://en.wikipedia.org/wiki/Progressive_web_applications
>> https://developers.google.com/web/progressive-web-apps/
>> https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps
>>
>> best regards,
>> stifan 
>>
>> -- 
>> 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 web...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/web2py/d4d39e2f-0ab5-400b-b46a-ceaa9ef3da18%40googlegroups.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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/26d79828-d48b-488b-82d0-2880e19a06ab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Why my form is not working

2019-05-12 Thread João Matos
Why not create a simple condition using

# The form should have the same name in both conditions.
if request.now.time().hour < 12:
# Show morning form including the edit and submit buttons.
else:
# Show afternoon form including the edit and submit buttons.

# If you want to validate anything use the following line.
if form.process(onvalidation=on_validation).accepted:
# Or use the next line if you don't.
# if form.process().accepted:
   # Do whatever you want when success
elif form.errors:
  # Do whatever you want when there are form errors.

domingo, 12 de Maio de 2019 às 08:17:20 UTC+1, Maurice Waka escreveu:
>
> I i'm trying to use one chart to alternate between two forms. A user logs 
> in data in the morning hrs, meaning the form should be active and the 
> evening form inactive. When the time comes after 12 pm the morning form 
> is inactive and the evening form is active.
> While trying out this morning, both are inactive all through.
> Here is the code:
>
> def mg_sugar_chart():
> response.files.append(URL('e_dextrose',
> 'static/js/pygal-tooltips.min.js'))
> response.headers['Content-Type']='image/svg+xml'
>
>
> custom_style = Style(
> background='transparent',
> plot_background='transparent',
> foreground='#53E89B',
> foreground_strong='#53A0E8',
> foreground_subtle='#630C0D',
> opacity='.6',
> opacity_hover='.9',
> transition='400ms ease-in',
> colors=('#E853A0', '#E8537A', '#E95355', '#E87653', '#E89B53')
> )
> chart = pygal.Line(fill=True, interpolate='cubic', style=BlueStyle, 
> x_label_rotation=45, print_values=True, show_y_guides=False, 
> print_values_position='top')
> data = db(db.amg_sugar).select()
> data1 = db(db.pmg_sugar).select()
> 
> chart.x_labels = al_date
> chart.x_labels = pl_date
> chart.add('AM', [i.am_dext for i in data])
> chart.add('PM', [i.pm_dext for i in data1])
>
> return chart.render()
>
>
> #***sugar***
> @auth.requires_login()
> def mgSugar():
> db.amg_sugar.modified_on.readable = db.amg_sugar.modified_on.writable 
> =False
> db.pmg_sugar.modified_on.readable = db.pmg_sugar.modified_on.writable 
> =False
> chart= URL('e_dextrose', 'mg_sugar_chart')
> row = db(db.amg_sugar.author == auth.user_id).select().first()
>
>
> #***open and close for sugar logs***
> early_str = '05::00::00'
> late_str = '22::00::00'
> am_str = '11::59::00'
> pm_str = '12::00::00'
> am_line = dt.strptime(am_str, '%H::%M::%S').time()#deadline to post 
> sugar
> pm_line = dt.strptime(pm_str, '%H::%M::%S').time()#deadline to post 
> sugar
> early_line = dt.strptime(early_str, '%H::%M::%S').time()#deadline to 
> post sugar
> late_line = dt.strptime(late_str, '%H::%M::%S').time()#deadline to 
> post sugar
>
>
> #***check if row is empty***
> am_row = [r.am_dext for r in db(db.amg_sugar.author == auth.user.id).
> select(db.amg_sugar.ALL)[-1:]]
> pm_row = [r.pm_dext for r in db(db.pmg_sugar.author == auth.user.id).
> select(db.pmg_sugar.ALL)[-1:]]
> #***AM logs***
> if request.now.date():# == amd.date():
> form = SQLFORM(db.amg_sugar)
> form.add_button('Edit', URL('edit_amgSugar'))
> am_row1 = [r.am_dext for r in db(db.amg_sugar.author == auth.user.
> id).select(db.amg_sugar.ALL)[-1:]]
> if request.now.time() >= early_line and am_row1[0] == None:   
>  
> form = SQLFORM(db.amg_sugar, submit_button=T('Submit')).
> process()
> form.add_button('Edit', URL('edit_amgSugar'))
> else:
> session.flash = ''.join(str(item) for item in ["Your next sugar 
> log is in the next morning. "])
> form = session.flash
>
>
> if request.now.date():# == amd.date():
> form1 = SQLFORM(db.pmg_sugar)
> form1.add_button('Edit', URL('edit_pmgSugar'))
> pm_row1 = [r.pm_dext for r in db(db.pmg_sugar.author == auth.user.
> id).select(db.pmg_sugar.ALL)[-1:]]
> if request.now.time() >= pm_line and pm_row1[0] ==None:
> form1 = SQLFORM(db.pmg_sugar, submit_button=T('Submit')).
> process()
> form1.add_button('Edit', URL('edit_pmgSugar'))
> else:
> session.flash = ''.join(str(item) for item in ["Your next sugar 
> log is in the next afternoon. "])
> form1 = session.flash
>
> return dict(chart = chart,form=form, form1=form1)
>
>
> Could someone give me a better idea/solution.
> Much 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.
To view this discussion on the web visit 
https://groups.googl

[web2py] FORM other then process & errors

2019-05-12 Thread lucas
hey one and all,

ok, I have standard code under my controller like:

gfrm = FORM(db.table1, recode=id)
if gfrm.process(onvalidate=chk_ok).accepted:
#lots of stuff
session.flash = 'Successfully Generated Tests'
redirect(URL('tests'))
elif gfrm.errors:
response.flash = 'Generated Tests Errors'
else:
response.flash = 'ok'


I believe I learned that there are only the process-accepted and errors 
sections.  but I have a condition where its going under the else section 
where ok is.  what are the causes of a FORM going into that area?

thank you in advance, Lucas

-- 
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/ee4176ef-6b24-4579-9feb-2b45a6f0b9a0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Compiled pack always includes databases and private dirs. Is there any way to pack w/o those?

2019-05-12 Thread João Matos
I was just pressing the checkbox and nothing happened.
I pressed the app name and now the tree struc appears.

Thanks.


domingo, 12 de Maio de 2019 às 13:01:42 UTC+1, Anthony escreveu:
>
> Click on the folder to expand.

-- 
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/56e059b6-f910-445d-af94-794f45747e35%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Compiled pack always includes databases and private dirs. Is there any way to pack w/o those?

2019-05-12 Thread Anthony
Click on the folder to expand.

-- 
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/6bc22868-d736-4d50-9e60-2b5367cdb8e5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Required tables for a blog

2019-05-12 Thread Mohammad Rostami
Hello. I'm going to make a blog with web2py for me. Each blog post:

   1. Has an image. This image is displayed in the thumbnail on the main 
   page of the blog. When reading the post, the actual size is displayed.
   2. There are a number of images in the body of each post. These pictures 
   are used for guidance, such as how to register on a site.
   3. Each post has comments.
   4. Each post has several fields, for example: minimum investment, user 
   privileges, minimum upgrade cost. The way to display posts on the home page 
   is based on these fields and is selected by the user.
   
In the future, this blog, community and other sections will also be 
added. But now there is just one blog with these features. What tables 
should I create for my blog so I will not be in trouble? For example, for a 
post index image, create a separate table or put it as a field from the 
post table?

Thank you very much for your help.

-- 
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/3838ddcc-f2f4-4987-a03d-932197c5c991%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: gmail unable to send email

2019-05-12 Thread Dave S


On Monday, May 6, 2019 at 6:49:33 AM UTC-7, Leonel Câmara wrote:
>
> If you don't send too many emails I recommend using sparkpost as they have 
> a free tier and I made a plugin that makes it really easy to use with web2py
>
> https://github.com/leonelcamara/web2py_sparkpost
>

For what its worth, I have been using the local mailserver on the AWS Linux 
running my production code, and that works very well, although so far it's 
only had to send to a handful of addresses.  Those addresses are served by 
gmail, though, and we did have to set up the additional DNS records to keep 
the messages from being marked as "EVIL".l  We had someone in the office 
who had done that once before, so it wasn't a terrible pain, but obviously 
SparkPost is going to handle that for you.

/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/186f181d-8d4e-4991-a600-16a59c1e2897%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: web2py - didn't disconect from postgreSQL auth database (TIME_WAIT)

2019-05-12 Thread Dave S


On Monday, May 6, 2019 at 8:29:48 AM UTC-7, Krzysztof Jeleń wrote:
>
> Hello
>
> I'm using web2py (Version 2.14.6-stable+timestamp.2016.05.09.19.18.48). 
>

How long have you been using this version?  What OS and what front end and 
what version of Python?
 

> Last week I've start getting strange errors on client side 
>

What changed on your server?
 

> ("waiting for available socket") - I'm using Chrome. After investigation I 
> found that DAL (PostgreSQL) object didn't close connection to database 
> after finishing request: 
>

I've seen issues with Chrome talking to a local instance of web2py (on 
W10)  using Rocket, and Chrome seems to get into a state where something 
cache-related is driving a lot of requests into Rocket; Usually closing 
Chrome clears things up (actually, closing one window of Chrome is enough, 
and sometimes it seems to work to close just one tab -- if I get the right 
one; Chrome uses multiple processes, so windows are independent, and tabs 
may be also).  In this environment, I'm also using 2.14.6, though I've been 
trialing newer versions.



> netstat -p -n -o | grep "" 
>
> return a lot of entries like (~300):
>
> tcp0  0 127.0.0.1:36062 127.0.0.1:5434  
> TIME_WAIT   -timewait (24.30/0/0)
>
> DAL object is created in models/db.py and then it is passed to Auth 
> constructor. When there is no incoming requests to application after some 
> time (60s) every TIME_WAIT socket is closed and everything looks fine, When 
> requests start comming then number of TIME_WAIT sockets start growing and 
> stay about 300.
>
> Is there a way to call close on underlaying postgresql connection layer?
> Is there a way to invoke some code every time processing data is finished 
> for each request (after server proces user quest and before start sending 
> it to browser)?
> or maybe that was fixed in latest version
>
> BR
>   KJ
>

-- 
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/9a3fef05-7df0-419e-a142-21ee2ca7249a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Why my form is not working

2019-05-12 Thread Maurice Waka
I i'm trying to use one chart to alternate between two forms. A user logs 
in data in the morning hrs, meaning the form should be active and the 
evening form inactive. When the time comes after 12 pm the morning form 
is inactive and the evening form is active.
While trying out this morning, both are inactive all through.
Here is the code:

def mg_sugar_chart():
response.files.append(URL('e_dextrose','static/js/pygal-tooltips.min.js'
))
response.headers['Content-Type']='image/svg+xml'


custom_style = Style(
background='transparent',
plot_background='transparent',
foreground='#53E89B',
foreground_strong='#53A0E8',
foreground_subtle='#630C0D',
opacity='.6',
opacity_hover='.9',
transition='400ms ease-in',
colors=('#E853A0', '#E8537A', '#E95355', '#E87653', '#E89B53')
)
chart = pygal.Line(fill=True, interpolate='cubic', style=BlueStyle, 
x_label_rotation=45, print_values=True, show_y_guides=False, 
print_values_position='top')
data = db(db.amg_sugar).select()
data1 = db(db.pmg_sugar).select()

chart.x_labels = al_date
chart.x_labels = pl_date
chart.add('AM', [i.am_dext for i in data])
chart.add('PM', [i.pm_dext for i in data1])

return chart.render()


#***sugar***
@auth.requires_login()
def mgSugar():
db.amg_sugar.modified_on.readable = db.amg_sugar.modified_on.writable =
False
db.pmg_sugar.modified_on.readable = db.pmg_sugar.modified_on.writable =
False
chart= URL('e_dextrose', 'mg_sugar_chart')
row = db(db.amg_sugar.author == auth.user_id).select().first()


#***open and close for sugar logs***
early_str = '05::00::00'
late_str = '22::00::00'
am_str = '11::59::00'
pm_str = '12::00::00'
am_line = dt.strptime(am_str, '%H::%M::%S').time()#deadline to post 
sugar
pm_line = dt.strptime(pm_str, '%H::%M::%S').time()#deadline to post 
sugar
early_line = dt.strptime(early_str, '%H::%M::%S').time()#deadline to 
post sugar
late_line = dt.strptime(late_str, '%H::%M::%S').time()#deadline to post 
sugar


#***check if row is empty***
am_row = [r.am_dext for r in db(db.amg_sugar.author == auth.user.id).
select(db.amg_sugar.ALL)[-1:]]
pm_row = [r.pm_dext for r in db(db.pmg_sugar.author == auth.user.id).
select(db.pmg_sugar.ALL)[-1:]]
#***AM logs***
if request.now.date():# == amd.date():
form = SQLFORM(db.amg_sugar)
form.add_button('Edit', URL('edit_amgSugar'))
am_row1 = [r.am_dext for r in db(db.amg_sugar.author == auth.user.id
).select(db.amg_sugar.ALL)[-1:]]
if request.now.time() >= early_line and am_row1[0] == None:
form = SQLFORM(db.amg_sugar, submit_button=T('Submit')).process
()
form.add_button('Edit', URL('edit_amgSugar'))
else:
session.flash = ''.join(str(item) for item in ["Your next sugar log 
is in the next morning. "])
form = session.flash


if request.now.date():# == amd.date():
form1 = SQLFORM(db.pmg_sugar)
form1.add_button('Edit', URL('edit_pmgSugar'))
pm_row1 = [r.pm_dext for r in db(db.pmg_sugar.author == auth.user.id
).select(db.pmg_sugar.ALL)[-1:]]
if request.now.time() >= pm_line and pm_row1[0] ==None:
form1 = SQLFORM(db.pmg_sugar, submit_button=T('Submit')).process
()
form1.add_button('Edit', URL('edit_pmgSugar'))
else:
session.flash = ''.join(str(item) for item in ["Your next sugar log 
is in the next afternoon. "])
form1 = session.flash

return dict(chart = chart,form=form, form1=form1)


Could someone give me a better idea/solution.
Much 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/54c3d82a-87b1-4ec2-9a53-ab1351bb925a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.