Hello,
I fetch a number on records from the database and show it on the screen. Is
there a way to not print the text None for fields that are in the state
None. I could use if field != None but I'd rather not use IF if there is an
other way.
Kenneth
--
Resources:
- http://web2py.com
- http
hello one and all,
the render function under gluon.template is great and powerful. how can i
pass two or three context rows to it, like?
from gluon.render import render
xyz="""
{{="%s, %s" % (sCustomer.last_name, sCustomer.first_name)}}
{{="%i: %s - %s" % (sItem.number, sItem.name, sItem.descri
Here is the code as promised for the db.py and default.py.
On Thursday, July 7, 2016 at 2:19:10 PM UTC-5, Jeff Riley wrote:
>
> Hello all. Me again. I have run into an interesting issue. I have
> installed and followed niphlod's w2p_timezone_plugin. In order to make it
> work on my local PC
>
> Thanks Richard, Anthony, very good answers.
>
The use case is simple:
For example, query articles with a field of uncatalogued, you can either
select catalogued, uncatalogued or all (doesnt matter if its uncatalogued).
To store such filter i can make use of a boolean tri state, True, False
I have that in the default.py file. I will send the code when I get to my
computer.
Thank you,
Jeff Riley
> On Jul 7, 2016, at 5:10 PM, Marlysson Silva wrote:
>
> Where you are inicialize session.plugin_timezone_tx ?
>
> I too already had this issue, this happen because the script get timezon
If the form contains a checkbox and the user leaves it unchecked, I would
say the correct value to store is False. Storing None would make sense if
the boolean field were completely excluded from the form. If an empty
checkbox should be recorded as None, then when would you ever record False
--
Are you have some planning in port some graph database to operations in
pyDAL?
By example: Neo4j , OrientedDB...
--
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 Issu
Where you are inicialize session.plugin_timezone_tx ?
I too already had this issue, this happen because the script get timezone
based on the server localization.
I solved this using other way, converting user timezone to UTC and at
showing converted in user timezone.
They are some steps to do
Alfonso,
What you use case?
As HTML radio box doesn't allow NULL and by default web2py set bool field
type as check box by default, it doesn't implment the NULL state as it
doesn't make much sens to do it as false or NULL result in the same HTML
tag state.
You would need to use other widget repr
MySQL with TINYINT as booleans:
db = DAL("mysql://", pool_size = 10, check_reserved=None, migrate=True)
db._adapter.types['boolean']='TINYINT(1)'
db._adapter.TRUE = 1
db._adapter.FALSE = 0
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py
On Thursday, July 7, 2016 at 12:32:08 PM UTC-7, Alfonso Serra wrote:
>
> If i define a boolean field as:
>
> Field("mybool", "boolean", required = False, notnull = False, default =
> None)
>
> Its stored as False if its not present in request.post_vars. The proper
> behaviour would be to store
If i define a boolean field as:
Field("mybool", "boolean", required = False, notnull = False, default = None
)
Its stored as False if its not present in request.post_vars. The proper
behaviour would be to store a null value in this case, which allows to
handle boolean's tri-states.
To achieve
Hello all. Me again. I have run into an interesting issue. I have
installed and followed niphlod's w2p_timezone_plugin. In order to make it
work on my local PC I need to setup my db.py as follows.
import pytz
user_timezone = session.plugin_timezone_tx or 'UTC'
db.define_table('events',
Notice :
db().select(...) empty set will be abandonned (deprecated) probably... So
better to specify table you are querying as you are writting new code...
Ref.:
https://github.com/web2py/pydal/issues/388
Richard
On Thu, Jul 7, 2016 at 3:03 PM, Richard Vézina
wrote:
> Add a where clause to re
Add a where clause to remove them something like this :
~db.auth_group.startswith('user_')
On Thu, Jul 7, 2016 at 2:57 PM, wrote:
> Richard,
>
> Thank you for your reply.
>
> Using the code you suggested, implemented as this:
>
> users=db().select(
> db.auth_user.id, db.auth_user.first_name
Richard,
Thank you for your reply.
Using the code you suggested, implemented as this:
users=db().select(
db.auth_user.id, db.auth_user.first_name, db.auth_user.last_name, db.
auth_group.role,
left=[db.auth_membership.on(db.auth_user.id == db.auth_membership.
user_id),
db.auth_grou
Why not do that instead of you first example :
db(db.auth_user.id > 0).select(..., left=[db.auth_membership.on(
db.auth_user.id == db.auth_membership.user_id),
db.auth_group.on(db.auth_membership.group_id==db.auth_group.id)])
Richard
On Thu, Jul 7, 2016 at 1:30 PM, wrote:
> I assign each user
I assign each user either group A or B, and by default web2py assign users
to the user_%d groups. I would like to query which users are in groups A,
B, and NULL so that (1) I can verify each user is in the right group and
(2) no users are in zero groups.
I have this controller
users = db(~db.a
For incoming URLs, you could map the language to a URL arg or query string
variable. For outgoing URLs, you could either set that same URL arg or var
and rely on a routes_out rewrite rule, or you could simply prepend URLs
generated via the URL() function with the language. In either case, you
c
hafte: I think you posted to the wrong thread...
A friendly bump to the others: Is there a way to restrict access by IP
address in web2py's main/core routes.py?
Right now I'm doing it in appname/controllers/appadmin.py with this:
--snip--
if request.client not in ['x.x.x.x']:
raise HTTP(404)
Hi, thanks for answer my question, but this is the parameter-based
router, I need to use the pattern-based one.
(http://web2py.com/books/default/chapter/29/04/the-core?search=routes#Pattern-based-system)
Greetings.
El 07/07/16 a las 09:28, Marlysson Silva escribió:
This not work?
http://web2p
perfect and excellent, it works famously. 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 t
This not work?
http://web2py.com/books/default/chapter/29/04/the-core?search=routes#URL-rewrite
Using a languages dictionary , or setting a default language
routers = dict(
BASE = dict(default_application='myapp'),
myapp = dict(languages=['en', 'it', 'jp'], default_language='en'),)
Em qui
Hi, I need some starting point to implement the URL based
internationalization using the pattern based router, I really need to use
the router, but there is so little documentation...
I am clonning our yii2 cms base application (supporting right now sites
like http://santiagohermes.com http://a
>
> But as a shortcut (I am pretty new with python, admittedly), I have tried
> some of the referenced appliances in the repo including, finally, outside
> the repo, Instant Press. It was promising but it simply throws a lot of
> exceptions as you start to use it. It also has not been mainta
{{=form.custom.submit.element(_value='Submit')}}
or:
{{=form.element(_type='submit', _value='Submit')}}
In the second example, you can leave out _type if _value uniquely
identifies the button among all elements in the form.
Anthony
On Thursday, July 7, 2016 at 2:52:51 AM UTC-4, lucas wrote:
>
Also, keep in mind that the DAL's logical operators are "&" and "|", not
"and" and "or". In any case, show_if does not support multiple conditions,
so .belongs is the way to go here.
Anthony
On Thursday, July 7, 2016 at 7:19:45 AM UTC-4, Jeff Riley wrote:
>
> Worked perfectly. Thank you Marlys
Hi all.
I am very frustrated, I must say. After several weeks of work (and reading
and re-reading all that I have found online), I simply cannot get installed
a working environment. I do now have the latest stable release of web2py
installed along with nginx and uwsgi. That works as a framew
You'we welcome :D , mark the answer as completed.
Em quinta-feira, 7 de julho de 2016 08:19:45 UTC-3, Jeff Riley escreveu:
>
> Worked perfectly. Thank you Marlysson.
>
> db.events.event_level.show_if = (db.events.event_type.belongs("Mood",
> "Headache", "Nausea", "Pain"))
>
>
> On Thursday, Ju
Worked perfectly. Thank you Marlysson.
db.events.event_level.show_if = (db.events.event_type.belongs("Mood",
"Headache", "Nausea", "Pain"))
On Thursday, July 7, 2016 at 5:54:31 AM UTC-5, Marlysson Silva wrote:
>
> Try use belongs, of DAL.
>
>
> http://web2py.com/books/default/chapter/29/06/t
Try use belongs, of DAL.
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#belongs
Em quinta-feira, 7 de julho de 2016 06:24:08 UTC-3, Jeff Riley escreveu:
>
> Hello all. I am trying to get the line below from my db.py file to work.
> Currently it is only working for
Massimo, this is great !
>From your second example I think, it could work for serial m:1 joins too.
Example:
invoice_item >- product >- product_group
If I want list invoice_items with product.name + with product_group.name
Realy is this now possible?
Dne úterý 5. července 2016 20:20:06 UTC+2
Hello all. I am trying to get the line below from my db.py file to work.
Currently it is only working for the first entry "Mood". Any ideas?
db.events.event_level.show_if = ((db.events.event_type == "Mood") or
(db.events.event_type == "Headache") or
(db.events
33 matches
Mail list logo