Anthony,
I am facing one more problem, I have one text Field called Name where user
can input the name , i need to pass the entered name to controller function
but if I use like:
it is flashing error saying "name name_text_field is not defined" , even
text field is there in same form ,inside sa
In my models I have the following table definition:
db.define_table('node',
Field('computedName',length=128),
Field('computedSubClass',type='integer'),
Field('createdOn',type='datetime',default=request.now,requires=IS_DATETIME(format='%Y-%m-%d
%H:%M:%S'),writable=False,readable=Fals
I am righting a quick example app as I don't think anyone is really
understanding what I am saying :D I will email it within the next 30 mins.
On Tue, Aug 28, 2012 at 10:36 PM, Bruce Wade wrote:
> Conditional models will work, however not with the default design as you
> may have noticed. In you
Conditional models will work, however not with the default design as you
may have noticed. In youadworld there are some controllers that required
access to 20 tables and others that required access to only a few tables.
The technique I used works perfect for that without ever duplicating the
model
I have a problem with the ckeditor function LOAD (., ajax = True)
error : It pass the wrong part.
please .. any help, cues or snippets of codes to accomplish this ... will
be greatly appreciated
Picheth.
--
pbreit- Yeah I thought about letting apache handle the public part, but
that still leaves me in the lurch because I can't use web2py to determine
whether the user is logged in, which is how we decide whether to deliver
the public or private portion to begin with. So the only practical course
is
Fair enough. If there's no processing at all, best to serve the static site
direct through Nginx/Apache. Otherwise, as you note, conditional models may
not work so waiting for "lazy tables" might be best (should be any day now
in 2.0).
On Tuesday, August 28, 2012 8:55:35 PM UTC-7, Yarin wrote:
Hey Bruce- again, it doesn't appear that you can use conditional models for
more than one controller at a time, and we're dealing with a large app
where multiple controllers need to load shared models. Massimo's stated as
much. Unless you've got a novel approach I don't see how that can be a
so
I'm distributing and supporting a project made with web2py as a set of RPMs
(RHEL/CentOS/SL) for a while now. No big problems... I use Mock on SL6 to
generate the RPMs.
This project is fairly complex and involves much more than just web2py app,
so my spec files wouldn't be applicaple straight a
Hi Yarin,
Using conditional models will allow you to not load any models when you
don't need them. Your idea of moving the brochure part of the site so it
doesn't even get loaded by web2py will definitely increase performance
however if you just remove the need for loading the models that should b
Who said anything about premature? We want our app to run faster, and we
are gonna worry about it.
On Tuesday, August 28, 2012 11:49:22 PM UTC-4, pbreit wrote:
>
> If you haven't determined a performance issue, best to not worry about it
> ("premature optimization -> evil").
>
>
> On Tuesday, Au
If you haven't determined a performance issue, best to not worry about it
("premature optimization -> evil").
On Tuesday, August 28, 2012 6:52:12 PM UTC-7, Yarin wrote:
>
> A basic architecture question:
>
> We're putting together a typical web app where non-logged in users reach a
> public-fac
- "use two apps" - How? Don't I still need to check against the auth
session of the private app to see if the user is logged in, and so still
would load models each time.
- "move all public controllers under the same file" - This is totally
impractical and goes against your o
hello one and all,
i want to store python code as a string in a text field of a table in a db,
much like the code we write and store in a web2py view. at the right time,
i want to compile the string into executed code and say the final line of
the code be: "return = dict(...)". or after the c
It is ready but we cannot stop tweaking it ...
we replaced 16,000 lines of code and we added 41,000 new lines when
compared with web2py 1.99.2 (minified js count as one line).
We may release it tomorrow.
--
oops. Do not have a solution other than use two apps or move all public
controllers under the same file or use lazy_tables.
On Tuesday, 28 August 2012 22:28:09 UTC-5, Yarin wrote:
>
> But my app has 13 private controllers and 1 public controller?
>
> On Tuesday, August 28, 2012 11:21:46 PM UTC-4,
But my app has 13 private controllers and 1 public controller?
On Tuesday, August 28, 2012 11:21:46 PM UTC-4, Massimo Di Pierro wrote:
>
> You just need two controllers say:
>
> controllers/public.py
> controllers/private.py
>
> then put your model files like db.py in
>
> models/private/db.py
>
>
Hello everyone,
The report feature I've been toiling over is now finished - YEA! and ready
to be to deployed to the /opt/www/web2py directory of the various machines.
This is a task for puppet, which we use for config & package management as
it handles RPMs and custom repos extremely well, so t
You just need two controllers say:
controllers/public.py
controllers/private.py
then put your model files like db.py in
models/private/db.py
They will not load when you call actions in public.
Massimo
On Tuesday, 28 August 2012 22:19:03 UTC-5, Yarin wrote:
>
> And now I'm also not sure how to
And now I'm also not sure how to go about separating the public site into a
separate application- wouldn't I still need to hit the 'real' application
to check the whether the user is logged in or not, thereby requiring model
loads on every request anyway?
On Tuesday, August 28, 2012 11:09:43 PM
Thanks guys but don't understand how conditional models could be applied
here. I thought conditional models were models specific to a single
controller/function? My app has many controllers that use the models, and
only a few basic pages where I don't want models to load- how would
conditional
Probably not, but the code might give you some ideas.
On Tuesday, August 28, 2012 6:43:20 PM UTC-4, Daniel Gonzalez wrote:
>
> that example uses SQLFORM. Will it work with FORM?
> Am 29.08.2012 00:36 schrieb "Anthony" >:
>
>> You might try this: http://dev.s-cubism.com/plugin_notemptymarker
>>
>>
- You can use conditional models.
- You can use IF on models
if not request.controller == "public":
# my logic goes here
- You can go to the option B (simple separate app)
- You can serve the login form as static html file
http://yourapp/static/public.html
- You can use lazy_ta
On 28 Aug 2012, at 6:52 PM, Yarin wrote:
> A basic architecture question:
>
> We're putting together a typical web app where non-logged in users reach a
> public-facing basic 'brochure' site, and then log in to reach the 'real'
> application. With such a setup, it makes no sense to be loading m
A basic architecture question:
We're putting together a typical web app where non-logged in users reach a
public-facing basic 'brochure' site, and then log in to reach the 'real'
application. With such a setup, it makes no sense to be loading models for
the public portion of the site, as it's j
GLib.py put in the directory modules. Import it from the model file
scheduler.py. Run it in the background with the parameters db and session.
it works!
Thank you! The question is closed...
вторник, 28 августа 2012 г., 20:17:40 UTC+4 пользователь Massimo Di Pierro
написал:
>
> The definitively
I know this has been asked before, but things may have changed...
Does anyone have any good suggestions regarding JS client-side Markmin
editors.
1. Best editor to assist users to do markup? Markitup is still the only
one?
2. Is there a WSIWYG editor which saves in Markmin. I didn't find o
Hello,
I am trying to cook up something with a list or tuples of images, but it
does not and cannot show up in the view within a form ...
( let me show some codes )
a basic model file
user_sex = [SPAN(IMG(_src=(URL('static','images/male_thumb.png',SPAN(IMG
(_src=(URL('static','images/fema
Hi Massimo,
I double checked and all foreign keys are declared as "reference
table_name". I also used the {{=response.toolbar()}} and looking at the
tables item I see the expected tables are defined for each function and
tables not in use are indeed lazy. All the pages except the initial landin
This could help with the translation task, although does not solve handling
large amounts of data:
http://code.google.com/p/plugin-multitranslate/
I belive large sets of text could be splitted and rejoined for large text
translations. Perhaps I could add that feature to the plugin (or does
web
> You seem to need access to the Wiki object in more then one controller.
Why?
One case of use is described in issue 962 (now fixed, about re-using the
wiki model)
Other possible case: I intend to give access to wiki documents from a view
in a plugin, i.e.:
controllers/plugin_bavaria.py
def w
Is it possible to get some html content into the session.flash message?
I would like to include an "undo" link for a delete action.
Could also be nice to easily access newly created content.
Thank you.
--
that example uses SQLFORM. Will it work with FORM?
Am 29.08.2012 00:36 schrieb "Anthony" :
> You might try this: http://dev.s-cubism.com/plugin_notemptymarker
>
> Anthony
>
> On Tuesday, August 28, 2012 6:17:22 PM UTC-4, Daniel Gonzalez wrote:
>>
>> Hi,
>>
>> I am defining a non-database bound for
You might try this: http://dev.s-cubism.com/plugin_notemptymarker
Anthony
On Tuesday, August 28, 2012 6:17:22 PM UTC-4, Daniel Gonzalez wrote:
>
> Hi,
>
> I am defining a non-database bound form with FORM, using INPUT, SELECT and
> so on. Most of my fields have "requires" parameters, which are p
Hi,
I am defining a non-database bound form with FORM, using INPUT, SELECT and
so on. Most of my fields have "requires" parameters, which are properly
validated by web2py.
I would like to provide visual clues when rendering the form about which
fields are required and which are not, using aster
If you want I can make a diff over 1.99.4 and 1.99.5 and try to locate what
breaks the old behavior... Also, I understand that it was something
experimental, but I think it is pretty usefull for legacy database users.
I will try trunk tomorrow to see if your fix works as expect.
Thank you Massimo
For now I have committed a fix in trunk. I am not sure it belong there? It
is not obvious to me the previous behavior was better or not (the feature
you are using was never documented).
Pros? Cons?
On Tuesday, 28 August 2012 11:56:13 UTC-5, Richard wrote:
>
> FYI what you suggest trigger this e
Congrats!
I am eager now more then ever to have version 2.0
:)
Richard
On Tue, Aug 28, 2012 at 3:53 PM, Bruno Rocha wrote:
> For me on Linux Ubuntu 12.10
>
> bcr@vaiubuntu:~/projects/web2py21$ python web2py.py -S welcome -N -R
> ../thisfile.py
> web2py Web Framework
> Created by Massimo Di Pi
For me on Linux Ubuntu 12.10
bcr@vaiubuntu:~/projects/web2py21$ python web2py.py -S welcome -N -R
../thisfile.py
web2py Web Framework
Created by Massimo Di Pierro, Copyright 2007-2012
Version 2.00.1 (2012-08-28 14:26:44) rc4
Database drivers available: SQLite3, pymysql, psycopg2, pg8000, IMAP
tim
Hi Andrew,
I've updated the issue on your github link. thanks
margaret
On Sunday, August 26, 2012 9:32:13 AM UTC-5, Andrew wrote:
>
> Hi Margaret :)
>
> You certainly could use an ssh tunnel. I just prefer to get it working in
> a natural anonymous web access way where I can access it from anyw
The mercurial people people keep changing the API every version. they do
not seem to care of users who use mercurial programmatically.
On Tuesday, 28 August 2012 11:47:50 UTC-5, Jonathan Lundell wrote:
>
> On 28 Aug 2012, at 9:40 AM, Massimo Di Pierro
> >
> wrote:
>
> Which web2py version? whi
# run with web2py.py -S welcome -N -R thisfile.py
import time
db=DAL()
db.define_table('test',Field('one'))
db(db.test).delete()
for k in range(1000):
db.test.insert(one='one')
db.commit()
n = 100
t0 = time.time()
for k in range(n):
y = db.test.one
print
problem here is basically: when you change the password tables are
created/consistent with your model or not ?
Seems to me that it's your case (you just have to change the password,
tables and columns are there). If so, just delete all in /databases and set
fake_migrate_all: it should recreate a
On 28 Aug 2012, at 10:17 AM, Chris wrote:
> Background: web2py keeps track of database definitions using files in each
> app's ./databases directory. The basic concept is, for each table definition
> a pickle file is created storing attributes defined in web2py / not
> necessarily defined in t
Background: web2py keeps track of database definitions using files in each
app's ./databases directory. The basic concept is, for each table
definition a pickle file is created storing attributes defined in web2py /
not necessarily defined in the database; and the name of each pickle file
inco
FYI what you suggest trigger this error message :
Object exists and cannot be redefined: id
Richard
On Tue, Aug 28, 2012 at 12:46 PM, Richard Vézina <
ml.richard.vez...@gmail.com> wrote:
> Not sure I follow, in the pass we were allowed to define a legacy id for a
> table like this :
>
> db.def
make_a_set = (query)
Than use IS_IN_DB(db(make_a_set),...)
Richard
On Tue, Aug 28, 2012 at 12:28 PM, lyn2py wrote:
> Hello experts,
>
> Generally, when we do a SQLFORM, the 'reference table' fields
> automatically gets *all* the available options for choosing as a dropdown
> menu.
>
> However,
Yes. By default, a reference field gets a validator like this: IS_IN_DB(db,
db.sometable._id, db.sometable._format). However, the IS_IN_DB() validator
can take a Set object as the first argument instead of db, and the list
will be based on the records defined by that Set. In that case, you'll ha
On 28 Aug 2012, at 9:40 AM, Massimo Di Pierro
wrote:
> Which web2py version? which python version?
Note that that particular message implies that 'from mercurial import ui, hg,
cmdutil' yielded an ImportError. Try the import from python directly.
>
> On Tuesday, 28 August 2012 10:59:25 UTC-5,
Not sure I follow, in the pass we were allowed to define a legacy id for a
table like this :
db.define_table('test_endotoxin',
*Field('something_id','id'),*
Field('result','decimal(10,2)',
notnull=True,
requires=[IS_NOT_EMPTY(error_message=T('field can\'t be empty')),
Which web2py version? which python version?
On Tuesday, 28 August 2012 10:59:25 UTC-5, Sergi Pons Freixes wrote:
>
> Hi all,
>
> I have mercurial installed:
>
> # dpkg -l |grep mercurial
> ii mercurial 1.6.4-1
Did you init a user for mercurial?
http://manpages.ubuntu.com/manpages/hardy/man5/hgrc.5.html
Also you need to create a repo for your app :
hg init
You have to ignore some folder like sessions, cache, etc.
Then you should be able to use web2py to commit, I don't know if it still
the case, but
How about
table.id = Field.Virtual(lambda row: row.table.something_id)
On Tuesday, 28 August 2012 10:30:37 UTC-5, Richard wrote:
>
> Hello Massimo,
>
> I notice when I try to migrate to 1.99.7 some times ago that I could not
> anymore do something like this :
>
> rows = db(db.table.id>0).select(
I'd expect something better. Add {{=response.toolbar()}} to your layout. It
will tell you which tables are lazy and which ones are now. Make you do no
have more tables than you need.
For example using Field('',db.auth_user) forces db.auth_user even if
not needed. Field('','reference aut
I cannot reproduce the problem but I do not have a de.py language. I tried
with italian and it works. Is de-de.py it supposed to be there?
Anyway, can you send me a minimalist app to reproduce? Can you check latest
trunk? We did change some internal logic about languages.
massimo
On Tuesday,
Hello experts,
Generally, when we do a SQLFORM, the 'reference table' fields automatically
gets *all* the available options for choosing as a dropdown menu.
However, I would like to get a filtered list instead of *all* of the items.
Is there an available function I can use to achieve a filtered
It depends. Can you tell us more about the structure of the data?
On Tuesday, 28 August 2012 00:17:02 UTC-5, encompass wrote:
>
> I am wanting to create large amounts of content that needs to be
> translated. Is the Lazy T() way the best for this?
> Whole pages of text will need to be translate
The definitively goes in modules.
On Monday, 27 August 2012 23:50:27 UTC-5, aabelyakov wrote:
>
> gLib.py - this is a common library of functions and procedures. It uses
> global variables attached to the session.
>
> понедельник, 27 августа 2012 г., 23:00:37 UTC+4 пользователь Massimo Di
> Pier
Let us know if this works. This served a blog post. I am sure there is a
large community who may be interested in this... although not regular
web2py users.
On Monday, 27 August 2012 21:41:48 UTC-5, Rob_McC wrote:
>
> *Thanks* Massimo...
>
> I didn't know you could do it without modifying the .p
Hi all,
I have mercurial installed:
# dpkg -l |grep mercurial
ii mercurial 1.6.4-1 scalable
distributed version control system
Hello Massimo,
I notice when I try to migrate to 1.99.7 some times ago that I could not
anymore do something like this :
rows = db(db.table.id>0).select()
for row in rows:
print row.id
I can did it before 1.99.5.
Has Anthony wrote in this thread :
https://groups.google.com/forum/#!msg/we
To see what the set return :
print db((~db.trainer.id.belongs(db()._select(db.dogs.trainer
When you will be into the web2py shell.
Richard
On Tue, Aug 28, 2012 at 10:22 AM, Richard Vézina <
ml.richard.vez...@gmail.com> wrote:
> Hi Bill,
>
> Did you try you set into the web2py shell to see
Hi Bill,
Did you try you set into the web2py shell to see if it returns something?
I usually try my query in a terminal web2py shell to make sure my query are
good before waisting time in navigator reloading page.
Here how you can start a web2py shell :
cd into the web2py folder
Than :
python
Tuples are unmutable (you can't change them), so they don't have a replace
attribute. I you want to change your the values into your tuples use list
instead.
Richard
On Tue, Aug 28, 2012 at 3:44 AM, Bill Thayer wrote:
> The example from the web2py application cookbook runs fine but when I
> twe
With the query I suggest yesterday, I don't think he need is_active. For
sure if this field is not update to true when assign a dog a new trainer,
they (trainers) will never be active so they will be in the dropbox for
ever.
Richard
On Tue, Aug 28, 2012 at 6:27 AM, villas wrote:
> 1. Did you tr
Ok, Thank Jose Luis.
Regards
El domingo, 26 de agosto de 2012 10:18:02 UTC-3, José Luis Redrejo
Rodríguez escribió:
>
>
> Hi, Matias, this an English language only mailing list. Anyway, if I were
> you I'd take a look to eXe learning.
>
> Regards
> El 22/08/2012 00:03, "Matol" >
> escribi
I can't find the signed_request sent by facebook whenever my application is
loaded within a Canvas page!!
I looked over all places and nothing anyone can help me??
--
Instead of a default database, how about something like this:
session.database = session.database or request.vars.database
if not session.database or session.database not in ['list', 'of', 'valid',
'databases']:
redirect(URL('default', 'index'))
baza = DAL('postgres://postgres:postgres@local
If the user input must fit very specific criteria, then you can use a
validator, such as IS_MATCH or IS_EXPR to validate it before using it to
construct your query. For more general inputs, you should probably not
attempt to escape the input yourself, as it is difficult to get right.
Instead, y
Found no problems running my production code against today's trunk.
Didn't change the models.
I use grid to manage configuration items like currencies, locations,
payment terms, delivery terms.
More complex objects involve many-to-many relationships; lots of table
joins, but very vanilla stuff
>From the manual:
A field also has methods. Some of them are used to build queries and we
will seem them later. A special method of the field object is validate and
it calls the validators for the field.
print db.person.name.validate('John')
which returns a tuple (value, error). error is None i
1. Did you try pasting my code exactly as I wrote it? If you are hesitant
about overwriting your existing work, then simply rename, within my code,
the dogs and trainers to something like cats and groomers and try it
totally independently of everything else you have done.
2. I have ignored
Hi all,
with the latest trunk the datetime translation seems to be broken.
In models.py I have defined:
db.timeevent.start.requires = [IS_NOT_EMPTY(),
IS_DATETIME(format=T('%Y-%m-%d %H:%M:%S'))]
db.timeevent.finish.requires = IS_DATETIME(format=T('%Y-%m-%d %H:%M:%S'))
and in languages de-de.p
The example from the web2py application cookbook runs fine but when I tweak
it I get
'tuple' object has no attribute 'replace'
In the code below, mine is on top named test() for input a test request.
The function named wizard came from the cookbook.
def tests():
STEPS = {
0: ('db.t
Where do I put database = session.get('database','default_database') ??
In model?
So if I understand correctly first there has to be a default database, but
then after user selects the value a connection is set for the selected
database?
On Monday, August 27, 2012 8:59:03 PM UTC+2, Massimo
75 matches
Mail list logo