Hi,
is there a standard way to add fields to a form generate via SQLFORM?
I know I can select which fields to display out of the ones taken from
the database, but what if i want to insert another field to manage
something in a manual way?
An example is posting a blog entry. Everything generated
Hi,
once a record has been inserted with form.accepts, how to know the id
of that record? Sure, one can performa a select and get the max id,
and in most cases this would work, but it's not safe as it *could*
happen that another record is inserted in between the time of the
insert and the time of
form.vars.id
-Thadeus
On Sun, Jan 24, 2010 at 2:55 AM, pistacchio pistacc...@gmail.com wrote:
Hi,
once a record has been inserted with form.accepts, how to know the id
of that record? Sure, one can performa a select and get the max id,
and in most cases this would work, but it's not safe
This is a proxy server (just very limited) and can proxy only one
server.
On Jan 23, 6:45 pm, Fran francisb...@googlemail.com wrote:
On Jan 23, 8:55 pm, mdipierro mdipie...@cs.depaul.edu wrote:
It is a bit clunky to configure because you have to use routes. You
can have multiple controllers
It is just syntactical sugar
T(%(a)s) % dict(a=hello)
is new syntax equivalent to
T(%(a)s,dict(a=hello))
T could already translated fields and values from your database
(although I would not use it to translate values).
On Jan 24, 12:42 am, Jason Brower encomp...@gmail.com wrote:
In
Ok. So I give it to you, the source of blogitizor. Its not my best
work, but I am limited by the quirks of web applications :(
http://code.google.com/p/blogitizor/
There is a install notes and dependencies on the wiki.
Just some notes to help navigate, I use letters to execute models in
the
New features not documented in Book (2nd edition)
1.74.7
1) request_password_reset and password reset verification
2) python web2py.py -S app -M -R script.py -A arg1 arg2 arg3
3) support for T(%(a)s) % dict(a=hello)
http://groups.google.com/group/web2py/browse_thread/thread/fed8aa7e13d44ab2#
I tried adding:
response.headers['Cache-Control']=private
return response.stream(pdfContents,chunk_size=4096)
based on this thread:
http://groups.google.com/group/web2py/browse_thread/thread/8da2043ec17debd6/4ae69758b19ba426
That solves the issue as well, without the need for
Hi again
strangely while working I found that this line :
gluon.languages.lazyT object at 0x92bbf8c: gluon.languages.lazyT
object at 0x92bbf8c,
was pushed into the top of my translation file ar-ar.py so I got
an error , and was fixed by removing this line
I don't know whether it's my mistake
Seems it's a bug
I had that error and that situation repeated
Traceback (most recent call last):
File /hamdy/workspace/hg/gluon/restricted.py, line 173, in
restricted
exec ccode in environment
File /hamdy/workspace/hg/applications/egypttrader/models/a.py,
line 2, in module
From http://groups.google.com/group/web2py/msg/e6acbb8df0db8e64
quote
any helpers, including a form, is a tree:
form[0] is the table in the form
form[0][i] is the i-th row
form[0][i][1] is the 2nd column of the i-th row
form[0][i][1][0] is the INPUT inside that
form[0]['_class'] is the class
thanks, that helped. i was stuck on the string representation of it.
On 24 Gen, 14:55, DenesL denes1...@yahoo.ca wrote:
Fromhttp://groups.google.com/group/web2py/msg/e6acbb8df0db8e64
quote
any helpers, including a form, is a tree:
form[0] is the table in the form
form[0][i] is the i-th row
worked, thank you :)
On 24 Gen, 09:59, Thadeus Burgess thade...@thadeusb.com wrote:
form.vars.id
-Thadeus
On Sun, Jan 24, 2010 at 2:55 AM, pistacchio pistacc...@gmail.com wrote:
Hi,
once a record has been inserted with form.accepts, how to know the id
of that record? Sure, one can
Primary source of help: web2py groups
-
http://groups.google.com/group/web2py/topics
http://groups.google.com/group/web2py-developers/topics
http://groups.google.com/group/web2py-users-brazil/topics
Tips on searching the users group
Have sameone an example about SQLFORM.widgets.options.widget(...)?
I am no able to obtain a select-option widget.
Thanks
leone
--
You received this message because you are subscribed to the Google Groups
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To
actually the application is running fine, the weird thing is there are
few error log of this EOFError. i can't figure out when did it occur,
i'll keep you update if i can sort it out.
-vince
On Jan 23, 6:36 am, mdipierro mdipie...@cs.depaul.edu wrote:
Are you using the web2py binary or source?
i am running from source on linux and mac.
On Jan 23, 6:36 am, mdipierro mdipie...@cs.depaul.edu wrote:
Are you using the web2py binary or source?
Did you delete only the .table or everything in databases?
Does you app run if you set migrate=False for all tables?
Massimo
On Jan 22, 4:11
form.accepts(...,onvalidation=lambda form: form.vars.newfield='value')
On Jan 23, 11:56 am, leone handja...@gmail.com wrote:
Sorry.
How can I force a value in a field of SQLFORM.factory after its
validation?
Thanks
leone
On 22 Gen, 20:03, mdipierro mdipie...@cs.depaul.edu wrote:
I still
Hard to debug but I think something is wrong here..
$(form).each(function(){
var submitButton = $(this).find(input[type='submit']);
$(submitButton).bind(click, function(e){
...
$(form).each(function(i){
...
for each form in page, find the submit button and bind to click a
function
I will take a patch. ;-)
On Jan 23, 7:03 pm, Jonathan Lundell jlund...@pobox.com wrote:
urlify needs a comment to say explicitly what its intention is. That's partly
because it suppresses quite a few characters that are normally legal in URLs,
which is confusing.
Also,
def urlify(s,
I should add that the original Django Proxy also did caching of the
pages. The one I send you did not. Is this the functionality you need?
It could be added easily adding
if request.env.request_method=='GET':
proxy=cache(request.env.path_info,cache.disk,3600)(proxy)
Massimo
On Jan 23, 6:45
This should work. Nice idea.
On Jan 24, 5:00 am, jlegler jleg...@gmail.com wrote:
This is more of a general python question but maybe someone here knows
if my idea will work or not. I want my function to tell me when it is
done running. Currently I return the stream so there is no obvious
I am interested in the second error:
1) which web2py version?
2) is it producible?
3) can you help me debug it by printing data, type(data) before
File /root/workspace/hg/gluon/html.py, line 107, in xmlescape
data = str(data)
Massimo
On Jan 24, 7:30 am, hamdy.a.farag
I can only see three possible causes of the problem:
1) bug in your version of pickle
2) file permission issue
3) there are some .table files in you databases folder that were
created by a different python dictribution
On Jan 24, 10:16 am, vince lapcc...@gmail.com wrote:
i am running from source
i just double check and it should not be file permission issue.
is it safe to just delete all .table? web2py will auto recreate them?
On Jan 25, 12:44 am, mdipierro mdipie...@cs.depaul.edu wrote:
I can only see three possible causes of the problem:
1) bug in your version of pickle
2) file
On Jan 24, 2010, at 8:30 AM, mdipierro wrote:
I will take a patch. ;-)
I'll contribute one. Any objection to changing the name to slugify, since
it's not really urlifying its input?
On Jan 23, 7:03 pm, Jonathan Lundell jlund...@pobox.com wrote:
urlify needs a comment to say explicitly
web2py will only recreate them if
a) you also delete the database itself (for sqlite, you must delete
everything in databases)
OR
b) you know for sure that the current models reflect exactly the
structure of the database tables and you set db.define_table
(...,fake_migrate=True) for all tables.
No objection. It is not in stable it.
On Jan 24, 10:55 am, Jonathan Lundell jlund...@pobox.com wrote:
On Jan 24, 2010, at 8:30 AM, mdipierro wrote:
I will take a patch. ;-)
I'll contribute one. Any objection to changing the name to slugify, since
it's not really urlifying its input?
Since you are at it. We may want to consider a IS_SLUG validator and
make the function a staticmethod of IS_SLUG (instead of a function in
contrib) so it can be called without any import from contrib.
On Jan 24, 11:12 am, mdipierro mdipie...@cs.depaul.edu wrote:
No objection. It is not in stable
How to translate the following SQL query in a web2py DAL expression?
Thanks
SELECT field, count(*) FROM table GROUP BY field
--
You received this message because you are subscribed to the Google Groups
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To
On Jan 24, 2010, at 9:14 AM, mdipierro wrote:
Since you are at it. We may want to consider a IS_SLUG validator and
make the function a staticmethod of IS_SLUG (instead of a function in
contrib) so it can be called without any import from contrib.
OK.
On Jan 24, 11:12 am, mdipierro
Nevermind, i found it in the book minutes after posting :)
For those interested:
count = db.table.field.count()
result = db().select(db.table.field, count, groupby = db.table.field)
On 24 Gen, 18:22, pistacchio pistacc...@gmail.com wrote:
How to translate the following SQL query in a web2py
I'm ok with slugify, but the reason i chose urlify is that slug is
not really a mvc term. It comes from the journalistic jargon and it's
been adopted by the original Django developers that were working on a
framework to build a newspaper site on.
I don't think that slug, outside the Django
I do not know about this. What do other people think?
I do not have a strong opinion either way.
On Jan 24, 11:34 am, pistacchio pistacc...@gmail.com wrote:
I'm ok with slugify, but the reason i chose urlify is that slug is
not really a mvc term. It comes from the journalistic jargon and it's
On Jan 24, 2010, at 9:53 AM, mdipierro wrote:
I do not know about this. What do other people think?
I do not have a strong opinion either way.
I think that slug is a fairly common term. WordPress uses it, for example.
And if we make it a validator (I'm about to submit a patch), it definitely
look in gluon/sqlhtml.py
-Thadeus
On Sun, Jan 24, 2010 at 10:06 AM, leone handja...@gmail.com wrote:
Have sameone an example about SQLFORM.widgets.options.widget(...)?
I am no able to obtain a select-option widget.
Thanks
leone
--
You received this message because you are subscribed
That's a good point.
I also think the IS_SLUG should not do validation, just filtering. Or
perhaps have an option to
def IS_SLUG():
def __init__(check=False,error_message=):
self.check=check
self.error_message=error_message
@staticmethod
def slugify(value):
I agree with pistacchio.
agree with you massimo on IS_SLUG for filtering only, if you want to
validate use IS_ALPHANUMERIC.
-Thadeus
On Sun, Jan 24, 2010 at 12:39 PM, Jonathan Lundell jlund...@pobox.com wrote:
On Jan 24, 2010, at 9:53 AM, mdipierro wrote:
I do not know about this. What
On Jan 24, 2010, at 11:05 AM, mdipierro wrote:
That's a good point.
I also think the IS_SLUG should not do validation, just filtering. Or
perhaps have an option to
The patch I sent is filtering-only, sort of a super IS_LOWER().
The main use for it in a form, I think, is to combine IS_SLUG
Jonathan sent me a patch, I merged it with the suggestions above and I
am uploading IS_SLUG to trunk.
Massimo
On Jan 24, 1:09 pm, Thadeus Burgess thade...@thadeusb.com wrote:
I agree with pistacchio.
agree with you massimo on IS_SLUG for filtering only, if you want to
validate use
i can't sort out how to reproduce it anyway, it's not happening
everytime i add a field. i'll see if the clean up of .table works
On Jan 25, 2:58 am, vince lapcc...@gmail.com wrote:
i just did some test and the error seems to appear when i modify the
table definition, eg add a new field with
You can have a problem with sqlite if you remove a field and you add
it again with the same name.
This is because sqlite does not support ALTER TABLE ... DROP.
Massimo
On Jan 24, 1:21 pm, vince lapcc...@gmail.com wrote:
i can't sort out how to reproduce it anyway, it's not happening
everytime
Is it possible I have no pending patches?
Am I forgetting something?
Massimo
--
You received this message because you are subscribed to the Google Groups
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to
oh that's why. thank for the info.
On Jan 25, 3:24 am, mdipierro mdipie...@cs.depaul.edu wrote:
You can have a problem with sqlite if you remove a field and you add
it again with the same name.
This is because sqlite does not support ALTER TABLE ... DROP.
Massimo
On Jan 24, 1:21 pm, vince
Hi!
Please have a look at
http://code.google.com/r/pihentagy-web2py/source/detail?r=f503c69dee738ebb332e6d25f89328d6910b853f
http://code.google.com/r/pihentagy-web2py/source/detail?r=230fbcc1f488864f868e7dd00e4d9c8b7b41bee3
I am a newbie to mercurial, but how these small bugfixes can go into
One of them is an error in the docs so I just included it. The other
two are minor indentation issues so I left them alone.
In general if you just email me patches, I will review and apply them.
Thanks Gergo.
Massimo
On Jan 24, 2:42 pm, KONTRA, Gergely pihent...@gmail.com wrote:
Hi!
Please
Hi,
What I plan to do is, changing my form in my view according to
selected option without pushing a button.
I mean, when I change my option, the form must change. And by default
first option is selected also... How can I change my below code to
make it dynamic? Or do you have any suggestions?
You need to handle this with jQuery.
One can have a single form with all fields you need and use jQuery to
show/hide fields based on values of other fields (*) OR you can have
multiple forms in the page and use jQuery to show/hide an entire form.
The action that generates the forms is executed
not an option i want wysiwyg, it seems to be possible so i want it
On Jan 23, 5:59 pm, Thadeus Burgess thade...@thadeusb.com wrote:
Have you ever thought of just using markdown/WIKI syntax and using a
markdown editor such as WMD or others like it ?
-Thadeus
On Sat, Jan 23, 2010 at 6:54
#1.74.8
IS_SLUG, thanks Gustavo and Jonathan
web2py.py -nogui, thanks Jeff Bauer
solved a problem with jython, thanks Tim Farrel
login has remember be option, thanks Piotr Banasziewicz
fixed problem with keepvalue in update forms, thanks Miguel Lopez
Please give it a try and, as usual, report any
Found a typo in the scribd book, on page (scribd 148) printed 132. The
html helpers list at the bottom of the page, and the next paragraph
contains an innecessary text 5mm. Maybe a wrongly formatted \vspace
argument?
On jan. 24, 21:53, mdipierro mdipie...@cs.depaul.edu wrote:
One of them is an
hi Thadeus,
this code has heaps of awesome snippets that will be useful to reuse -
thanks for sharing!
I love the black admin layout you've used with the flash message
embedded in the top section - do you mind if I reuse it?
And do you have a live website using blogitizer?
I noticed a few
On Jan 25, 2:32 am, mdipierro mdipie...@cs.depaul.edu wrote:
I should add that the original Django Proxy also did caching of the
pages. The one I send you did not. Is this the functionality you need?
It could be added easily adding
if request.env.request_method=='GET':
thadeusb.com is running blogitizor :)
the admin panel comes from frogcms.
So here is the story, I started this to be my website, so I have a
theme based around python variables (if you visit my site you will
quickly see). This is just part of that theme, and these should be
included in the
And the problem with not adding categories is probably a simple fix in
the SQLFORM requires.
DO you mind filling out issue tickets on google code for these?
-Thadeus
On Sun, Jan 24, 2010 at 7:13 PM, Thadeus Burgess thade...@thadeusb.com wrote:
thadeusb.com is running blogitizor :)
the
On Jan 25, 10:44 am, John Heenan johnmhee...@gmail.com wrote:
The __call__ function of the Cache global class instance, cache, is
More confusion busting that is going off topic and should be placed in
a topic of its own that discusses style issues.
For those who are not adjusted to the 'web2py
Thanks for taking the effort to extract this from your personal site.
Have submitted those issues as tickets.
Ah I thought the admin layout seemed familiar - I had been evaluating
RadiantCMS (RoR), which FrogCMS is a PHP clone of.
Richard
On Jan 25, 12:15 pm, Thadeus Burgess
Actually my bad, its not __init__.py it is actually XML() that needs patched...
Just append
*args,
**kwargs
to XML() function definition and it will clear out the error.
WIKI would never work if anybody ever passed anything through
**attributes since that gets passed
Interesting, because HazelCMS is the werkzeug clone of frogcms which
is the clone of radiantcms.
Funny how the wheel turns round, everyone wants to implement the same
thing in their own framework i'm sure there is a django clone of
this as well. I just liked the Admin page layout and felt it
Thanks for making the issues, got to practice using commit to close
the tickets :)
-Thadeus
On Sun, Jan 24, 2010 at 7:48 PM, Thadeus Burgess thade...@thadeusb.com wrote:
Interesting, because HazelCMS is the werkzeug clone of frogcms which
is the clone of radiantcms.
Funny how the wheel
Can you email me the patch?
On Jan 24, 7:46 pm, Thadeus Burgess thade...@thadeusb.com wrote:
Actually my bad, its not __init__.py it is actually XML() that needs
patched...
Just append
*args,
**kwargs
to XML() function definition and it will clear out the error.
I'm certain this has been asked a bunch of times. I've spent the last
hour looking for it but can't find it anywhere. Sorry.
The question is how to set the default value of a reference field
based on a query of the referenced table.
db.define_table('car_makers',Field('name',unique=True))
I think you want:
Field('make',db.car_makers,IS_IN_DB(db,db.car_makers.id,'%(name)s')
and
db.car.make.default = db(db.car_makers.name=='Ford').select
(db.car_makers.id).first().id
On Jan 24, 8:46 pm, weheh richard_gor...@verizon.net wrote:
I'm certain this has been asked a bunch of times.
Sorry. I was writing off the top of my head. Of course, I did exactly
what you wrote in my actual code. Still doesn't work.
On Jan 24, 9:53 pm, mdipierro mdipie...@cs.depaul.edu wrote:
I think you want:
Field('make',db.car_makers,IS_IN_DB(db,db.car_makers.id,'%(name)s')
and
how doesn't work?
P.S. you should cache this for speed:
db.car.make.default = db(db.car_makers.name=='Ford').select
(db.car_makers.id,cache=(cache.ram,3600)).first().id
On Jan 24, 9:01 pm, weheh richard_gor...@verizon.net wrote:
Sorry. I was writing off the top of my head. Of course, I did
I'm combining two tables into one form (yet again). I'm using
SQLFORM.factory(db.auth_user,db.table1) to combine the 2 tables into 1
form. All fields have unique names.
I am custom designing the form to make it more compact than the linear
approach used by SQLFORM. Therefore, I end up using
When I go to the URL that displays the form, I see Edsel in the
pulldown, not Ford. p.s. I've never used caching. Do you have a quick
answer for how to do it? Thx. - RG
On Jan 24, 10:12 pm, mdipierro mdipie...@cs.depaul.edu wrote:
how doesn't work?
P.S. you should cache this for speed:
just compile your own version of mod_wsgi
On Jan 24, 2:42 am, pistacchio pistacc...@gmail.com wrote:
Has anyone succesfully run web2py under Mac OSX apache? Any guide?
Thanks.
--
You received this message because you are subscribed to the Google Groups
web2py-users group.
To post to this
yes
On Jan 24, 9:15 pm, weheh richard_gor...@verizon.net wrote:
I'm combining two tables into one form (yet again). I'm using
SQLFORM.factory(db.auth_user,db.table1) to combine the 2 tables into 1
form. All fields have unique names.
I am custom designing the form to make it more compact than
I still find the error appear random, is it possible to trace the URL
of each error?
On Jan 25, 3:24 am, mdipierro mdipie...@cs.depaul.edu wrote:
You can have a problem with sqlite if you remove a field and you add
it again with the same name.
This is because sqlite does not support ALTER
This defines the field as a reference
Field('make',db.car_makers)
This makes the dropdown
db.car.make.requires = IS_IN_DB(db,db.car_makers.id,'%(name)s')
This selects the default option on create forms (not on update forms)
and caches it
db.car.make.default =
Yup, of course, you are right as usual Mr. MDP. Which is why I want to
fatten you up so you'll slow down a little and let ordinary mortals
like me catch up. My mistake was in the IS_IN_DP syntax. I lied in my
earlier note where I said that I did exactly what you wrote. In fact,
I had written
OK, now I'm scared. I don't even know what file the custom widget is
supposed to live in (and I've read the doc, I swear). Do you know of
any good examples I could look at on doing an AJAX call on a drop down
list, where the drop down value is used to pick a value from a table
and then send it
yeah I was also attracted to the admin look and feel.
web2py needs a RadiantCMS clone too! I started on a basic version last
week for my own use, but it is not intended to be as ambitious as
RadiantCMS/FrogCMS (I'm not sure what features HazelCMS covers).
On Jan 25, 12:48 pm, Thadeus Burgess
i see many new people coming to the group and asking the same
questions. please at least watch the screencast on this thread.
--
You received this message because you are subscribed to the Google Groups
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To
Hi Fran,
Any info on your table data? I can do this.
On 23 Ocak, 19:58, Fran francisb...@googlemail.com wrote:
On Jan 23, 5:11 pm, Thadeus Burgess thade...@thadeusb.com wrote:
I took a look but I still don't quite understand what you are
importing into web2py
Thanks...we have various
The screencast mentioned in this thread should be added to a list of
Read/watch first if your new on the user group, and make it a
sticky.
On Jan 24, 10:41 pm, Mengu whalb...@gmail.com wrote:
i see many new people coming to the group and asking the same
questions. please at least watch the
77 matches
Mail list logo