Thank you Anthony, thats not far off what i have already:
import StringIO
def index():
if request.args:
pageurl='/'.join(request.args)
try:
cmspages = db(db.cmspages.pageurl==pageurl).select().first()
response.title = cmspages.title
Count me as tester
El jueves, 17 de octubre de 2013 21:32:41 UTC+2, Niphlod escribió:
working on that right now ( https://trello.com/c/JibPHmAq )
BTW, it's a major overhaul, so we do need testers as soon as the patch is
out.
On Thursday, October 17, 2013 8:48:22 PM UTC+2, puercoespin
that's great, thanks for your effort Niphlod!
looking forward to schema support since my DB uses many different schemas.
Alex
Am Freitag, 18. Oktober 2013 10:58:31 UTC+2 schrieb puercoespin:
Count me as tester
El jueves, 17 de octubre de 2013 21:32:41 UTC+2, Niphlod escribió:
working on
Hi all,
I have the following situation:
1) I have a table that has a Virtual something attached to it that what it
does is it concatenates two other fields of that table.
db.define_table('tableaa', Field('afield', 'string', required=True ),
Field('bfield', 'string', required=True ),
)
thank you so much for your detail explaination niphlod.
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
OK, adding routes.py to my app was just a coincidence. I renamed routes
file, reloaded web2py and the problem with Admin persists.
I read here on the forum that it might be permissions issue, but my user
owns the whole web2py/ folder with all subfolders.
I used the following configuration:
What is the best way to change the target of the edit profile
link permanently?
Thanks for your help!
Andreas
--
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
What do you mean?
On Friday, October 18, 2013 1:57:13 PM UTC+2, Andreas Wienes wrote:
What is the best way to change the target of the edit profile
link permanently?
Thanks for your help!
Andreas
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
-
Is there a way to do it?
On Thursday, 17 October 2013 23:08:25 UTC+5:30, ranjith wrote:
I just need to insert some records into a table when that table is
created. I dont know how to do it. Please help!!!
On Thursday, 17 October 2013 12:26:11 UTC+5:30, ranjith wrote:
Thanks for the
Are you talking about the link produced by auth.navbar()? If so, the navbar
assumes all of the Auth actions are served via a single function, with the
particular action indicated by request.args(0) -- so it's not easy to
change the URL of a given action to something completely different.
yes, can, please do with before insert or after insert and please read the
book on dal chapter in before and after callback sub chapter
ref:
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#before-and-after-callbacks
and for the example you can see in this forum
db.define_table('tableaa', Field('afield', 'string', required=True ),
Field('bfield', 'string', required=True ),
)
db.tableaa.virtfield = Field.Virtual( lambda row: XML(strong +
row.tableaa.afield + '/strongbr ' + row.tableaa.bfield ))
When this something is a virtual field, as is the
You could also conditionally define the virtual field only when you will
need it (define it before executing the select query).
Anthony
On Friday, October 18, 2013 9:07:34 AM UTC-4, Anthony wrote:
db.define_table('tableaa', Field('afield', 'string', required=True ),
Field('bfield',
the trouble i have though, is that the table field called pagecontent,
which i am calling in the view/template contains helpers and these
currently don't get executed without eval. In my testing, i have
pagecontent containing:
MARKMIN(**My Site**)
If you want to use the web2py
got it working with this:
import StringIO
from gluon.template import render
def index():
if request.args:
pageurl='/'.join(request.args)
try:
cmspages = db(db.cmspages.pageurl==pageurl).select().first()
response.title = cmspages.title
hi,
just an idea about new application wizard feature, that i think it's nice
to have the feature like cakephp or yii, that can generate the scaffolding
application base on database defined by user.
for example, please imagine someone new to web2py that have a background
from another web
Sorry for the lack of information. Yes I'm talking about the link produced
by auth.navbar(). Thanks for your help Anthony.
- Andreas
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
-
Thanks Tim and Anthony. I will first try Anthony's suggestion.
This (advanced_editor) is not documented in the book as far as I can see.
Regards
Johann
On 18 October 2013 05:28, Anthony abasta...@gmail.com wrote:
db.email_prefs.email_order_**received.widget = advanced_editor
Now, this
Thanks. But those callbacks are for insertion and deletion of records in a
table. I want a *callback for the creation of a table.*
On Fri, Oct 18, 2013 at 6:36 PM, 黄祥 steve.van.chris...@gmail.com wrote:
yes, can, please do with before insert or after insert and please read the
book on dal
$('div').find('a:contains(Profile)').attr(href, new_target);
$('div').find('a:contains(Profile)').replaceWith(a href='new_target'i
class='icon-user'/i new linktext /a);
Both worked for me.
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
-
This (advanced_editor) is not documented in the book as far as I can see.
See the end of this
sectionhttp://web2py.com/books/default/chapter/29/07/forms-and-validators#Widgetsfor
a custom widget example.
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
-
I forked PhreeStyle plugin and did some changes
https://github.com/rochacbruno/web2py_ckeditor I dont know if still works
with recent web2py versions, can somebody test it?
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source
Looks like a permission error
On Friday, October 18, 2013 12:22:15 AM UTC-3, __pyslan__ wrote:
Hello erevydory!!
After upgrade web2py with update-web2py.sh, the error is:
(Internal error - Ticket issued: unknown)
[image: Inline image 1]
I've restarted the nginx, uwsgi. Even the machine
HI Jayakumar
Try using a query rather than a rows object.
For example, rather than:
query = db().select(db.auth_user.ALL) ## gives a rows object,
unusable by grid
Use this:
query = db.auth_user.id0
Hope you get the idea.
Best regards, D
On Friday, 18 October 2013 06:43:24
there are scripts for that (extracting models from an existing database).
However web2py doesn't support out-of-the-box any schema you're throwing at
it, so it's pretty useless to code such a wizard.
Il giorno venerdì 18 ottobre 2013 15:29:06 UTC+2, 黄祥 ha scritto:
hi,
just an idea about new
Like the object!!
Here :
http://www.web2pyslices.com/slice/show/1746/ago-for-web2py-with-magic-t-human-readable-timestamp
Enjoy
Richard
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
-
I'm trying to install the Firebird Driver FDB but not getting very far.
Here's my steps:
1. Install easy_install [OK]
run easy_install fdb and get the following error:
C:\easy_install fdb
Searching for fdb
Reading https://pypi.python.org/simple/fdb/
Best match: fdb 1.4
Downloading
Hi!
I'm using multi-language method described in web2py Application Development
Cookbook i.e. cookie-based. (controller retrieves saved lang preference
from user's cookies and the fetches him a page from db in appropriate
language).
I'm worried about search engines discovering only one
Hi,
I am new to web2py and I am stuck with a strange problem.
I am writing a simple application to manage a db.
Within my application I am have two pages.
- A main page with a SQLFORM.grid showing the records of Table A
- A detail page showing the information and allowing edits of a single
I do not know that it is actively mantained. Anyway, if you email the TKL
people, they are helpful and responsive.
On Wednesday, 16 October 2013 13:40:47 UTC-5, Niphlod wrote:
is TKL turnkey Linux ? If yes, who is the maintainer of that distribution
? He's the man to contact for such
In trunk.
On Thursday, 17 October 2013 11:14:20 UTC-5, rustytu...@gmail.com wrote:
Hello just in case anyone has use for this I have taken the Ubuntu Setup
Script for Web2py and made minor changes for Apache2.4 and Debian Sid. I
have attached it to this post.
*cheers
Andrew
--
Does this help? https://code.google.com/p/csvstudio/
On Thursday, 17 October 2013 12:16:55 UTC-5, manee...@gmail.com wrote:
I have a MySQL file and I want to make it my database(in place of
model.py) i.e., I want to make it my model.
How can I do that?
Thanks in advance.
--
There is also
from gluon.tools import prettydate
On Friday, 18 October 2013 11:05:28 UTC-5, Richard wrote:
Like the object!!
Here :
http://www.web2pyslices.com/slice/show/1746/ago-for-web2py-with-magic-t-human-readable-timestamp
Enjoy
Richard
--
Resources:
- http://web2py.com
-
I upgraded to web2py 2.7.4 and noticed the width of the form fields has
changed from:
input type=text value= name=firstName id=contact_firstName
class=input-xlarge string
input type=text value= name=firstName id=contact_firstName
class=span4 string
span4 IMHO is a bit small, isn't it? Is
on web2pyslices I have a plugin (Google charts). I have updated the field
Download page URL to be the URL of the .w2p archive (stored on GitHub
releases). The install feature worked. This is a really great enhancement.
And there are a couple of features that should be easy to add:
- git
Hello,
Ok, I did see some thread with the name passed, but didn't know it was for
that usage.
Here example :
http://web2py.com/books/default/chapter/29/14/other-recipes?search=prettydate
I think, I will go with it...
If you want you can include ago.py in contrib if it good enough...
:)
The
Doesn't support postgres timezone neither though :
Maybe this example could be added in the book :
import datetime
from gluon.tools import prettydate
db.table_name.field_name.represent = lambda value, row: prettydate(value
.replace(tzinfo=None), T) if value else T('N/A')
:)
The interresting
in the migration of my DB from Mysql to Postgresql, i found that a field
type 'boolean' in DAL, is handled by Pg as character(1).
Is it a bug, or a feature :))?
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
-
Yea, he should probably override the equality operator to allow F (not just
0 or False). :D
On Thursday, October 17, 2013 11:53:24 AM UTC-7, Niphlod wrote:
don't do that, please. If you're annoyed with web2py's defaults, you can
easily sublass the adapter and make your own adjustments.
On
All,
A new web2py python user here.
I am trying to build a sample webapp using web2py. My plan is to use MySQL
DB (tables already created with data). I want to retrieve data from the
table from MySQL and display on the home page. I have errors when doing
that -
class
There was a mention of this on the list; web2py stores boolean as 'T' or
'F' in the db.
Kiran Subbaraman
http://subbaraman.wordpress.com/about/
On 10/18/2013 11:42 PM, puercoespin wrote:
in the migration of my DB from Mysql to Postgresql, i found that
It is to simplify DAL code since not all backend has boolean type, for
instance I think SQLite has no bool...
You can safetly change a web2py bool into a bool in postgres with an SQL
alter sentence...
:)
Richard
On Fri, Oct 18, 2013 at 2:12 PM, puercoespin
jzaragoza.puercoes...@gmail.com
A web2py and python newbie here. Tried posting this before, but could not
see this in the posting list.
I tried to do a sample web app with MySQL DB as backend DB. I have created
a table in MySQL separately and populated with values and I want to display
the table values in the UI. I have
there's even a slide for it
http://www.web2pyslices.com/slice/show/1611/postgresql-custom-adapter
On Friday, October 18, 2013 8:40:29 PM UTC+2, Kiran Subbaraman wrote:
There was a mention of this on the list; web2py stores boolean as 'T' or
'F' in the db.
if you don't want web2py to create the table, you need to do
db.define_table('tablename',
Field()
.
migrate=False
)
Read here for the gotchas
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Legacy-databases-and-keyed-tables
On Friday, October 18,
you upgraded from what version ? what formstyle are you using ?
On Friday, October 18, 2013 7:09:11 PM UTC+2, Annet wrote:
I upgraded to web2py 2.7.4 and noticed the width of the form fields has
changed from:
input type=text value= name=firstName id=contact_firstName
class=input-xlarge
that if you need your website to be available in multiple languages even to
crawlers, you choose the wrong way to do it.
Take the way of url-rewrite with the languages in the url, so you can have
different uris returning different translations.
he won't be overriding or redefining booleans ... I can't see that as a
step forward for humanity.
The decision by web2py to use T or F for booleans in SQLite is interesting
... I wonder why.
On Sat, Oct 19, 2013 at 5:55 AM, Derek sp1d...@gmail.com wrote:
Yea, he should probably override the
Got it. It worked now. Thanks.
On Friday, October 18, 2013 1:31:11 PM UTC-4, Vj wrote:
All,
A new web2py python user here.
I am trying to build a sample webapp using web2py. My plan is to use MySQL
DB (tables already created with data). I want to retrieve data from the
table from
On Friday, October 18, 2013 4:45:16 AM UTC-7, lesssugar wrote:
OK, adding routes.py to my app was just a coincidence. I renamed routes
file, reloaded web2py and the problem with Admin persists.
What version of web2py? Is this an upgrade? The admin-ticket issue
sounds like an upgrade from
it's because historically boolean support with 1 and 0 was inserted in
sqlite3. sqlite2 has no notion of a specific type for it. Even now, SQLite
still use dynamic datatyping, so it really doesn't matter what you choose,
as long as it's consistent.
The more interesting (i.e. debatable) choice
Hi all. Does anyone has a good reason to NOT change this line
https://github.com/web2py/web2py/blob/master/gluon/dal.py#L1255
to
if not isinstance(id,int)
?
For some obscure reason, when the datatype for inserts and such got longs
all the way, this remained untouched
I'm asking 'cause
On Friday, October 18, 2013 7:50:43 AM UTC-7, ranjith wrote:
Thanks. But those callbacks are for insertion and deletion of records in a
table. I want a *callback for the creation of a table.*
How often is a table created? Your original message in this thread
referred to the auth table,
Thank you very much Tim!!
I didn't even consider this posibility. It seems that it's what I was
looking for. I will try it.
Kind regards!
On Friday, October 18, 2013 3:56:43 AM UTC+2, Tim Richardson wrote:
You are doing this the really hard way, I think.
If you read the book a bit more you
It should be fixed in trunk. Please have a try
Paolo
--
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
done.
sidenote: instead of requiring git, it could be easier (and require no
external libs) to download the zip and unpack
On Friday, October 18, 2013 7:10:52 PM UTC+2, Alan Etkin wrote:
on web2pyslices I have a plugin (Google charts). I have updated the field
Download page URL to be the URL
You have the table in the db, but not the metadata in yourapp/databases/
folder.
Change to the following:
DAL('mysql://x',pool_size=1,check_reserved=['all'])
to this:
DAL('mysql://x',pool_size=1,check_reserved=['all'],
fake_migrate_all=True, migrate=False)
This will rebuild your
Thanks for the information.
But in my db, booleans were stored as True or False. No 'T' or 'F'. May
be because a default = False in my model?
Anyway, when save my db to csv, booleans are saved as False/True, and
Postgesql give me an error of too many chars...
Thanks again.
So I'm working to scale up my web2py based app a bit. Part of this was
moving the Scheduler to a separate machine. Since doing this I'm getting
some errors and weird behavior and could use some insight. There are
multiple issues but I sort of need to explain it all so I opted for 1 post
Hi.
I'm using 2.7.4-stable+timestamp.2013.10.16.09.10.20
In db.py :
db.define_table('table',
Field('a','double'),
Field('b','double'),
Field('c','double', compute=lambda r: r['a']+r['b'])
)
In appadmin.py:
add record with values a=1, b=2 that right, produce c=3
But In
I'm just giving Tim some options... facetious as they may be...
On Friday, October 18, 2013 12:34:04 PM UTC-7, Tim Richardson wrote:
he won't be overriding or redefining booleans ... I can't see that as a
step forward for humanity.
The decision by web2py to use T or F for booleans in
Well, you can redefine the False and True objects equality operators to
accept 'T' or 'F' or 1 or 0...
On Friday, October 18, 2013 2:54:58 PM UTC-7, puercoespin wrote:
Thanks for the information.
But in my db, booleans were stored as True or False. No 'T' or 'F'.
May be because a default =
Same thing here, even with the new alias and restarting apache the admin
doesn't look as it should be.
Em quinta-feira, 17 de outubro de 2013 21h01min50s UTC-3, frasse escreveu:
I have restart my apache. The only change I have in my web2py configration
is in routes.py and it is like this
Computed fields are not updated when you update_record. Open a ticket,
perhaps they should.
On Friday, 18 October 2013 17:50:19 UTC-5, Ángel Gabriel Morales Acosta
wrote:
Hi.
I'm using 2.7.4-stable+timestamp.2013.10.16.09.10.20
In db.py :
db.define_table('table',
OK, since nobody else seems to be trying and I do use the windows binaries
for a work app I gave this a try and didn't seem to have any trouble
building the default binary and one with gevent. Niphlod I'll send you an
email off-list to see if I did it right.
~Brian
On Thursday, October 17,
I want to get code completion working in my editor (currently using Komodo
Edit). I have seen that at the top of my files I need to put something
like:
if 0:
from gluon.sql import *
from gluon.sqlhtml import *
from gluon.html import *
db = DAL()
#optionally use table references
Basic speed comparison between the two suggests that gevent may indeed be
noticeably faster. (I wouldn't jump to too many conclusions - this is
totally unscientific and being run on a relatively low powered laptop
- Win8, 1.7GHz AMD E2, 8GB RAM.)
*Summary*
500 requests @ concurrency of 20
67 matches
Mail list logo