I have a problem using SQLFORM.grid and a query from a FORM:
Here is my controller
def synthese():
ListeFamille=db(db.ATPOSTE.id>0).select(orderby=db.ATPOSTE.PS_FAMI)
selection=FORM(TABLE(TR(
TD('Début',INPUT(_name='Deb',id="1",_class="date", requires
= IS_DATE(error_messa
@pbreit
> Can't you just explain to people that this is how you query the db:
>
> rows = db(db.item.id==1).select()
>
> How much is gained by dropping the "db"?
Programming is all about taking comprehensible pieces and piecing them
together for your own purposes. A rote formula of syntax tha
It just seems like you'd need to be told that db() is weird to think that
it is weird. It would be difficult to come to the conclusion that db() is
weird without instruction. Doubly so if you are accessing multiple
databases.
thanks. that's the pattern I am using.
Hi,
I tested using a custom login_onvalidation method:
auth.settings.login_onvalidation = PHPBBDECRYPT()
Using this method I get the form and I can manipulate it's variables
prior to
returning the form, however as far as I can see I would be expected to
return the hashed value that will later be
Thanks for your answers guys. I have another question related to this topic.
Say i want to reference an authorized user instead of a person table:
db.define_table('cat',
Field('name'),
Field('owner', db.auth_user,
default=auth.user_id,readable=False,writable=False),)
So that the "owne
I have a field
Field('uUser2', db.auth_user, default=auth.user_id),
at some moment i added ondelete="CASCADE"
later i changed it to ondelete="NO ACTION"
but when i checked my db i had
KEY `rUser2__idx` (`ruser2`),
CONSTRAINT `sounds_ibfk_1` FOREIGN KEY (`ruser`) REFERENCES `auth_user
I voted. I my opinion every web2py user should vote (you can use a
gmail acount to login) because even if you dont need a pycharm support
yourself, proyects and IDE's including web2py support place this
framework in the place it should be, on top.
Currently the web2py support has more votes than F
may be you should as Hosoda Kenji himself, he's a kind guy, and solve
a bug i found in just few days. you can ask him in the comments
section in the plugin page.
On 15 dic, 11:17, Johann Spies wrote:
> I get
>
> table = self.createform(xfields)
> File "applications/init/modules/plugin_solidfo
The grid acts like a DIV().
So if form=SQLFORM.grid
Then form[0] is the shaded area with the search bar.
Likewise form[1] is the table with the data in it.
You could do form[1].append(whatever) or form[1].insert(-1, stuff).
form.process().accepted becomes form[1].process().accepted
If I recall
Six months ago we started using much beefier servers for our shared
hosting plans. We also started upgrading the hardware on our existing
servers. We did that because we wanted to give you as much memory for
your apps as possible without overselling the RAM and overloading the
servers.
Today we'r
On 16 dic, 10:14, Jose wrote:
> Six months ago we started using much beefier servers for our shared
> hosting plans. We also started upgrading the hardware on our existing
> servers. We did that because we wanted to give you as much memory for
> your apps as possible without overselling the RAM
Thanks a lot for the prompt reply Cliff. The tip you gave me is something i
did not know about and will be handy.. However this is useful to modify the
grid in itself. I need some way to modify the subsequent Create, Edit and
Update pages (if grid is editable). That is if i click on the add butt
excellent news - 80 MB wasn't enough for web2py + Apache on webfaction.
Can you please open a ticket about this?
On Dec 16, 12:10 am, Nik Go wrote:
> A grid search causes an exception when a user enters an unexpected field
> type.
>
> I have this field:
>
> Field('gender', 'integer', default=0,
> requires=IS_IN_SET([(0,'Unknown'), (1, 'Male'), (2, 'Female')])
>
> Sin
I gave my tables plural names, for example locations as opposed to
location.
Smartgrid pluralizes them again to locationses. Not what I want.
Do I have to rename the tables or is there another alternative?
If I do have to rename tables, will this work?
1. Create a second set of tables with sin
unfortunately web2py does not migrate constraints. You have to remove
it yourself.
On Dec 16, 5:51 am, thodoris wrote:
> I have a field
>
> Field('uUser2', db.auth_user, default=auth.user_id),
>
> at some moment i added ondelete="CASCADE"
>
> later i changed it to ondelete="NO ACTION"
>
> but
i voted :) .. web2py deserves support from every decent IDE
Do you get a 'No records found' message, or is the data table
completely gone?
On Dec 16, 4:33 am, JmiXIII wrote:
> I have a problem using SQLFORM.grid and a query from a FORM:
> Here is my controller
>
> def synthese():
> ListeFamille=db(db.ATPOSTE.id>0).select(orderby=db.ATPOSTE.PS_FAMI)
>
You could also just manually set the plural name so you don't have to
rename your tables.
db.locations._plural = 'Locations'
-Jim
On 12/16/2011 8:26 AM, Cliff wrote:
I gave my tables plural names, for example locations as opposed to
location.
Smartgrid pluralizes them again to locationse
i am trying to figure out the SQLFORM.grid from the source. The create and
update forms are generated using SQLFORM and not crud.. my mistake thinking
this was done by CRUD. I guess i will need to customize the form by passing
form.create_form.append(whatever) .. is this the right way? .. i will
The problem is that the 'selection' form isn't being resubmitted
therefore its values aren't available in the request object on
subsequent calls to your controller method. What I've done in the past
is to save the 'selection' form values to cookies (or possibly the
session object) whenever the
Voted ! though we have a good web IDE available out of box.
On Dec 16, 8:28 am, whowhywhat wrote:
> i voted :) .. web2py deserves support from every decent IDE
You can do:
db.define_table('locations', ..., singular='Location', plural='Locations')
or as Jim suggests:
db.locations._singular = 'Location'
db.locations._plural = 'Locations'
I think the automatic pluralizer assumes the table name is singular. Maybe
it should first try to assess whether the
+1
voted!
2011/12/16 chandrakant kumar :
> +1
On Friday, December 16, 2011 9:39:46 AM UTC-5, whowhywhat wrote:
>
> i am trying to figure out the SQLFORM.grid from the source. The create and
> update forms are generated using SQLFORM and not crud.. my mistake thinking
> this was done by CRUD. I guess i will need to customize the form by passi
On Friday, December 16, 2011 6:31:11 AM UTC-5, thodoris wrote:
>
> Thanks for your answers guys. I have another question related to this
> topic.
>
> Say i want to reference an authorized user instead of a person table:
>
> db.define_table('cat',
> Field('name'),
> Field('owner', db.auth_
>
> Unfortunately this solution will not work for me as I get a different
> hash every time I call the hash password function for the same
> plaintext password.
>
What hash function are you using. If you use the same key, it should always
return the same output for a given input.
:) .. that sounds right.. i guess i can just add some jquery in the view
with a condition to check if the view is for edit or create form. The
jquery could just insert the checkbox (if married etc.).. if checked i
could use jquery to un-hide the spouse name field row.
I will also try out the cu
On Friday, December 16, 2011 12:45:12 AM UTC-5, Brian Will wrote:
>
> Something like:
>
> (db.mytable.id == 3).ignore_common_filters().select()
>
A bit ugly, and gets worse if we add more arguments in the future.
> Or:
>
> (db.mytable.id == 3).select(ignore_common_filters=True)
>
Not i
>
> is there a simpler way to just insert some extra elements like
> http://web2py.com/book/default/chapter/07#Adding-extra-form-elements-to-SQLFORM
> .
> I tried this, but this throws up an error (I will check and get back)
>
That's the way to do it. You can also use the .element() and .elem
I agree with Jim S.
The grid is completely blank because it has lost the data.
Just discover it;
I think a nice way would be to use smartgrid:
form=SQLFORM.smartgrid(db.Rebuts,
details=False,
csv=False, search_widget=selection,
I have submitted a ticket (along with a mod to SQLFORM.grid) on that and
Massimo is waiting on me to bring my code to the latest trunk level.
However, this issue is the reason that I haven't yet submitted it. I'd
like to be able to find a way to handle the paging/sorting issue inside
SQLFORM.
I will vote but now i am totally in match with Komodo7,
Very easy to support web2py using build-in komodo tools and its super
powrful scripting using Python or Javascript.
On Fri, Dec 16, 2011 at 9:24 PM, Michele Comitini <
michele.comit...@gmail.com> wrote:
> voted!
>
> 2011/12/16 chandrakant k
What is site packages inside web2py for?
can just place modules and call from any apps?
Thank you for your support.
I'm working on my side to adapt my controller, but I'm not so good to
provide a general solution.
JmiXIII
What do you mean handle it in application logic? How/when do i detect from
my app that a user has been deleted?
wow .. it works! :) ...
i just added the following in the controller (after calling SQLFORM.grid):
#check if form is a create form
if len(request.args)>1 and request.args[-2]=='new' and form.create_form:
my_extra_element =
TR(LABEL('Married'),INPUT(_name='married',value=False,_type='checkbo
On Dec 16, 2011, at 1:44 AM, Brian Will wrote:
> I concede that for web2py's current user base, this is a minor point
> of null concern, but I feel it's a notable blemish in an otherwise
> exceptionally clean and well-thought-out API, and a few blemishes like
> this here and there can represent se
Hello web2py users ;),
I'm using SQLFORM.grid to create form. I wuold like to change labels
in edit form from fields name to (for example) images. How to this ?
regards
brushek
Thanks.
I didn't know about the _singular and _plural attributes.
On Dec 16, 9:50 am, Anthony wrote:
> You can do:
>
> db.define_table('locations', ..., singular='Location', plural='Locations')
>
> or as Jim suggests:
>
> db.locations._singular = 'Location'
> db.locations._plural = 'Locations'
>
The setup.py don't work
I apply the files from http://code.google.com/p/web2pypi/ and problem
solved.
2011/12/15 Massimo Di Pierro
> Sorry I had missed this. Will fix shortly.
>
> On Dec 14, 5:33 pm, Paolo Caruccio wrote:
> > I already wrote how i fixed the issue (tested only IE9, chrome 15,
>
Each time when i try import a module out of a function python show a
error saying they would not find request.
I have to necessarily import all modules inside of a function?
--
Alvaro Lizama Molina - http://alvarolizama.net
On Friday, December 16, 2011 11:01:37 AM UTC-5, thodoris wrote:
>
> What do you mean handle it in application logic? How/when do i detect from
> my app that a user has been deleted?
>
Presumably you have code that deletes users (perhaps via an update form
with the delete option available, or som
On Friday, December 16, 2011 10:42:50 AM UTC-5, Phyo Arkar wrote:
>
> What is site packages inside web2py for?
> can just place modules and call from any apps?
>
You should be able to.
Can you give an example?
On Friday, December 16, 2011 11:43:00 AM UTC-5, nekrox wrote:
>
>
> Each time when i try import a module out of a function python show a
> error saying they would not find request.
>
> I have to necessarily import all modules inside of a function?
>
> --
> Alvaro Lizama
If i do
default.py
def index():
import mymodule
Its ok
But if i do
default.py
import mymodule
def index():
some code here
Its show an error where the error say
NameError: name 'request' is not defined
I dont import the module in each function, i want import only one time.
2011/
Is it possible to use either hard or external cron on fluxflex.com or is
soft cron the only option?
Thanks,
John
Is the 'request' error in mymodule.py? Note, you can't access the 'request'
object in modules. You have to use current.request --
see
http://web2py.com/book/default/chapter/04#Accessing-the-API-from-Python-modules.
Perhaps you're not getting an error when the import is in a function simply
bec
OK I added this code after database definition:
db.auth_user.email.requires.insert(0, IS_LOWER())
So it is always present with register and login.
Now register is working as expected - e.g. if I
create first an account with lower case email
and then try to create an account with same
email bu
Fixed! thanks everybody.
On Dec 15, 7:46 pm, Nik Go wrote:
> Everytime a *new* stable version is out, I come to expect minor releases
> happening in the next several days and try to hold off my own upgrade for
> as long as possible. :P
>
>
>
>
>
>
>
> On Friday, December 16, 2011, Massimo Di Pier
Module import work in standalong web2py but not in gae. Version: 1.99.2
(2011-09-26 06:55:33). Help appreciated.
Thanks,
Joseph
Can you send me a patch?
On Dec 16, 10:36 am, Alvaro Lizama Molina wrote:
> The setup.py don't work
>
> I apply the files fromhttp://code.google.com/p/web2pypi/and problem
> solved.
>
> 2011/12/15 Massimo Di Pierro
>
>
>
>
>
>
>
>
>
> > Sorry I had missed this. Will fix shortly.
>
> > On Dec 14,
Wan't this fixed in 1.99.3? If not, please open a ticket.
On Dec 16, 11:57 am, Joseph Jude wrote:
> Module import work in standalong web2py but not in gae. Version: 1.99.2
> (2011-09-26 06:55:33). Help appreciated.
>
> Thanks,
> Joseph
Nice.
It seems I recall that form.process() does not handle inserted fields.
Just something to look out for when you get to the next stage.
On Dec 16, 11:03 am, whowhywhat wrote:
> wow .. it works! :) ...
>
> i just added the following in the controller (after calling SQLFORM.grid):
>
> #check
When using email as the login username, looks like auth.login() temporarily
replaces the email field validator(s) with just an IS_EMAIL validator
(maybe that should be changed). So, for login, you probably need to use an
onvalidation function to convert to lowercase.
Anthony
On Friday, Decembe
We got it working :) The code bellow may help someone else with a similar
problem... Not sure if it's the most elegant way, but it works...
In a controller, we created a function:
def fn_sku():
row=db(db.sku.id == request.vars['po_sku_id']).select().first()
sku_cpu = row.cpu
return
I believe this is a bug - it should be consistent -
when I state: db.auth_user.email.requires.in**sert(0, IS_LOWER())
On Fri, Dec 16, 2011 at 11:33 AM, Anthony wrote:
> When using email as the login username, looks like auth.login()
> temporarily replaces the email field validator(s) with just a
I tend to agree.
On Friday, December 16, 2011 2:39:06 PM UTC-5, thstart wrote:
>
> I believe this is a bug - it should be consistent -
> when I state: db.auth_user.email.requires.in**sert(0, IS_LOWER())
>
> On Fri, Dec 16, 2011 at 11:33 AM, Anthony wrote:
>
>> When using email as the login us
The name of a table should be what a single row represents. That is
standard relational modeling practice. I would change them.
On Dec 17, 3:50 am, Anthony wrote:
> You can do:
>
> db.define_table('locations', ..., singular='Location', plural='Locations')
>
> or as Jim suggests:
>
> db.locati
At the moment the Pypi version gets created by hand and the process is
rather fragile. While this is something that I believe we should be able to
automate I also suspect that doing so is going to lead to some other issues
for developers who are less familiar with the Pypi version of Web2py.
Un
I like singular table names but it's a bit of a religious war. Plural seems
better when doing SQL queries but singular feels better with DAL queries.
I'm not sure Web2py's migrations can change a table name while preserving
the data. You might need to make the change manually and then update you
so what to do?
please give me an advice
Hello,
I would like to better understand what web2py exactly do...
Say I have this controller function :
def func():
rows = db().select(db.test1.ALL)
table = SQLTABLE(rows)
return dict(table=table)
I would like to know when exactly the query contained into rows will
be effectively e
i haven't upgraded yet, but i believe the patch was applied, and i patched
my versions. i'm using imports like mad, so we know it can work. so
joseph, let us know if the latest versions don't work.
cfh
>
> def func():
> rows = db().select(db.test1.ALL) <-- query executed here - results
> stored in rows object
> table = SQLTABLE(rows) <-- rows object converted to SQLTABLE object
>
Note, the SQLTABLE object isn't serialized to an actual HTML table until
the view where it is inserted is
no ideas?
maybe there is a way to pack the application from the command line? I
could also call this from my python script.
On 11 Dez., 15:12, Alex wrote:
> I have a python deployment script where I update the build info (build
> nr., build date), compile the application, pack it and finally upl
Ok, so it's possible (but extremely rare) that I get differents hash by
doing this :
def ...
rows = db(db[request.args(0)].id>0).select(db[request.args(0)].ALL)
list_of_row_md5h = []
for r in rows:
list_of_row_md5h.append((r.id,r.hmd5))
table = SQLTABLE(rows, columns=+[ re
In that example, I have a real (not virtual field) hmd5 field that store
md5_hash in DB...
On Fri, Dec 16, 2011 at 4:14 PM, Richard Vézina wrote:
> Ok, so it's possible (but extremely rare) that I get differents hash by
> doing this :
>
> def ...
> rows = db(db[request.args(0)].id>0).select(
You problem is parsing invalid HTML or an HTML with non-utf8 encoding.
web2py is not the tool for that. Use beautiful soup to parse it and
then serialize it back to valid HTML in utf8. Then you can use
TAG().flatten(...)
On Dec 16, 2:45 pm, Vasile Ermicioi wrote:
> so what to do?
> please giv
Hello,
I would like to have images instead of text (or text AND image) in
each label for row, when I click edit in form generated by
SQLFORM.grid. How to do this in easiest way ?
Regards
brushek
In your table definition, you can specify a 'label' argument for each
field, and I think that can be whatever you want (e.g., an IMG tag, etc.).
db.define_table('mytable', Field('myfield',
label=IMG(_src=URL('static','img/myimage.png'
Haven't tried it, but hopefully should work.
Anthony
O
Anthony, I'm still on 1.99.2 so I think I'll migrate my apps to
1.99.4. The time saving I'll get from the updated smartgrid will more
than compensate the move.
Andrew, it doesn't make sense to refactor a dozen working and in-
production controllers just to rename tables. I have much better ways
Thank You, Anthony. It was... so easy!!! I was looking for some very
strange and wierd solutions, big + for You :).
regards
brushek
On 16 Gru, 23:32, Anthony wrote:
> In your table definition, you can specify a 'label' argument for each
> field, and I think that can be whatever you want (e.g., a
Adi,
$("#po_sku_sku_id").change(function(event){
could also be
$("#po_sku_sku_id").live('change', function(event){
In case the user changes it a second or third time.
On Dec 16, 2:39 pm, Adi wrote:
> We got it working :) The code bellow may help someone else with a similar
> problem.
I just noticed the following about SQLCustomType in the book:
"This feature is marked as experimental. In practice is has been in web2py
for long time and it works but it can make the code not portable, for
example when the native type is database specific. It does not work on
Google App Engine
Apologies for dragging this out. I don't mean to be combative, but...
@pbreit
It's weird if you're told OR if you think about it (especially if you
aren't already very fluent in Python). If no one tells you, and if you
don't think about it, it's probably fine. Also, the query already
encapsulates
>
> Finally if the legacy table uses a primary key that is not an
> auto-increment id field it is possible to use a "keyed table", for example
> ...
> Note that currently this is only available for DB2, MS-SQL, Ingres and
> Informix, but others can be easily added.
How to added it for Oracle?
I upgraded to 1.99.4 and it works :-)
But there is another issue.
from gluon.contrib.markdown import markdown2 as markdown
in gae it throws error no module named markdown :-(
I apologize posting the electronic version of the book 4th ed in html
and pdf is taking longer than expected but truly I am almost done. The
delay was due to these facts:
1) complete rewrite of the online book app
2) do not use lulu for the pdf download but use the web app itself in
order to
a)
I am trying
Saludos,
Alfonso de la Guarda
Centro Open Source(COS)
http://www.cos-la.net
http://alfonsodg.net
Twitter: @alfonsodg
Redes sociales: alfonsodg
Telef. 991935157
1024D/B23B24A4
5469 ED92 75A3 BBDB FD6B 58A5 54A1 851D B23B 24A4
On Fri, Dec 16, 201
It worked for me.
--
Best,
Douglas Horst
dcho...@gmail.com
Evanston, IL USA
Hi,
It worked too!
Saludos,
Alfonso de la Guarda
Centro Open Source(COS)
http://www.cos-la.net
http://alfonsodg.net
Twitter: @alfonsodg
Redes sociales: alfonsodg
Telef. 991935157
1024D/B23B24A4
5469 ED92 75A3 BBDB FD6B 58A5 54A1 851D B23B 24A4
On Fri, Dec
Worked for me
Ron
Ok. I am glad it is working. It also works on my side. So I guess we
can open this up.
Over the week-end hopefully I will replace the html.
Thanks for you help.
BTW. This uses stripes for payment I do not store any client info.
I do store your email, name and order so that, in the future you will
How to perform a function to strip out white spaces before
registration?
> >> Something like:
> >> (db.mytable.id == 3).ignore_common_filters().select()
>
> > A bit ugly, and gets worse if we add more arguments in the future.
>
> Say in our API that we have a Cat type with some uncommon options for
> users to set. Which is the better approach for setting these o
You might use the CLEANUP validator -- it strips whitespace before removing
special characters. If you don't want to remove any characters and just
want to strip the whitespace, you can specify your own empty regex:
CLEANUP(regex='')
Anthony
On Friday, December 16, 2011 9:18:47 PM UTC-5, thsta
On Friday, December 16, 2011 5:54:54 PM UTC-5, Cliff wrote:
>
> Adi,
>
> $("#po_sku_sku_id").change(function(event){
>
> could also be
>
> $("#po_sku_sku_id").live('change', function(event){
>
> In case the user changes it a second or third time.
>
I'm not a jQuery expert, but I think the .
the issue is I see with the debugger in the case of register - the
validator
executes after register telling 'Invalid Email' when I copy/paste
an email with space after the email itself. I want to prevent this
to happen.
Hi,
As a practice... I just was wondering if there's a way to do something
like
tryruby.org... but with python.
I've seen some "python web compilers" (I'm not sure if thats the best
name for them :/), and I don't know
if someone knows one that has some code on github or somewhere else.
It's just
Keeping all 3rd party modules in site-packages (or whatever name you
prefer for the folder) would bring orderliness.
Consider when a developer is using a large no. of 3rd party modules,
and all are placed in web2py root, it might look ugly.
That's what I feel.
--- Vineet
On Dec 16, 9:45 pm, Antho
Do you mean something like this? http://pythonfiddle.com
Last argument, I promise.
Here's my version of your summary:
1. We have a connection object that represents a database.
2. From the Fields associated with this connection, Queries are
produced with Field's overloaded operators. Queries can also be
produced from combination of other Queries with
trypython.org?
It uses silverlight because it's written with Iron Python but it's pretty
good, I think...
On Fri, Dec 16, 2011 at 10:20 PM, monotasker wrote:
> Do you mean something like this? http://pythonfiddle.com
also this one
http://try-python.appspot.com/
On Fri, Dec 16, 2011 at 10:55 PM, Ismael Serratos wrote:
> trypython.org?
>
> It uses silverlight because it's written with Iron Python but it's pretty
> good, I think...
>
>
> On Fri, Dec 16, 2011 at 10:20 PM, monotasker wrote:
>
>> Do you mean somet
What are the ways in which such multiple layouts and choosing one at the
run time work? Something like wordpress themes? Modifying views/layout fix
the layout to the one that was deployed. But as in wordpress, if more
themes are installed how can a different one be chosen?
Thank you,
Joseph
>
> Last argument, I promise.
I won't hold you to that. :-)
> The existence of Query and Set objects are not a hidden implementation
> details. For example, if the user is unaware of the presence of Query
> objects, db(db.mytable.id == 3) shouldn't make any sense, as
> db.mytable.id == 3 shou
Hello
I am customizing web2py login form, but appear to stuck with this one.
In a normal HTML5 form, for password I can do following:
But how can i add a similar placeholder field to the web2py login form for
the password field. I was able to do the same for the username fie
1 - 100 of 104 matches
Mail list logo