thank you :-)
On 6月19日, 下午12时20分, Anthony wrote:
> db(db.testtable.name.contains('kate')).select()
>
> Seehttp://web2py.com/book/default/chapter/06#Many-to-Many,-list:,-and-contains
> .
>
> Anthony
>
>
>
>
>
>
>
> On Sunday, June 19, 2011
db.define_table("testtable",
Field("name", "list:string")
)
table contents are as following:
idname
1 ["jim", "kate"]
---
2 ["tim", "kate"]
---
I think it is pymysql's problem because it dosen't escape query
correctly, so, an syntax error is throwed.
MySQLdb can escape query well, as a result , when I update web2py to
new version, this error occurs.
On 2月15日, 下午6时09分, Johann Spies wrote:
> On 15 February 2011 08:49,
Please help to run it :-)
# File Name: default.py
def index():
db.define_table("pymysql",Field("content","text"),migrate=True)
content = """'http://img1.t.sinajs.cn/t3/style/css/common/
layer.css'"""
#content = """this sentence is no problem at all"""
db.executesql("INSERT INTO py
I install two different version web2pys , one is 1.91.6 and the other
is 1.87.3
1.87.3 works well while 1.91.6 throws the error
On 2月14日, 下午5时53分, "Martin.Mulone" wrote:
> are you sure is not syntax error?
>
> db.executesql("insert into hytest (conent)values(%s)",content)
>
> "conent"
# database is mysql
# web2py version: 1.91.6, which uses pymysql as mysql driver
# my codes is something like this
#
import gluon.tools
content = gluon.tools.fetch("http://t.sina.com.cn/reg.php?
inviteCode=104174")
db.executesql("i
I found it won't auto reconnect at this situation:
from dal import DAL
from dal import Field
import time
db = DAL("mysql://root:password@127.0.0.1/mydb")
db.define_table("table1",
Field("name"),
migrate = False
)
db.table1.insert(name="jim")
db.commit()
# Close the connection from mys
Connections may be lost during query, and DAL will not reconnect to
server , isn't it ?
thank you !
it works well.
thank you.
On 9月29日, 下午9时42分, mdipierro wrote:
> If not request.function=='user': session.forget()
>
> will prevent saving sessions for all controller functions but the
> 'user' one which handles login.
>
> On Sep 29, 1:56 am, hywang wrote:
Brower
>
> On 09/29/2010 09:56 AM, hywang wrote:
>
> > when some one visits my site , a new session file will be created.
> > Then there is a risk : if somebody connects to my site with lots of
> > robots again and again, hundreds of session files will be gene
at 2:17 PM, Jason Brower wrote:
> > I think there is a way to save the sessions to a database. It's in the
> > book if I am not mistaken.
> > BR,
> > Jason Brower
>
> > On 09/29/2010 09:56 AM, hywang wrote:
>
> >> when some one visits my site ,
when some one visits my site , a new session file will be created.
Then there is a risk : if somebody connects to my site with lots of
robots again and again, hundreds of session files will be generated in
seconds, deleting session files periodically has no use at all .
"session.forget()" prevents
I set auth.settings.expiration=3600*24*7
everything is ok when I put session into disk
But , when I put session to memcached, it expired after several
minutes.
How can I solve this ?
thank you .
"|" was used to join values, so it can be written as
values = re.compile('[^|]+').findall(str(value))
On 8月13日, 下午6时31分, hywang wrote:
> line 268: values = re.compile('[\w\-:]+').findall(str(value))
>
> if value contains some Chinease charactors , it fail
line 268: values = re.compile('[\w\-:]+').findall(str(value))
if value contains some Chinease charactors , it failed to parse it.
eg:
value = "|eng|汉字|"
values = re.compile('[\w\-:]+').findall(str(value))
print values
#the result is ['eng'], but not ['eng','汉字']
> pickle.
>
> Massimo
>
> On Aug 12, 3:19 am, hywang wrote:
>
> > there is a controller:
> > def controller_1():
> > """
> > this is its __doc__ string
> > """
> > return {}
>
> > # How can ge
there is a controller:
def controller_1():
"""
this is its __doc__ string
"""
return {}
# How can get ["controller_1", "this is its __doc__ string"]
def controller_2():
"""
this is its __doc__ string
"""
return {}
# How can get ["controller_2", "this is its __do
CheckboxesWidget can arrange check boxes horizontally.
you can specify the colum number by 'cols'
Try this:
db.define_table('test',
Field('children'))
db.test.children.requires =
IS_IN_SET(['boy1','girl1','boy2','girl2','boy3','girl3','boy4','girl4'])
def horizontal_checkbox(f,v):
there is a legacy datatable named 'test'
+---+--+--+-+-+---+
| Field | Type | Null | Key | Default | Extra |
+---+--+--+-+-+---+
| jtk | varchar(255) | YES | | NULL| |
| age | int(11) | YES |
I am developing a lightweight CMS framework using web2py.
Maybe I will make it surpport multilanguages, but recently I am too
busy.
If you register, you will find that you can't do nothing, because you
has no enough privilege.
http://www.hibitty.com/
thanks.
web2py Ver 1.77.3
db.define_table('test_pic',
Field('picture', 'upload')
)
def hello():
form = SQLFORM(db.test_pic)
if form.accepts(request.vars, session):
response.flash = 'ok'
return dict(form=form)
it works well.
when add validator IS_IMAGE
db.define_table('test_pic'
avatar is commonly used when user registers. But auth.table_user
dosen't has this field.
Maybe I can add a Field('avatar', 'upload') to auth.table_user. I did
do it, but failed: an error occured.
ERROR:Rocket.Errors.Thread-7:Traceback (most recent call last):
File "E:\web2py\gluon\rocket.py", l
db.define_table('test_pic',
Field('picture', 'upload')
)
def reupload_pic():
form = SQLFORM(db.test_pic, 1, upload=URL(r=request,
f='download'))
if form.accepts(request.vars, session):
response.flash = 'ok'
return dict(form=form)
I specify parameter 'upload' to show subm
platform: python2.5 winxp web2py(1.77.3) from source
auth.settings.table_user = db.define_table(
auth.settings.table_user_name,
Field('first_name', length=128, default='',writable=False,
readable=False),
Field('last_name', length=128, default=''),
Field('email', length=512, default
rubs returned
> > >> objects. This was a while ago and may have changed since then.
>
> > >> Rocket could die a little more gracefully, but I'd rather keep the code
> > >> lean rather than checking every response for validity. As a test, there
> >
may be it is an ooold bug, Discussion about it can be found here:
http://groups.google.com/group/web2py/browse_thread/thread/bdfb9bb617488d5/641e843715eb8b11?lnk=gst&q=raise+TypeError%2C+%22not+indexable%22#641e843715eb8b11
On 4月26日, 下午3时44分, hywang wrote:
> no better result if i create
> On Apr 25, 10:53 pm, hywang wrote:
>
> > I run web2py from source on centos 5.3.
> > When upload a file, an error occurs.
> > -db.py---
> > db.define_table('easy_test',
> > Field('picture', 'upload')
> >
i has no view .
when i test newest version in google hg server, web2py works well,
but if I add IS_IMAGE() validator, some error occured again.
ver1.6x works well
On 4月26日, 下午2时01分, mdipierro wrote:
> Do you have a view with a custom form?
>
> On Apr 25, 10:53 pm, hywang wrote:
&g
error also occurs when run web2py from source on window platform.
no better result when use ie8
On 4月26日, 下午12时09分, mdipierro wrote:
> which Python version? Which browser?
>
> massimo
>
> On Apr 25, 10:53 pm, hywang wrote:
>
> > I run web2py from source on centos 5.3.
&g
python2.5 browser is ff3.62
On 4月26日, 下午12时09分, mdipierro wrote:
> which Python version? Which browser?
>
> massimo
>
> On Apr 25, 10:53 pm, hywang wrote:
>
> > I run web2py from source on centos 5.3.
> > When upload a file, an error occurs.
> > -
I run web2py from source on centos 5.3.
When upload a file, an error occurs.
-db.py---
db.define_table('easy_test',
Field('picture', 'upload')
)
-controller file---
def hello():
form = SQLFORM(db.easy_test)
if form.accepts(request.vars, session):
from gluon.tool import Mail
should be
from gluon.tools import Mail
On 4月8日, 下午9时38分, kike wrote:
> I have a problem with the function Mail, when I used it the send me
> the following error:
>
> Traceback (most recent call last):
> File "/home/kike/web2py/gluon/restricted.py", line 173, in
>
To view the email correctly when receive it, I have to specify
charset to "utf-8" to
avoid Mojibake.
And the default charset that tools.Mail uses is charset=us-ascii.
For your convenience, you can test it with these two word "测试"
--
You received this message because you are subscribed to the
To view the email correctly, I have to specify charset to "utf-8" to
avoid Mojibake.
And the default charset that tools.Mail uses is charset=us-ascii.
For your convenience, you can test it with these two word "测试"
--
You received this message because you are subscribed to the Google Groups
"w
There are 2 applications: a-app and b-app.
I want to import a model in a-app into b-app, is there a easy and safe
way to do it ?
thank you !
--
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to web...@googlegroup
lue, self.error_message)
if self.multiple:
return ('|%s|' % '|'.join(values), None)
return (value, None)
On 3月30日, 上午11时12分, hywang wrote:
> thanks for your kindly help.
>
> On 3月30日, 上午1时47分, Yarko Tymciurak
> wrote:
>
> > On M
; I hope this helps begin to show the beginning of the way: All your
> strings in your app need to be converted to unicode (one way or
> another), and your locale set (normally provided from the browser, in
> the request).
>
> - Yarko
>
>
>
> > On Mar 29, 10:04 am, Yarko T
There is something wrong with validators.py in line 289
values = re.compile("[\w\-:]+").findall(str(value))
if I change it with
values = value
everything is ok
Maybe it's a bug
On 3月29日, 下午9时33分, hywang wrote:
> ---model file is like this -
---model file is like this -
db.define_table('options_contain_chinease',
Field('student_name', requires = IS_IN_SET(["Jim","小长","老李"],
multiple=True)),
)
db.options_contain_chinease.student_name.widget =
CheckboxesWidget.widget
--controller file is like this ---
---model file is like this -
db.define_table('options_contain_chinease',
Field('student_name', requires = IS_IN_SET(["Jim","小长","老李"])),
)
db.options_contain_chinease.student_name.widget =
CheckboxesWidget.widget
--controller file is like this -
Sorry,
db.table_contain_chinease.student_name.widget =
CheckboxesWidget.widget
should be :
db.options_contain_chinease.student_name.widget =
CheckboxesWidget.widget
--
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send e
model file like this ---
db.define_table('options_contain_chinease',
Field('student_name', requires = IS_IN_SET(["小王","小长","老李"])),
)
db.table_contain_chinease.student_name.widget =
CheckboxesWidget.widget
-controller file like this -
def test_chinease():
form = SQ
something like this
def _compute():
return request.vars.in_time + request.vars.duration##
db.define_table('mytable', Field('in_time','datetime'),
Field('duration', 'integer'), Field('end_time','datetime', compute =
_compute))
On Feb 5, 6:51 pm, Adi wrote:
> Hi,
>
> I have a table with 3 fie
thanks , works well
On Feb 5, 6:11 pm, tiago almeida wrote:
> I asked about this a while ago
> here<http://groups.google.co.uk/group/web2py/browse_thread/thread/e9781e20...>
> .
> Hope it helps.
>
> On Fri, Feb 5, 2010 at 8:46 AM, hywang wrote:
> > there
there is a table
db.define_table('class_student', Field('class_name'),
Field('student_name'))
class_name + student_name should be unique in this table. How can
validate the submitted data when user update or insert a record ?
Thanks :-)
--
You received this message because you are subscribed t
uot;, "specified css for
column second", "specified css for column third"], \
'field_name_3': ["specified css for column first", "specified css for
column second", "specified css for column third"], \
'field_name_4': ["specifie
when sqlform is rendered as a table, the label of a field is wrapped
by "td" (line 626 in sqlhtml.py), in fact, it is much more convenient
for web designer if it is wrapped by 'th'.
so, i suggest changing line 626 in sqlhtml.py into
tr = self.trows[fieldname] = TR(TH(label), inp, comment, _id=row
1) tools.py(svn version 1140), line 1405, "if not self.basic() and
not not self.is_logged_in():" There are 2 not
2) contrib\login_methods\basic_auth.py(svn version 1140), line 2,
"import urlib2", should be "import urllib2"
3) contrib\login_methods\basic_auth.py(svn version 1140), line 20,
"u
when use IS_IN_DB(), it generates too many options, of course we can
use requires = [IS_IN_DB()] to make it like a textbox rather than
selectbox, however, it is not converious for user to select an item.
Can we solve it using auto-complete like google suggestion ?
--~--~-~--~~---
django do it like this:
from django.utils.httpwrappers import HttpResponse
from PIL import Image
def image(request):
image = Image.new("RGB", (800, 600))
response = HttpResponse(mimetype="image/png")
image.save(response, "PNG")
return response
in web2py, I did it with a file, fi
50 matches
Mail list logo