Hi !
I am using custom validators that I add to the validators.py file.
Unfortunately, It' overwritten at each upgrade of web2py. Is there a file
inside my site inside which I could put these custom validators ?
Thank you for your help.
--
Resources:
- http://web2py.com
-
Hi,
could it be that you don't increment your ? I think that
html doesn't care, but when passing it to python ?
--
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
Here's what I had in mind, if of any interest. This function does not work
(and it's a simplified one that dosn't take into account the multiple=True
in db.customer.guitar_ref). I'm not sure why it dosn't work. I think it's
because I call a function in the first arg of IS_IN_DB. If someone
Hi,
I have a function that works well and helps to compute the sum of fields
referenced by a list:reference field in another table :
table 'line' with field:
'price','double'
table 'invoice' with fields:
'line_id', 'list:reference'
'total','double'
def sum_total(row):
t=0
for
I nailed it... and I am ashamed :
> for id_line in row.line_id: t=t+db.line[id_line][line_field_name]
>
and not
for id_line in row.line_id: t=t+db.line[line_field_name][id_line]
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py
Use FIeld descriptor 'readable' and 'writable in the Field definition, or
added later using db.my_field.writable=False. It's in the book :
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer?search=writable%3D
You can also make a custom controller to get a form/view
I want to write something like that, but I know it's not correct because it
doesn't provide the link between the invoice._id considered and c_id :
c_id=db.invoice.customer_ref
g_id=db.customer[c_id].guitar_ref
db.invoice.guitar_ref.requires=IS_IN_DB(db(db.guitar._id==g_id),'guitar.id')
--
OK, that's the problem discussed in the "Validators with dependencies"
paragraph of the book. It took me some time to realize that. From what I've
read from other developers, it's not possible to solve this in the model if
I understand well, even if the book says so. I'll solve this by adding
This is my latest best try, but it still returns a syntax error when
executing (not when compiling) :
db.define_table('guitar',
Field('brand',type='string'))
db.define_table('customer',
Field('name',type='string'),
Hi,
I'm stuck so I think I'll ask some help, considering the ususal searches in
this group and book don't help enough considering my beginner level. I'll
try to summarize my problem: I'm writing an app to make quotes and invoice
for my business which is repairing and making guitars.
I seems like I forgot to add IS_TITLE() to the __all__ declaration or
whatever is its name in validators.py (I am not an developer, sorry for the
inapropriate vocabulary). It seems to work for now.
I am still open to some explanations (what is validators.pyc).
--
Resources:
-
This script is for ubuntu 14.04, not 12.04. Nothing stroke me but I could be
missing something. Did you try
sudo service apache2 restart
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
-
Did it returned any error or warning while executing?
--
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
Did it returned any error or warning while executing?
--
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
Cam you check that default.conf is in /etc/apache2/site-enable/, and that it
contains references to web2py?
--
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)
Hi,
I'm working on a web2py project, and I'm slowly learning. Thanks for all
the ressources available. I needed a new DAL validator like IS_UPPER() but
based on title(), so I looked over the source files and saw validators.py.
I added the class IS_TITLE() to it but it doesn't seems to be enough
Hi,
I don't understand why considering the usual :
db.define_table (person, Field('name'),format='%(name)s')
db.define_table (dog, Field('name'),Field('owner_id',db.person)
Using this is okay :
db.dog.owner_id.represent=lambda id,row:db.person(id).name
But using this fails :
computed, providing the price, but as
soon as I add the compute attribute, the price_with_taxes field is no
more displayed by the database admin form. Am I missing something? Why
isn't the field displayed?
Thank you for any help.
--
Pierre-Antoine ROIRON
ARTISAN LUTHIER
37, rue Sébastien Gryphe
18 matches
Mail list logo