I read some post about models influencing performance. At the moment I have
all table definitions (48) in one file: 10_tables_db.py
I'd like to make them conditional, however, most tables are used in two
controllers, is it possible to put table definitions in:
Hi Yogesh,
After trying different approaches, I decided to do the following: define a
table 'Node' and a table 'person' referencing 'node' this gives me the
opportunity to have a table 'organization' too. All other tables including
'address' reference the table 'node'.
I added an extra field
How to set text limitation (maxlength) in a div ? Text is going
out of the div?
Right now you can't have one model apply to two different controllers with
conditional models. Copy/pasting should work but I would rarely advise
that. Are you running into performance problems? Have you tried any other
optimizations? 48 tables is kind of a lot but not crazy.
You want style of overflow:hidden I believe.
Oh, yeah, you're not going to want to have tons of forms but instead id
each form.
Thanks Annet.
This is the exact plan i was having.. Since i am new to python and web2py
both. Was little stuck..
I also tried checking out code of conf2py.. for registration details...
*Also, are you able to edit details of the user profile.*
Since when i used different tables i was not able
Thanks Annet, that's what I currently have, but it doesn't allow for
CRUD of anything but the outer table, it won't allow for CRUD of any
of the inner tables.
I would like—either in the drop down or as an Add/modify link next
to it—the ability to CRUD entries in that referenced table.
If there
Right now you can't have one model apply to two different controllers with
conditional models. Copy/pasting should work but I would rarely advise
that. Are you running into performance problems?
No, but I read the posts in the group, and thought I'd better prevent
running into
When I asked this question, pbreit, provided me with the following solution:
'''
I'd probably use a function or virtual field for that, not store it in DB.
And it could be cleaned up a bit. Something like:
def trunc_desc(s)
if len(s) 128:
return s[:128] + '...'
return s
'''
Vibhor What have you put inside the div
To my understanding use a label. and if you are having something
descriptive use p/p.
CSS Control is always better...
Please correct me if I'm wrong, but as far as I understand tornado cannot
be used with free hosting?
(or can it?)
omg, that is so totally working. cool.
i am almost there. i added this at the top of my function
if ((request.vars._formnameNone) and
(request.vars._formname.rfind('opinion_')-1)):
f = SQLFORM(db.lecture_item_opinions)
f.vars.lecture_id=lecture.id
put you table definitions on modules and use conditional models to
instantiate them.
http://zerp.ly/rochacbruno
Em 15/05/2012 05:44, Annet anneve...@googlemail.com escreveu:
Right now you can't have one model apply to two different controllers with
conditional models. Copy/pasting should work
That problem is simply due to the fact that in facebook the
application has been registered with a domain name and a base url that
differ from the one where your web2py application is published.
Sometimes even changing the domain name in facebook form does not
correct the problem. In that case
Hello. I'm now trying to use redhat openshift.
I am struggling access database - mysql-5.1 - which is set via openshift
cartridge.
I got admin user(admin), password and database name(we2py).
So I modified database setting in models/db.py
as
db =
You haven't actually stated your business rule, nor have you mentioned any
need to preserve a history of addresses, but the correct structure from a
db design point of view is likely to be that the table storing the owner of
the addresses has a one-to-many relation with the address table. i.e.
Hi,
I am just starting to use smartgrid and have a question on the query
builder (the GUI under 'Query').
With
def test():
db.define_table('A', Field('type'))
db.define_table('B',
Field('type', db.A),
Field('other', 'integer'))
form =
Hello All,
I am a newbie to web2py. I have edited the User Profile to add fields like
this:
auth=Auth(db)
auth.settings.extra_fields['auth_user']=
[Field('Pic','upload'),Field('About_Me','text')]
This if fine for the Profile view. However, I do not want these fields to
be available in the
You must be very careful about multiple copies of table definitions.
Only one copy can be allowed to migrate the table.
Upgrading the tables in a production environment is tedious. First you
must upgrade the models independent of the controllers, then use the admin
app to ensure all the
I don't know anything about openshift, but I would think the normal MySQL
troubleshooting steps apply:
1. Make sure MySQL is listening on all interfaces
2. Make sure your MySQL account accepts connections from the '%' host.
On Tuesday, May 15, 2012 3:55:07 AM UTC-4, JungHyun Kim wrote:
I guess you can disable those fields if the user is not logged in. Perhaps
adding this to the end of the model:
if not auth.is_logged_in():
db.auth_user.upload.readable = False
db.auth_user.About_Me.readable = False
On Monday, May 14, 2012 8:18:05 PM UTC-3, dundee wrote:
Hello All,
Oops, sorry. I meant db.auth_user.field.writable = False
On Tuesday, May 15, 2012 8:53:07 AM UTC-3, Alan Etkin wrote:
I guess you can disable those fields if the user is not logged in. Perhaps
adding this to the end of the model:
if not auth.is_logged_in():
db.auth_user.upload.readable
if ((request.vars._formnameNone) and
(request.vars._formname.rfind('opinion_')-1)):
You don't have to explicitly check for not equal to None -- if it is None,
it will evaluate to false. Also, does the formname start with opinion_ --
if so, use .startswith():
if request.vars._formname
Thank you very much for your reply Alan. I had to add
db.auth_user.About_me.writable=False and
db.auth_user.About_Me.writable=False for it to work.
On Tue, May 15, 2012 at 6:53 AM, Alan Etkin spame...@gmail.com wrote:
I guess you can disable those fields if the user is not logged in. Perhaps
ok I see you corrected it. Thanks again.
On Tue, May 15, 2012 at 7:10 AM, Kevin Miller kevinvani...@gmail.com wrote:
Thank you very much for your reply Alan. I had to add
db.auth_user.About_me.writable=False and
db.auth_user.About_Me.writable=False for it to work.
On Tue, May 15, 2012 at
Hi luc,
Following is what i am looking for:::
- Candidate Applies for posted vacancy using the registration form.
(Release 1)
- Email-id is the username.
- Registration Form 1 (First Name, Last Name, Email, Password, Confirm
Password)
- Email Sent for activation. Pop-up to
Thank you! Ross!
The problem was mysql URL. It was different from application URL(=
web2py-codingday.rhcloud.com).
Now connection to mysql is OK. But still there is HTTP 500 error with
default welcome application...
I should spend more to know why.
2012년 5월 15일 화요일 오후 8시 51분 26초 UTC+9,
Sure I can change one of that manually. But wouldn't it be better if
{{super}} can simply work no matter the parent block exists or not?
Not sure it should fail silently by default, but maybe it would be worth
adding an optional keyword to tell it to do so.
Anthony
Earlier in this mailing list the suggestion was made that one can use the
sql search path to include/exclude schemas from web2py.
In a setup like this it becomes tricky:
Schema: Public
Table(s): auth-related tables
Schema: wbank:
Tables related to
Hi Richard,
Thanks for your answer.
I think you`re right. If you, or someone else, knows where to get an
example application that uses most part of this features please let me know.
In a mean while I'll keep trying to get this to work. If i find something
or get this to work I'll try to make a
fellows! almost 2 years later, this is not yet updated in the book (also,
login is temporarily disabled)
personally, I'd really like to-have-more-documentation-about-this™
regards
Not sure, but SQLFORM.smartgrid don't do what you want?
Richard
On Tue, May 15, 2012 at 4:43 AM, Alec Taylor alec.tayl...@gmail.com wrote:
Thanks Annet, that's what I currently have, but it doesn't allow for
CRUD of anything but the outer table, it won't allow for CRUD of any
of the inner
Dear all,
I'm new to web2py, but I tried to search for an answer befor posting, I
assure you.
I've got datable, use SQLFORM.grid to display it, I have a view button
which I can click and ge3t redirected to single record view.
Question is: where can I define the template for the single record
With what happen with pyjamas recently (see thread on python-list) I doubt
that there will more work involve documenting pyjamas into web2py until the
survive of pyjamas will be granted.
Richard
On Tue, May 15, 2012 at 9:37 AM, Daniel Aguayo daniel.agu...@gmail.comwrote:
fellows! almost 2
I am working through the tutorial on the web2py site, checking web2py out
and I keep getting errors for things I can't see. Like
type 'exceptions.SyntaxError' non-keyword arg after keyword arg
(default.py, line 14)
That code does not exist on the page. The prior code is:
*def index():**
Not sure, but I think you don't need to return session and if you need it,
it should be like this :
dict(var=VAR, var1=VAR1, etc.)
dict() is python dictionnary constructor function, so you need a key and a
value : var is the key VAR is the value.
Richard
On Tue, May 15, 2012 at 8:56 AM, Gerald
It is not really a comment:
http://lachy.id.au/log/2005/05/script-comments
On Monday, 14 May 2012 14:25:07 UTC-5, Larry Wapnitsky wrote:
Here's what it's generating:
h3Whitelisted Addresses/h3table id=jqgrid_ips/tablediv id=
jqgrid_ips_pager/divscript!--
I think you are missing a variable name for session.counter in return.
e.g.
return dict(message=Hello, counter=session.counter)
On 15 May 2012 13:56, Gerald Klein jk121...@gmail.com wrote:
I am working through the tutorial on the web2py site, checking web2py out
and I keep getting
In the controller that generates the grid, you can do:
if request.args and request.args[-3] == 'view':
response.view = 'path/to/other_view.html'
or you can use conditional code in the main view for the page:
{{if request.args and request.args[-3] == 'view':}}
[custom code to display record]
right...realized that after I sent it (long day)
any ideas?
On 5/15/2012 9:53 AM, Massimo Di Pierro wrote:
It is not really a comment:
http://lachy.id.au/log/2005/05/script-comments
On Monday, 14 May 2012 14:25:07 UTC-5, Larry Wapnitsky wrote:
Here's what it's generating:
|
There is a typo in your code:
uth.settings.hmac_key='sha512:8e95c268-cc31-4119-890d-a5790d3e05d3'
should be
auth.settings.hmac_key='sha512:8e95c268-cc31-4119-890d-a5790d3e05d3'
although this is probably not the cause for your problems. Does it work if
you use sqlite? Does it work if you use
Please bring this up to web2py-developer. If there is consensus on this I
will not oppose.
On Tuesday, 15 May 2012 00:49:41 UTC-5, Ray (a.k.a. Iceberg) wrote:
Hi Massimo,
Thanks for telling me such undocumented trick to use other app's layout
file. However I still think a built-in
You need html5 websockets to do what you want to do. That requires an async
socket that can keep many connections open for long time. You are right,
some hosts block that. They do not specifically block tornado.
On Tuesday, 15 May 2012 04:45:24 UTC-5, stefaan wrote:
Please correct me if I'm
Open a ticket about this. Thadeus wrote that implementation and than he
disappeared. I have been unable to contact him for more than 1 years. I
will try change it.
On Monday, 14 May 2012 22:52:58 UTC-5, Ray (a.k.a. Iceberg) wrote:
The point here is that the web2py out-of-box layout.html and
Agreed.
On Tuesday, 15 May 2012 08:42:31 UTC-5, Richard wrote:
With what happen with pyjamas recently (see thread on python-list) I doubt
that there will more work involve documenting pyjamas into web2py until the
survive of pyjamas will be granted.
Richard
On Tue, May 15, 2012 at 9:37
When a user logs on, there is a field in the profile that contains the
designation of the database for the institution associated with that user.
On Monday, May 14, 2012 4:54:54 PM UTC-4, Anthony wrote:
The connection string in the call to DAL() can be determined dynamically
based on
Meanwhile, shall we keep the discussion about how to utilize that
layout_jqm.html (no matter where it locates)? I am using two experimental
callers as below:
cat myapp/views/generic.mobi
{{extend 'layout_jqm.html'}}
{{response.headers['Content-Type'] = 'text/html'}}
# the rest is same
I'll try to explain better:
I need my app to do login using facebook.
you can test in juegozona.com
juegozona.com is configured in the panel WebFaction to use the ip:
108.59.6.232
http://i.minus.com/iFYHPECFl6LpM.png
when the visitor tries to login, facebook return to the page from
which you
On Tuesday, May 15, 2012 10:12:32 AM UTC-4, Massimo Di Pierro wrote:
Agreed.
nudgeNevertheless, we need the book to be editable again so we can fix
all the other errors that have been reported and start documenting newer
features./nudge :-)
Anthony
Yes I try a new app without defining auth models myself, just changed the
connection string for postgres and it works.
I don't have the typo in my code, it maybe happen when copy/paste the code
somehow.
I just add this : auth=Auth(db, *hmac_key=Auth.get_or_create_key()*)
No change.
Richard
On
Ok if I copy my custom auth models into a new app it keeps loading the page
for ever and don't create the table at postgres level.
Richard
On Tue, May 15, 2012 at 10:19 AM, Richard Vézina
ml.richard.vez...@gmail.com wrote:
Yes I try a new app without defining auth models myself, just changed
Update: This feature is actually documented in
http://web2py.com/book/default/chapter/07#One-form-for-multiple-tables,
what a shame I didn't see it earlier...
Regards
On Sunday, May 13, 2012 9:30:41 PM UTC-3, csantos wrote:
Hi,
Suppose I have two tables, with a one-to-one relationship:
On Tuesday, May 15, 2012 10:13:42 AM UTC-4, Craig wrote:
When a user logs on, there is a field in the profile that contains the
designation of the database for the institution associated with that user.
Does that mean there's a master database that stores the user records so
you can access
It worked as expected.
Thank you very much!
Marian
W dniu wtorek, 15 maja 2012 15:55:54 UTC+2 użytkownik Anthony napisał:
In the controller that generates the grid, you can do:
if request.args and request.args[-3] == 'view':
response.view = 'path/to/other_view.html'
or you can use
Wait...
On Tue, May 15, 2012 at 10:37 AM, Richard Vézina
ml.richard.vez...@gmail.com wrote:
Ok if I copy my custom auth models into a new app it keeps loading the
page for ever and don't create the table at postgres level.
Richard
On Tue, May 15, 2012 at 10:19 AM, Richard Vézina
It looks like the reference links in the web2py book aren't working.
For example, the [pythonsecurity] link in the introduction (
http://web2py.com/books/default/reference/29/pythonsecurity) returns an
error: invalid function (default/reference).
I hope that may be an easy fix for someone.
Hello!
Is there some web2py appliance to create quotes invoices, handling
customers etc. suitable for freelancers, iow. no corporate environment?
I'm aware about CRM, but didn't found anything for invoices...
Sincerely,
Gour
--
The working senses are superior to dull matter; mind is higher
Ok, I think I had problem with model definition : 'db.auth...' : foreign
key were quoted... I have this issue since a long time, If I was removing
quote I didn't have proper representation...
Fixed now...
But now it seems that I have problem with the use of id in case were I have
define a custom
I don't think he needs to return it to the view if in the view he is
calling session.counter, but yes if he call the counter like this :
{{=counter}}
counter has to be pass by the function to the view.
Richard
On Tue, May 15, 2012 at 9:53 AM, Ivica Kralj ivicakr...@gmail.com wrote:
I think
I too think Bruno has the right answer, however, when it comes to Python
programming I am not yet proficient enough to translate my model files into
modules and use conditional models to instantiate them :-(
I hope one of you can provide me with a working example that I can explore.
Kind
I don't see any ticket about that on google code...
I will create it if Massimo tell me.
In the mean time I will try the trunk.
Richard
On Tue, May 15, 2012 at 11:40 AM, Jim Steil j...@qlf.com wrote:
Yes, that is a situation I ran into some time ago. In the past even if
you used a custom
All suggestions that I will check out, but this is actually character for
character from the web2py site. I guess that's why I am scratching my head.
That and the fact that the debug references text that is not on the page. I
am always leery of platforms that do a lot for you, sometimes you
Still there in the yesterday trunk...
Richard
On Tue, May 15, 2012 at 11:59 AM, Richard Vézina
ml.richard.vez...@gmail.com wrote:
I don't see any ticket about that on google code...
I will create it if Massimo tell me.
In the mean time I will try the trunk.
Richard
On Tue, May 15,
If there is a typo in the book report it here on the list with an email
object like : book typo
And give details and link the proper page anchors to find the book section.
Richard
On Tue, May 15, 2012 at 12:00 PM, Gerald Klein jk121...@gmail.com wrote:
All suggestions that I will check out,
hm, I checked online book and example you mentioned, contains variable name
in dict function, while your example above, doesn't. Is this the example
you are talking about? (
http://web2py.com/books/default/chapter/29/3#Let%27s-count).
def index():
session.counter = (session.counter or 0) + 1
You have a syntax error in your code, and the error appears to be reporting
that syntax error. Are you saying the line number reported in the traceback
doesn't match up with the actual line number in your code? Can you show the
full code (so we can count the line numbers) as well as the full
If you resort to using Python code, let me know. I just did this for one
of the lists in my database that has hit counts, dates, etc.
On Sunday, May 13, 2012 3:27:56 PM UTC-4, pbreit wrote:
I'm not sure that query will do what you want. I think you need to sort by
views separately.
I think you can refer to a custom id field with db.table._id (and get the
name with db.table._id.name).
Oh yeah, db.table.id works as well, even for custom id fields.
Anthony
I strongly advicee the use of the scheduler because your requirements will
be fullfilled best from that than a homemade task queue, at least, if not
trying to use celery.anyway, just my 2 cents:
SQLITE write operations are locking the entire database. one of 2
controllers (or
yes, thank you so much. i learned some very subtle things here and i love
the way it works. thank you so much. web2py is so powerful and so cool.
there are some (complex) examples of models in modules floating around the
group. the simple suggestion bruno made would look something like this:
module/mytable.py
def init():
current.myapp.db.define_table()
return
then in your conditional model file:
current.myapp.db= db #get the db
1. with every other database that is not sqlite, it's safe because how
most relational db work, transactions make you have always a consistent set
of results (if you use them correctly!!)
It's still safe in SQLite -- you just might get a little more blocking
than you would with other
what are you using the generate the return URL that you pass to facebook
when you make the login request? it looks like that is the culprit - i
always use a hostname and not IP address for the return URL.
On Tuesday, May 15, 2012 7:17:02 AM UTC-7, www.diazluis.com wrote:
I'll try to explain
Not working in this context :
rows = db().select(db.tab1.ALL)
for r in rows:
* r._id* # KeyError
But this work :
db[request.args(0)].FK_id.represent=\
lambda FK_id, record: A(lot_number_dict[FK_id],\
_href=URL(r=request, f='read', args=(request.args(0),
Hi Vasile,
You've probably heard that the 1.0 release for OrientDB is
out:
http://code.google.com/p/orient/downloads/detail?name=orientdb-graphed-1.0.zip
I'd be very curious to take a look at the samples you were working on and
if you're still interested in working on a DAL adapter.
Cheers,
Yes, there is a master database that has the database designation for the
institutions.
I guess one of the things I am unclear on is how granular the Web2Py
framework is. Is there one db.py running for all sessions or is there a
db.py running for each user session?
If a db.py runs for for
I'm seeing the same thing. Not working in row objects...
On 5/15/2012 1:11 PM, Richard Vézina wrote:
Not working in this context :
rows = db().select(db.tab1.ALL)
for r in rows:
*r._id* # KeyError
But this work :
db[request.args(0)].FK_id.represent=\
lambda FK_id, record:
JungHyun,
I've deployed the default web2py app to Openshift with no issues but
haven't played with it much. I'd be happy to share my project dir so you
can see how I've structured my wsgi file and various libs like gluon so
that the app will run.
I'll try and create a mysql cartridge and put
outside of the string passed to the message variable in the call to dict my
code is exactly the same, I didn't have any luck with the version above
this so I coded this instead. As far as the syntax error, I would be happy
to know where it is as I can't see it. And yes the trace is pointing to
Yes, you're missing the -- counter=...before the second arg
you're passing:
Your statement:
return dict(message=hello, session.counter)
should be
return dict(message=hello, counter=session.counter)
-Jim
On 5/15/2012 1:16 PM, Gerald Klein wrote:
outside of the string passed to the
outside of the string passed to the message variable in the call to dict
my code is exactly the same, I didn't have any luck with the version above
this so I coded this instead. As far as the syntax error, I would be happy
to know where it is as I can't see it. And yes the trace is
In controller :
def index():
session.counter = (session.counter or 0) + 1
return dict(message=Hello from MyApp, counter=session.counter)
View :
html
head/head
body
h1{{=message}}/h1
h2Number of visits: {{=counter}}/h2
/body
/html
From the book and it should
yes, let me explain better.
Having a task queue that updates heavily a sqlite database while a web
application needs to read it is not a good idea. Sqlite is a wonderful
database and supports some syntax that others big databases dream about,
has transactions, is flexible, multiplatform,
I am working exclusively with web2py, over 2 years (8-24 hours a day *7)
plus holydays. And I never used an IDE. I use Sublime-text-2 and VIM, I
have Python code completion and I have set some web2py completions for
common code snippets both in VIM and Sublime-text.
But, If I wanted or
+1
On Sun, Feb 12, 2012 at 5:41 PM, Francisco Costa m...@franciscocosta.comwrote:
at tymr we use gEdit + plugins
On Feb 12, 4:17 pm, Anthony abasta...@gmail.com wrote:
I am also comfortable with the web based IDE. However even with
youadworld
there was over 5000 files to port over.
+1 to Francisco
gEdit + plugins
Richard
On Tue, May 15, 2012 at 2:54 PM, Richard Vézina ml.richard.vez...@gmail.com
wrote:
+1
On Sun, Feb 12, 2012 at 5:41 PM, Francisco Costa
m...@franciscocosta.comwrote:
at tymr we use gEdit + plugins
On Feb 12, 4:17 pm, Anthony abasta...@gmail.com
I strongly advicee the use of the scheduler because your requirements will
be fullfilled best from that than a homemade task queue, at least, if not
trying to use celery.anyway, just my 2 cents:
SQLITE write operations are locking the entire database. one of 2
controllers (or
Is there any progress? Are you able to use it?
2012. április 27., péntek 23:06:40 UTC+2 időpontban szimszon a következőt
írta:
What distrib is this?
What is the content of GPGKEY?
The list is from python shell or from web2py?
2012. április 27., péntek 17:34:06 UTC+2 időpontban weheh a
I'd better prevent running into performance problems
I generally advise against premature optimization.
Il 15/05/2012 14:56, Gerald Klein ha scritto:
*def index():*
*session.counter = (session.counter or 0) + 1*
*return dict(message=hello, session.counter)*
the right code for building a dictionary is the one suggested by
Richard, in
Not sure using conditional models is premature optimization it is just
better design.
On Tue, May 15, 2012 at 12:14 PM, pbreit pbreitenb...@gmail.com wrote:
I'd better prevent running into performance problems
I generally advise against premature optimization.
--
--
Regards,
Bruce Wade
*# models/db.py*
...
db = DAL(.)
...
*# modules/datamodels/myobject.py*
from gluon import current
from gluon.dal import Field
class MyObject(object):
def __init__(seld, db):
self.db = db
self.T = current.T
self.request = current.request
self.fields = [
postgresql definetely scales also with write intensive operations without
blocking.
homemade task queues are real funny to code but gets messy really
soon.blocking operations, tasks that fail and need (or don't) to be
requeued, priorities, timeouts, newtork splits, and so on.
I think I'm
In order to avoid NameError: name 'task_function' is not defined:
from gluon.scheduler import Scheduler
myscheduler = Scheduler(db, dict(task_name=None))
On Wednesday, December 28, 2011 7:36:04 PM UTC-8, Brian M wrote:
This is simply a note for anybody else who may come across this error when
Bruno mentioned modules, not conditional models.
Better example:
*# models/db.py*
...
db = DAL(.)
...
*# modules/datamodels/base.py*
class BaseModel(object):
def define_table(self):
self.db.define_table(self.tablename, *self.fields, **self.params)
*# modules/datamodels/dog.py*
from gluon import current
from gluon.dal import
These examples are only good if you have 1 model per class. I prefer the
design used in Auth with a define_tables method.
On Tue, May 15, 2012 at 12:41 PM, Bruno Rocha rochacbr...@gmail.com wrote:
Better example:
*# models/db.py*
...
db = DAL(.)
...
*# modules/datamodels/base.py*
Hi
I'm trying to use the plugin_lazy_options_widget to build a dependent
select list. I have to fields on the screen, both with the IS_IN_DB
validator and values available in the second depend on what is selected
in the first. This widget from s-cubism seems like just the thing, but
I
Hi!
I have it on my only file at models folder, at first line.
from gluon.custom_import import track_changes; track_changes(True)
When using GAE SDK, this option does NOTE reloads modules!
The tickets shows erros on wrong line numbers... and changes made on module
files are only displayed
1 - 100 of 122 matches
Mail list logo