let say i have a code
*models/db.py*
db.test.name.requires = IS_NOT_EMPTY()
db.test.address.requires = IS_NOT_EMPTY()
db.test.name.widget = lambda field,value:
SQLFORM.widgets.string.widget(field, value,
_placeholder = T('Name should be filled') )
db.test.address.widget = lambda field,value:
yes, you have a nice trick on your code, thanks so much massimo
e.g.
# -*- coding: utf-8 -*-
# index
def index():
filename = os.path.join(request.folder, 'databases', 'idx_tables.index')
if not os.path.exists(filename):
# create index : auth_user
db.executesql('CREATE INDEX idx_auth_user ON
thanks so much for the nice trick, create the file on web2py databases
folder after execute 'CREATE INDEX'
pardon, i think it's not efficient, pls imagine if there are a lot of
tables, and execute the controllers/install.py to have a lot of conditional
check for each file for each table that
thanks all, that can do, but CREATE INDEX IF NOT EXISTS, it's not work in
mysql (pls correct me if i'm wrong), so i use the universal code that can
cover all of it, of course i think i can create conditional for check for
the database connection base on environment.
in my environment are
-
i have a code :
*controllers/install.py*
import test_install_insert
def index():
if db(db.auth_permission).isempty() and db(db.auth_membership).isempty():
test_install_insert
session.flash = T('Installation Done')
redirect(URL('default', 'index') )
*modules/test_install.py*
import sys;
Thank you so much Anthony, it works well now.
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
i have web2py modules that insert new data for new web2py app:
*modules/test_install.py*
#!/usr/bin/env python
# coding: utf8
import sys;
sys.path.append('site/web2py/')
from gluon import current
#from gluon import *
from gluon.contrib.webclient import WebClient
install =
the apps is build from scratch, no created index before either from apps
and from database side. the only place i create index is in the
controllers/install.py, and it's only execute one time only.
my logic during first code install script is :
execute create index first then execute insert
let say i have a code:
*models/db_wizard_1_bank.py*
db.define_table('bank',
Field('name'),
Field('website'),
format = '%(name)s')
*controllers/install.py*
def index():
if db(db.auth_permission).isempty() and db(db.auth_membership).isempty():
# create index : auth_user
db.executesql('CREATE
is it possible to insert table twice on same table in web2py?
e.g.
*modules/test_event.py*
def after_insert_event(f, id, table):
time_stamp = current.request.now
client_ip = current.request.client
user_id = current.auth.user_id
origin = '%s/%s' % (current.request.controller,
i think you can download it from web2py website :
http://web2py.com/init/default/download
trunk is for tester (yellow background)
best regard,
stifan
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
-
i think it can do in web2py
e.g.
*views/default/contact_us.html*
{{right_sidebar_enabled = True}}
{{block right_sidebar}}
{{include 'templates/right_sidebar.html'}}
{{end}}
{{extend 'layout.html'}}
{{include 'templates/form.html'}}
best regards,
stifan
--
Resources:
- http://web2py.com
-
is default value request.now is work in SQLFORM.grid (edit) ?
e.g.
*models/db.py*
def on_define_employee(table):
# default
table.status.default = 'New'
# notnull
table.full_name.notnull = True
table.status.notnull = True
# required
table.full_name.required = True
table.status.required = True
#
i think you can use python strftime
e.g.
{{from datetime import date}}
{{=SPAN(row.f_start_time.strftime("%b") ) }}
*Result : Mar*
{{=SPAN(row.f_start_time.strftime("%B") ) }}
*Result : March*
Best regards,
stifan
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
-
thanks manuele, i've tried that but the result is same (no error occured
but the result is not expected, google maps show almost take the sqlform
grid view entirely).
e.g.
def check_point_admin(row):
scr0 = SCRIPT("""
function initMap() {
var mapDiv = document.getElementById(%s);
just want to report grid exportclasses is not work in recent version :
e.g.
def index():
table = db.test
exportclasses = dict(csv_with_hidden_cols=False, xml=False, json=False,
tsv_with_hidden_cols=False, tsv=False)
grid = SQLFORM.smartgrid(table, exportclasses = exportclasses)
return locals()
pls try :
mysql://pythonuser:MySQLpwd@mysql.server/pythonuser$MySQLdb
note :
- pythonuser is your pythonanywhere username
- MySQLpwd is your MySQL Password in pythonanywhere
- MySQLdb is your database mysql that store data for application
best regards,
stifan
--
Resources:
- http://web2py.com
testing to put it on the SQLFORM.grid links no error occured but the result
is not expected
e.g.
*controllers*
def check_point_admin(row):
scr0 = SCRIPT("""
function initMap() {
var mapDiv = document.getElementById(%s);
var latlon = new google.maps.LatLng( %s, %s );
var mapOptions = {
let say i have a table definition with latitude and longitude as double,
and want to show it in SQLFORM.grid view. is it possible to achieve it
using web2py?
i've tested it before and an error occured said :
Traceback (most recent call last):
File
follow the instruction is working well, thank you, but when i tried to add
the condition it didn't work.
e.g.
*controllers/default.py*
*"""*
*not work because of this*
*def check_condition(): *
*auth.settings.login_next = URL('user/profile')*
*if request.function != 'user':*
*
perhaps an example can speak thousand words :
e.g.
def login_onfail(form):
email = request.vars.email
row = db((db.auth_user.email == email ) ).select().first()
if row is not None:
db.auth_event.insert(time_stamp = request.now,
client_ip = request.client,
user_id = row.id,
origin = '%s/%s' %
>
> Does it work to import locale in the module instead of in the view?
>
import python module doesn't work in web2py modules, so it must redefine
again (e.g. locale, datetime)
>
> Modules do not get the complete global environment from the model or
> controller that calls them
> (per
in web2py book, i think we can put template using response.render in any
place in views.
*ref:*
http://web2py.com/books/default/chapter/29/08/emails-and-sms?search=response.render#Using-the-template-system-to-generate-messages
*the evidence fact i got :*
- mail() with response.render() that
not sure what do you need, do you mean the smtp service? i think you could
use your isp smtp or smtp from your domain hosting. i've seen in the other
post that gmail is fine if you don't activate two factor authentification
in gmail (lionel point it up, if i'm not mistake)
best regards,
stifan
*full traceback got from table scheduler_run :*
Traceback (most recent call last):
File "/Users/MacBookPro/site/web2py/gluon/scheduler.py", line 313, in
executor
result = dumps(_function(*args, **vars))
File "applications/mutualfunds/models/scheduler.py", line 14, in
is scheduler can use python modules?
e.g.
*models/scheduler.py*
def task_mail_investor_monthly_report():
title = 'Mutual Funds Investor Monthly Report'
rows_investor = db(db.investor.id > 0).select()
for row_investor in rows_investor:
query_account = (db.account.investor == row_investor.id)
just do like usual in controller
e.g.
*controllers/default.py*
def report_investor():
choose_investor = request.args(0)
# query
query_account = (db.account.investor == choose_investor)
# row
rows_account = db(query_account).select(orderby = ~db.account.id)
return dict(rows_account =
def __after_insert_redemption_detail(f, id):
query_unit = db.unit.account == f['account']
row_unit = db(query_unit).select(orderby = ~current.db.unit.id).first()
insert_unit_unit = row_unit.unit - f['unit'] if row_unit else f['unit']
insert_unit_previous_unit = row_unit.unit if row_unit else 0
pardon, i forgot to include my code i'm done so far with the unexpected
result (no error occured)
code:
def __after_insert_redemption_detail(f, id):
query_unit = db.unit.account == f['account']
row_unit = db(query_unit).select(orderby = ~current.db.unit.id).first()
db.unit.insert(account =
is there a way to update table and calculate using FIFO (First In First
Out) methods?
e.g.
Unit Trade Unit Remaining Subscription Unit NAV Date
3.000,00 1.000,00 1.000,00 01/03/2016
2.000,00 1.000,00 1.000,00 01/02/2016
1.000,00 1.000,00 1.000,00 01/01/2016
let say i have the data above, when
please try:
db.movies.category.requires = IS_IN_DB(db, 'categories.title',
db.categories._format, multiple = True)
ref:
http://web2py.com/books/default/chapter/29/07/forms-and-validators#Validators
best regards,
stifan
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
pls try :
db.servicos_feitos.servico_feito.requires =
IS_IN_DB(db((db.servico_oficina.id_salao == auth.user_id) &
(db.servico_oficina.servico_salao == db.tipo_servicos.id) ),
db.servico_oficiona.id, db.servico_oficiona._format)
not sure because i don't see db.servico_oficina.id_salao on your
k, got it, thank you so much Anthony for detail explaination.
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
another way aroud :
db.task.deadline.represent = lambda value, field: SPAN('%s' % (value),
_class = 'text-danger' if value > request.now else 'text-success')
best regards,
stifan
On Friday, April 22, 2016 at 6:54:48 AM UTC+7, Michael Beller wrote:
>
> There are a couple of ways to do this.
at 9:03:16 PM UTC+7, Anthony wrote:
>
> On Thursday, April 21, 2016 at 1:57:20 AM UTC-4, 黄祥 wrote:
>>
>> meet strange behaviour in after_insert callback, when using variable
>> (e.g. f.amount) is not work, but when using dict (e.g. f['amount'] ) work
>> mode
it isn't...?
>
>
> Giles
>
>
> On Wednesday, April 20, 2016 at 8:53:17 PM UTC+1, 黄祥 wrote:
>>
>> yes, you all right, it back to normal right now, perhaps about the
>> outage, but the same behaviour is still exist :
>>
>> usually the button show work
meet strange behaviour in after_insert callback, when using variable (e.g.
f.amount) is not work, but when using dict (e.g. f['amount'] ) work
models/db_wizard_4_subscription.py
# not work
def __after_insert_subscription_detail(f, id):
unit = float(f.amount) / float(f.nav_per_unit)
"""
# work
yes, you all right, it back to normal right now, perhaps about the outage,
but the same behaviour is still exist :
usually the button show working in a couple minutes (depends on the apps
deployed), yet in the 2.14.x version, the button show working just in few
seconds, yet in the
just want to report deploy to pythonanywhere is broken in >= 2.14.x version
no error traceback occured, yet the result is not expected.
usually the button show working in a couple minutes (depends on the apps
deployed), yet in the 2.14.x version, the button show working just in few
seconds, yet
perhaps you can use timedelta
e.g.
due_date = row_sale.trade_date + datetime.timedelta(seconds = 4)
if due_date == row_sale.due_date:
print '4 seconds'
best regards,
stifan
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source
please try
{{=SPAN(A(T('Delete'), _href = URL('delete', args = [id] ), _title =
'Delete',
_onclick = "javascript:return confirm('Are you sure you want to
process?')",
_class = 'to-delete') ) }}
best regards,
stifan
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
if you want the pdf, please check the book :
http://web2py.com/books/default/chapter/29/10/services#ReportLab-and-PDF
best regards,
stifan
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
-
pardon, not sure what do you mean with 'add extra fields to the dropdown
table'
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)
---
pls try in your view :
{{right_sidebar_enabled = True}}
{{block right_sidebar}}
{{include 'default/right_sidebar.html'}}
{{end}}
{{extend 'layout.html'}}
best regards,
stifan
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source
in models :
auth.settings.actions_disabled = ['profile']
custom_auth_table = db[auth.settings.table_user_name]
custom_auth_table.first_name.readable = False
custom_auth_table.last_name.readable = False
custom_auth_table.first_name.writable = False
custom_auth_table.last_name. writable = False
not sure enough about the boolean configuration in appconfig. just tested
it but return an error traceback, e.g.
*appconfig.ini*
[smtp]
ssl= true
*db.py*
auth.settings.create_user_groups = myconf.get('smtp.ssl')
*traceback error*
TypeError: unsupported operand type(s) for %: 'bool' and
target locked, the culprit is :
*in old version :*
response.form_label_separator = myconf.get('forms.separator')
*in current version : *
response.form_label_separator = myconf.get('forms.separator') or ''
*effect :*
when using old version conf in current version web2py, in form field the
name is
pictures means thousand words, in previous version 2.13.x the same code
doesnt have None in every form field, i guess the root cause is in T() but
not sure because I never Translate for Id yet the result is same IdNone
(please see attached files), the expected is without None : Id
thanks and
i realize the sqlform(), sqlform.grid() and sqlform.factory() is behave
strangely, the form field is added with None, e.g. NameNone
is there a way to fix this?
thanks and best regards,
stifan
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
-
the new configuration surely is different from previous one, i have some
question about it (appconfig.ini and db.py)
1. myconf.get() instead of myconf.take() is there any difference or the old
one is drop?
2. pool_size = myconf.get('db.pool_size'), i learned from anthony in the
old version it
thanks all, i've tried both but got unexpected result (no error occured)
*- iframe* : the other modal is loaded too status loading ... (because i
have a modal that have a modal on it (modal raw material have another modal
name modal category) )
*code*
is it possible to make modal work when upload form field have the data?
i've tested before the form submit button only show working... (no error
traceback occured but the result is not expected)
*my code :*
*controlelrs/transaction_purchase.py*
def modal_raw_material():
form =
pls try :
db.define_table('b_tbl', Field('a_tbl_id', 'reference a_tbl')
,Field('name') )
db.define_table('c_tbl', Field('b_tbl_id', 'reference b_tbl')
,Field('name') )
i think in b_tbl, field id is already there as the integer auto increment
primary key, so when you redefine another field with
it's hard to tell without seeing the code in your models, dropdown list in
form usually come either you set the table field reference to another table
or you set the table field as string and have validation requires
IS_IN_SET()
if the table field is reference to another table, it's simply just
done
--
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
is it possible to have default value condition base on time? i tried before
but return an error
e.g. 1
table.shift.default = 1 if request.now.hour() >= 0 & request.now.hour() <= 8
else 2 if request.now.hour() >= 8 & request.now.hour() <= 16 else 3
TypeError: 'int' object is not callable
e.g. 2
thank you so much dave it work perfectly
e.g.
table.shift.default = 1 if request.now.hour >= 0 & request.now.hour <=8
else 2 if request.now.hour >= 8 & request.now.hour <=16 else 3
thanks and best regards,
stifan
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
-
found the solution
with redirect(current.request.env.http_web2py_component_location,
client_side = True), never thought that more than one check box must reload
the whole page to ensure the value is store in the session, it's so
different with the form field text input type, doesn't matter how
why when using 2 checkbox, the latest change or click is applied, the
previous one is ignore to store in the session value?
let say, i have two unchecked checkbox name : bevel and gosok_halus, when i
click for all checkbox, first : bevel and then second click : gosok_halus,
the value that been
True if gosok_halus ==
> 'on' else False)*
>
> Anthony
>
> On Saturday, February 6, 2016 at 2:16:56 AM UTC-5, 黄祥 wrote:
>>
>> why during store boolean data type in session, always return true during
>> insert?
>> e.g. problem
>> for counter, (i
why during store boolean data type in session, always return true during
insert?
e.g. problem
for counter, (id, quantity, length_in_cm, width_in_cm, total_square_meter,
*bevel,
gosok_halus*) in session.delivery_order_detail.items():
db.delivery_order_detail.insert(delivery_order_no =
just wondering about ajax callback onchange for checkbox boolean
e.g.
*modules*
if current.request.vars.action == 'adjust_factory':
* #factory = current.request.vars['factory_%s' % id]*
*factory = current.request.vars.factory*
if factory == 'on':
factory = 'None'
session_order_product[id] =
perhaps you can learn a lot from web2py appliances or web2py slices :
http://www.web2py.com/appliances
http://www.web2pyslices.com
best regards,
stifan
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
-
my exact code :
def on_define_default_size(table):
# compute
#table.total_square_meter.compute = lambda r: (float(r['length_in_cm'] ) *
float(r['width_in_cm'] ) ) / 1
# label
table.name.label = T('Name')
table.length_in_cm.label = T('Length in Cm')
table.width_in_cm.label = T('Width in Cm')
still face the same error :
e.g.
db.define_table('default_size',
Field('name'),
Field('length_in_cm', 'double'),
Field('width_in_cm', 'double'),
Field('total_square_meter', 'double'),
Field('acquisition_price', 'integer') )
db.default_size.total_square_meter.compute = lambda r:
just wondering why the requires list in a list type [] is not work properly
when update (when insert goes fine):
e.g.
table.email.requires = IS_LIST_OF([IS_LOWER(), IS_EMAIL(), *IS_NOT_IN_DB(db,
table.email)* ] )
the problem when update is validator IS_NOT_IN_DB() is always true
Value already
i've followed the steps but end it with an error occured :
*running run_iochat.py from terminal*
(site)MacBook:~ MacBookPro$ python ~/site/web2py/run_iochat.py
Traceback (most recent call last):
File "/Users/MacBookPro/site/web2py/run_iochat.py", line 8, in
from gluon.main import
, no error traceback
occured, but the result is not expected (check with response.toolbar() the
value is still 0 )
i know i missed something but can't figure it out, any idea how to face
this using web2py way?
thanks and best regards,
stifan
On Thursday, January 14, 2016 at 7:03:43 AM UTC+7, 黄祥 wrote
= 0)
right now the second parameter in module can work with the variable (not
directly explicit the session name)
best regards,
stifan
On Friday, January 15, 2016 at 4:07:48 PM UTC+7, 黄祥 wrote:
>
> the previous is not work, it's work first because it still store the
> previous sessi
i think you can use format or represent to achieve it.
e.g.
*somewhere in models after you define auth tables*
custom_auth_table = db[auth.settings.table_user_name]
custom_auth_table._format = '%(first_name)s %(last_name)s'
*controllers that have SQLFORM.factory that refer to auth_user table*
> then pass in the session object and do:
>
> session.sale_order_net = ...
>
> Anthony
>
>
>
>
>
> On Wednesday, January 13, 2016 at 12:48:11 AM UTC-5, 黄祥 wrote:
>>
>> is it possible to update 2 sessions values using web2py module? i've
>> tested it only first
is it possible to update 2 sessions values using web2py module? i've tested
it only first session value work, the second session value work if explicit
define in the module (but the module is used by another controller, so i
want to create just 1 module for all controllers).
e.g.
i think you can use request.client
e.g.
def oncreate_event(form, table):
db.auth_event.insert(time_stamp = request.now,
*client_ip = request.client*,
user_id = auth.user_id,
origin = '%s/%s' % (request.controller,
request.function),
description = 'ID %s created in table %s' % (form.vars.id,
i think you can achieve it with datetime.timedelta and set the default
value of your table with that value.
e.g.
import datetime
table.end_time.default = request.now + datetime.timedelta(seconds = 19200)
p.s.
19200 seconds is 5 hours and 20 minutes
best regards,
stifan
--
Resources:
-
there is a script included in the web2py package in folder scripts
(extract_db_models.py) db is refer to mysql, oracle, pgsql, sqlite. doesn't
know if the adrien python script is same or not like the included one.
best regards,
stifan
--
Resources:
- http://web2py.com
- http://web2py.com/book
perhaps this link can help you :
http://web2py.com/books/default/chapter/29/05/the-views#INPUT
http://web2py.com/books/default/chapter/29/07/forms-and-validators#FORM
best regards,
stifan
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
-
not sure which part you didn't understand from the manual book, pls try
this :
*views_that_have_left_sidebar.html*
{{left_sidebar_enabled = True}}
{{block left_sidebar}}
{{include 'templates/cart/cart_sidebar.html'}}
{{end}}
{{extend 'layout.html'}}
*views/templates/cart/cart_sidebar.html*
hi,
is it possible to temporary store the uploaded file in session?
e.g.
import os
def form_1(session_order, link_form, link_checkout):
form = SQLFORM.factory(
Field('detail_account', 'reference detail_account',
requires = IS_IN_DB(current.db,
current.db.detail_account.id,
just an idea that got from a lot website, is they have separate table for
that, let say for login user it store in auth_user and then they build
another table let say profile that contain additional information about the
user, like : phone, address, hobby, etc and refer the table to the logged
i think you can use on delete database callback to execute sql syntax to
delete the inactive record.
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
pardon, i'm don't understand what you want to achieve, i guess is
e.g. the text you want to achieve
Remove them from your blocked list first! Megan Smith !
if is it i think you can achieve it with :
e.g. of code
session.flash = T('Remove them from your blocked list first! %s %s !') %
i think you can create your own controller for it
e.g.
controllers/admin.py
def user():
table = db.auth_user
grid = SQLFORM.grid(table)
return locals()
# group
def group():
table = db.auth_group
grid = SQLFORM.grid(table)
return locals()
# membership
def membership():
table = db.auth_membership
please take a look at this discussion :
https://groups.google.com/forum/#!topic/web2py/EXYT8U_Ws0M
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
pardon, i'm a little bit confuse with your code, i think you can create the
links in grid with the a href, and then put the represent for coloring it's
font via dal represent
e.g. not tested
table_status = {True, False}
db.table.is_active.represent = lambda is_active, field:
sorry, my bad, thank you so much for the correction, anthony
best regards,
stifan
On Wednesday, December 2, 2015 at 2:32:10 AM UTC+7, Anthony wrote:
>
> On Monday, November 30, 2015 at 8:19:09 PM UTC-5, Alex Glaros wrote:
>>
>> what is syntax for making links conditional in grid?
>>
>> I only
processing, you can do:
>
> if form.vars.is_booking:
>
> Anthony
>
> On Monday, November 30, 2015 at 8:33:31 PM UTC-5, 黄祥 wrote:
>>
>> the error traceback is say about the field customer is empty, so i
>> encountered it with IS_EMPTY_OR(IS_IN_DB() ) form validatio
there is sql.log file in databases folder of your applications, or you can
simply looking in the appadmin as well (near models)
best regards,
stifan
On Wednesday, December 2, 2015 at 6:37:12 AM UTC+7, Rob N wrote:
>
> Hi all,
>
> I'm looking for a way to be able to see all the SQL create
please try :
if db.auth_membership.is_active == True:
links = [...]
else:
links = None
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)
the error traceback is say about the field customer is empty, so i
encountered it with IS_EMPTY_OR(IS_IN_DB() ) form validation. but it's not
the main problem,
the main problem is when using form.validate() it seems that boolean field
type always return false answer even i already tick mark
is there any differences when form validation using onvalidation and
form.validate for boolean data type?
*example 1 work when using onvalidation*
# onvalidation_check_in
*def __onvalidation_check_in(form):*
* if form.vars.is_booking == 'on':*
if form.vars.booking_no:
rows = db(db.booking.id ==
i guess you have set :
step 1 :
auth.settings.actions_disabled = ['register']
step 2 set the callback :
def __after_insert_auth_user(f, id):
row = db(db.auth_user.id == id).select().first()
mail.send(mail.email, 'Login credential', 'Email : %s, Password : password'
% (mail.email) )
yes you are right, thanks for corrected me
best regards,
stifan
On Sunday, November 22, 2015 at 2:24:53 AM UTC+7, Anthony wrote:
>
> On Saturday, November 21, 2015 at 2:19:02 PM UTC-5, 黄祥 wrote:
>>
>> please try :
>> IS_IN_DB(db, db.auth_user.id, db.au
please try :
IS_IN_DB(db, db.auth_user.id, db.auth_user._format, orderby =
db.auth_user.first_name)
if not work, perhaps you modif your auth_user table (first_name field into
something else)
best regards,
stifan
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
-
tested it. return an error if i put the value int = 1 as true in
appconfig.ini
e.g.
privates/appconfig.ini
[auth]
create_user_groups = 0 ; return an error traceback when value = 1, when
value = 0, no error occured, works as expected
models/db.py
auth.settings.create_user_groups =
are passing in the string
> 'auth.create_user_groups' and not auth.create_user_groups as a variable?
>
>
>
> On Thu, Nov 19, 2015 at 9:32 PM, 黄祥 <steve.van...@gmail.com >
> wrote:
>
>> tested it. return an error if i put the value int = 1 as true in
>> appco
i think you can use conditional check auth.has_membership, either put it on
models/menu.py, controllers or even in views
e.g.
if auth.has_membership(role = 'Admin'):
best regards,
stifan
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
-
just an idea, why not use configuration management software like puppet,
chef, etc?
you can set the web2py file configuration, and push it according to your
setting environment (QA, Stage, Prod).
best regards,
stifan
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
-
i think you are in the right track, please try to fill the cell phones
table with some record, then access the config table, you can see the cell
phone field can be choosen more than 1 value (press shift).
best regards,
stifan
--
Resources:
- http://web2py.com
- http://web2py.com/book
please take a look at appconfig.ini file in private folder and change the
uri value with your own settings :
e.g.
private/appconfig.ini
[db]
uri = mysql://MySQLUser:MySQLPassword@MySQLHost/MySQLDatabase
best regards,
stifan
>
--
Resources:
- http://web2py.com
- http://web2py.com/book
i think you can use zero parameter in IS_IN_SET() validators.
ref:
http://web2py.com/books/default/chapter/29/07/forms-and-validators#Range--set-and-equality-validators
best regards,
stifan
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
-
801 - 900 of 1982 matches
Mail list logo