I will give a very simplified example of my task (pl. excuse me if it
is still verbose).
A form deals with Automobile Vehicle Models - Warranty Master.
It displays the model names (of vehicles).
User selects a model to modify warranty details.
The form displays : 1) select basic warranty and 2)
Hi,
at this link
http://www.web2py.com/book/default/chapter/07#Validators-with-Dependencies
is still reported a wrong example that uses a not existent validator
IS_SAME_AS instead of IS_EQUAL_TO
is it the right place to report this kind of stuff?
Thanks
Manuele
Hi,
Reading past posts about this topic and the book I didn't realize how to
solve it. Imagine to have the subsequent controller called bar
d = dict(
a=[1,2,3],
b=[4,5,6])
def foo(k):
if k in d:
return d[k]
else:
l = []
for i in d.values():
Normalizing is not always the best approach. If the database has not yet
been designed, perhaps reconsider. I still don't really understand what you
are trying to do but 5 small tables might not be necessary.
I would suggest getting some code working with 2 tables an then go from
there.
Some
On 9 May 2011 15:16, Massimo Di Pierro massimo.dipie...@gmail.com wrote:
The widget take as argument the table itself which is not yet defined.
you have to do it in two steps:
db.define_table('doccenter', Field('doc_nr', type='string',
length=50,
Hi, I'd like to enable logging so I can see the various warnings that
web2py might be issuing.
I am running Version 1.91.6 (2011-01-03 17:55:14), using apache2 and
WSDL on Centos 5.5.
I copied logging.example.conf to logging.conf, and restarted apache.
I would expect to see logging on the
I found my log messages. When using consoleHandler with apache/WSDL,
apparently, the logging messages go to the server error log, not the
console.
When trying to send registration or lost password email, web2py
flashes that it cannot send email (so registration fails) and logs
[Wed May 11 10:07:31 2011] [error] 2011-05-11 10:07:31,049 - web2py -
WARNING - Mail.send failure:login() takes exactly 3 arguments (2
given)
My app's db.py says:
i have never botherd with this bug very much, but i think this could
be solved by giving the login form a proper action and the class
no_trap
ok maybe a bit more info
if you have a component that has a @auth.requires_login() decorator
the login form shows if you are not logged in, however the login
fails,
this is i think due to trap_form of the component
and could be prevented if the login form gets a no_trap class
On May 11, 12:46 pm,
Good catch, thank you.
Fixed.
(and yes, this is the place to report such things)
On May 11, 3:27 am, Manuele Pesenti manuele.pese...@gmail.com wrote:
Hi,
at this
linkhttp://www.web2py.com/book/default/chapter/07#Validators-with-Depende...
is still reported a wrong example that uses a not
LOL
On May 11, 1:30 am, mart msenecal...@gmail.com wrote:
that's hilarious! I think it may be synonymous to enterprise
as a note (just because my blood/caffeine ratio hit the roof)... @ my
previous employment, my group was just an acquisition... no,no,no,...
we were THE acquisition that
Hi Manuele,
1) 'value' ultimately depends on a static dictionary (d)
2) web2py executes models/controllers on every request
then you would have to store the dictionary in the session (or in the
DB), as shown in
http://web2py.com/book/default/chapter/03#Let%27s-Count
On May 11, 4:22 am,
gluon/tools.py contains this code:
if self.settings.login != None:
...
server.login(*self.settings.login.split(':',1))
I think you must have somewhere a statement like
auth.settings.login = ...
and the ... is missing a : separating
LOL
so how about web2py: rapid development platform for your enterprise?
On May 11, 12:30 am, mart msenecal...@gmail.com wrote:
that's hilarious! I think it may be synonymous to enterprise
as a note (just because my blood/caffeine ratio hit the roof)... @ my
previous employment, my group
Mart has a valid point. We need a tagline that differentiates us from
the many toys out there. Where by toy I mean half baked, unstable,
hard to maintain, constantly breaking backward compatibility, glued
frameworks.
On May 11, 12:30 am, mart msenecal...@gmail.com wrote:
that's hilarious! I
On 11/05/2011 15:04, DenesL wrote:
Hi Manuele,
1) 'value' ultimately depends on a static dictionary (d)
2) web2py executes models/controllers on every request
then you would have to store the dictionary in the session (or in the
DB), as shown in
I have a scenario where there are 2 methods. A and B
A uses form1
and
B uses form2
Now, I need to pass a dynamic value of a variable from A( using
form1 ) to B .
I want to pass this variable to a menu item. Once the menu is clicked
that particular form should have my dynamic variable.
Is there
It would become easier to understand if you brought your concrete
example but why don't consider to use a single form for both purposes?
Even if that form allows 2 difference use cases (which shall be
appropriately handled by the right controller) that could help...
Alternatively you could use
Hello, I was wondering if there's a way to limit the allowed number of
insertable objects in the DAL, without the need to manually check it
in the controller? Suppose I have a table of pineapples that is owned
by a user, and I want the user to only be allowed three(3) pineapples?
Of course that
This message shows up in my error log too, but I haven't had time to
look into it. It might have something to do with the configuration of
auth in db.py in the scaffolding code created when you create a new
app (through admin panel).
On May 11, 8:23 am, Massimo Di Pierro
You can probably do it with a Validator. It may need to be custom:
http://web2py.com/book/default/chapter/07#Validators
But I wouldn't worry so much about cluttering your controller. That's what
it's for!
I thought we were leaning towards Rapid development that scales?
It works fine for me. I'm not sure I understand what you are reporting. Is
your site publicly viewable so we can see the problem?
I think may be easier to skick an if statement in the action
if db(db.table.owner==auth.user.id).count()=3:
redirect(URL(...))
On May 11, 9:41 am, Arbie Samong phek...@gmail.com wrote:
Hello, I was wondering if there's a way to limit the allowed number of
insertable objects in the DAL,
2011/5/11 pbreit pbreitenb...@gmail.com:
It works fine for me. I'm not sure I understand what you are reporting. Is
your site publicly viewable so we can see the problem?
I can second what selecta says.
pbreit, try this:
controller:
---
@auth.requires_login()
def asdf():
return
2011/5/11 Bruno Rocha rochacbr...@gmail.com:
Automatic form styles
http://www.dfc-e.com/metiers/multimedia/opensource/jqtransform/
plus:
http://www.dfc-e.com/metiers/multimedia/opensource/jquery-fancyzoom/
--
Bruno Rocha
[ About me: http://zerp.ly/rochacbruno ]
this is great, altougth
2011/5/11 danto web2py.n...@gmail.com:
2011/5/11 Bruno Rocha rochacbr...@gmail.com:
Automatic form styles
http://www.dfc-e.com/metiers/multimedia/opensource/jqtransform/
plus:
http://www.dfc-e.com/metiers/multimedia/opensource/jquery-fancyzoom/
--
Bruno Rocha
[ About me:
here's a thought...
enterprise -- I think we had the word first, in French, then we
loaned it out ;) LOL
In English enterprise, same word but doesn't conjugate the same
because the monks made verbs of the 3rd group impossible to pronounce
for non-native speakers. English is undertake,
As indicated by others, you could try out an obfuscator:
http://www.lysator.liu.se/~astrand/projects/pyobfuscate/
But to tell the truth: if secrecy is this important, python might not
be the best tool for the job.
From the responses I've gotten here, and research elsewhere, I think there
are only two real options:
1. Obfuscate and compile
2. Use Cython to turn Python code files into C modules.
Other option could be to somehow use cx_Freeze or similar tool to wrap the
entire web2py installation. However,
I can't say I've ever really tried this, but maybe you could do something
like this in your model:
db.pineapple_insert(**kwargs):
if db(db.pineapple.id 0).count() = 3:
raise Exception('There are already 3 pineapples in this table.')
else:
db.pineapple.insert(**kwargs)
I've really gotta start proofreading my responses. This is a better version
that the one I just gave (goes at the bottom of the model):
def pineapple_insert(**kwargs):
if db(db.pineapple.owner == auth.user.id).count() = 3:
raise Exception('There are already 3 pineapples for this
Hmmm...I haven't seen that pattern. I always put the LOAD() in a view. And
decorate the calling controller. I don't see why or when you'd ever want to
protect an individual component.
Hello to all!
As a new user of web2py, i tried (successfully) to create a form that
uses SQLFORM.factory(db.table1, db.table2).
The information for that was found in Chapter 7 of the web2py Book,
Section One form for multiple tables.
But i can not find information how to UPDATE table1 AND
On Sunday, December 28, 2008 3:43:55 AM UTC-5, mdipierro wrote:
in trunk now... IS_IN_DB(orderby=)
I realize that this thread is like 2.5 years old, but this should be in the
book. I was looking for this functionality and found it here.
thanks for the replies guys, I eventually settled for a custom
validator. I tried to put it in the controller but somehow I can't
check if the form was submitted, and calling
form.accepts(request.vars, session) already inserts the value
MAX_ENTRIES = 3
class CAN_ADD(object):
def
You should be able to update or update_record using the form.vars
http://web2py.com/book/default/chapter/06#count,-delete,-update
http://web2py.com/book/default/chapter/06#update_record
I think VP is correct. There is a confusion between mail.settings.*
in db.py and settings.* in 0.py. I configured the mail.settings.*
lines in db.py, not realizing that further down below in db.py, they
redefine all those variables, based on the contents of settings that
are created in 0.py.
http://projects.unbit.it/uwsgi/wiki/Example
Ran across this in a blog, written in Python,
http://mitmproxy.org/
from the web page:
*mitmproxy* is an SSL-capable, intercepting HTTP proxy. It provides a
console interface that allows traffic flows to be inspected and edited on
the fly.
*mitmdump* is the command-line version of
I use the following line in a controller to add a blank record.
record_id = db.mytable.insert()
This works fine using MySQL but crashes with sqlite. The error is:
File /root/staging/1.94.5/web2py/gluon/dal.py, line 4344, in insert
return
I'm not able to find anything SQLite specific, but this is what the
MySQL docs say about empty rows:
If both the column list and the VALUES list are empty, INSERT creates
a row with each column set to its default value:
INSERT INTO tbl_name () VALUES();
In strict mode, an error occurs if any
Hello again!
I am using Web2py 1.95.1 on Windows XP, inside Internet Explorer 7.
While researching the capabilities of SQLFORM, i have stumbled upon
one strange thing:
when i used deletable=True in a SQLFORM, there was no checkbox
visible, while rendering the form.
The form renders fine. Just
I had to look this up:
http://en.wikipedia.org/wiki/One-man_band
On May 11, 3:29 pm, elffikk elff...@gmail.com wrote:
http://projects.unbit.it/uwsgi/wiki/Example
http://googleappengine.blogspot.com/2011/05/app-engine-150-release.html
Massimo, if I remember correctly you had access to an early release of
appengine so you could prepare web2y. Any developments?
I think if you have at least one column with a default value web2py
should not fail.
On May 11, 7:50 pm, Jim Karsten iiijjj...@gmail.com wrote:
I use the following line in a controller to add a blank record.
record_id = db.mytable.insert()
This works fine using MySQL but crashes with sqlite.
So?
What did they mean?
This:
http://code.google.com/p/web2py/source/detail?r=f86141197efa2caf5305d4c066c957077377948f
db=DAL('google:sql')
has been in stable for almost one month and I have tested it both with
the SDK and in production.
All the normal SQL features supported by web2py including migrations,
joins,
It is still not clear to me if they mean
a framework that does a little bit of everything (compliment)
or
a framework that does a little bit of everything (not compliment)
or
a framework with one developer
(which I do not think is the case because I trust they know better)
Anyway, perhaps
Made me think of this...
http://www.youtube.com/watch?v=CiVlAevviq8
On May 11, 9:42 pm, JorgeRpo jorgeh...@gmail.com wrote:
So?
What did they mean?
I can't, there's no record instance... So it's .update for me.
On May 11, 12:53 am, Thadeus Burgess thade...@thadeusb.com wrote:
Use ``update_record`` instead of ``update``.
the ``update`` function comes from the dict parent class, and does not issue
SQL.
``update_record`` is a web2py
On 05/12/2011 05:42 AM, JorgeRpo wrote:
So?
What did they mean?
It takes both ways.
You can build your app with one program from top to bottom. Editor and all.
Most if not all the tools you will need are built in.
You don't need to go and grab special stuff all over, the batteries are
Looked and looked but I couldn't fine where you place a file with
methods and classes in the modules directory and then you can import them.
Could I see where that is in the book or perhaps some instruction here?
Best Regards,
Jason
here's the code I used.
http://pastie.org/1891534
what's weird is that I know that CRYPT works in my other apps, it's
just in this particular controller that it isn't working right.
And in my case, my logical test is == and not !=. My problem is
the unecrypted
variable...
On May 10, 10:54 pm,
here:
http://web2py.com/book/default/chapter/04#Third-Party-Modules
--
web2py provides another way to import modules in such a way that the global
sys.path is not altered: by placing them in the modules folder of an
application. One side
when the updates come, bruno?
is it for web2py package or web2py books?
i'll wait for both, thank you so much for your info.
On Thu, May 12, 2011 at 10:35 AM, Bruno Rocha rochacbr...@gmail.com wrote:
here:
http://web2py.com/book/default/chapter/04#Third-Party-Modules
On Wednesday, May 11, 2011 11:41:32 PM UTC-4, 黄祥 wrote:
when the updates come, bruno?
is it for web2py package or web2py books?
The changes he's referring to are already in trunk and are mentioned here:
https://groups.google.com/forum/?fromgroups#!topic/web2py/p2v_QVdLjxQ.
Assuming
a, i c, i followed the forum discussion too about web2py new version, but, i
think it'll be great if the new feature is well documented how to use,
combine and improve it.
btw, thanks for your info, anthony
On Thu, May 12, 2011 at 10:48 AM, Anthony abasta...@gmail.com wrote:
On Wednesday, May
On Thu, May 12, 2011 at 12:48 AM, Anthony abasta...@gmail.com wrote:
Who knows when the book will be updated (hopefully not long after)?
Massimo said, that book will be updated nearly August. BTW I think this kind
of change could be included in the actual version of the book when it be
more
I think you've got a simple typo in you code -- in SQLFORM.factory, you have
a ')' at the end of the Field line, so your 'requires' ends up being a
SQLFORM.factory argument instead of a Field argument. It should be:
form=SQLFORM.factory(
Field('card_number','string',comment='with
It is still not clear to me if they mean
a framework that does a little bit of everything (compliment)
or
a framework that does a little bit of everything (not compliment)
or
a framework with one developer
(which I do not think is the case because I trust they know better)
Anyway,
On Thu, May 12, 2011 at 2:00 AM, Roberto De Ioris robe...@unbit.it wrote:
You have to read it in the rock/heavy metal way, where Web2Py is the
talented player that can manage every intrument,
http://en.wikipedia.org/wiki/Ayreon
On Thu, May 12, 2011 at 2:00 AM, Roberto De Ioris robe...@unbit.it
wrote:
You have to read it in the rock/heavy metal way, where Web2Py is the
talented player that can manage every intrument,
http://en.wikipedia.org/wiki/Ayreon
Exactly :)
--
Roberto De Ioris
http://unbit.it
Yeah, happy that is improving. I will do it this way for now, as it
take a bit before I upgrade the server.
It don't like the way it is here in the book.
BR,
Jason Brower
On 05/12/2011 06:35 AM, Bruno Rocha wrote:
here:
http://web2py.com/book/default/chapter/04#Third-Party-Modules
65 matches
Mail list logo