Use form.vars.id to get the id of the new record inserted
More about it here:
http://web2py.com/books/default/chapter/29/7#SQLFORM
(search form.vars.id to get to the paragraph concerned)
On Dec 23, 3:01 pm, Thomas Dall'Agnese
wrote:
> Hi,
>
> Let say I have 2 tables:
>
> db.define_table('post',
Thanks for your prompt response.
Best Regards,
Thomas
Sent from Android
On Dec 23, 2011 5:02 PM, "lyn2py" wrote:
> Use form.vars.id to get the id of the new record inserted
>
> More about it here:
> http://web2py.com/books/default/chapter/29/7#SQLFORM
> (search form.vars.id to get to the parag
I also did Python first, web second and was fortunate enough to have
the time to compare pretty much every single framework out there. The
main reasons web2py is my preferred framework:
- it is lean and easy to understand 'all the way down'
- this means you are not forced into doing anything the
Hi, Ive used go daddy, works perfect for me and they are cheap
Regards,
Nils
On Dec 23, 2011 4:49 a.m., "guruyaya" wrote:
> I've used it myself, but note this certificate is not insured in any
> way, and it allows a pretty weak protection, in the free edition. It
> also fails to work with wg
Hi, what load balancer are you using?
Regards,
Nils
On Dec 23, 2011 5:17 a.m., "Dave" wrote:
> Since I've moved my installation behind a load balancer all my session
> IP addresses show as the back-side IP of the load balancer, not the
> real client IP.
>
> Have any of you figured out a way to pu
Hi,
I set the format of a table to a given field, and reference it in another table.
Unfortunately, the format seems to be ignored and instead of a combobox there
is a textfield where I can input manually the id of the referenced table.
I am using the trunk version.
Do I need to set up anything
What do you mean by "it's not insured"? Do you refer to the sign up checks
or to the lack of actual insurance provided by some insurance company?
As I see it, the sign up process is not much different than with any other
budget certificate issuer. The difference is only the price.
Regards
On F
hello i´m having some errors with a cert i created with openssl
i have a lot of
SSL3_READ_BYTES: tlsv1 alert unknown ca
I dont know if this is a problem.
The users connect with no problem to we2py but it hapens 2 or 3 times a
week that i have to restart web2py because no one can access it.
I
Thank you, Mic!
Hi,
Is it possible to get the ID of a row in a virtual field?
I tried the following piece of code to virtually get the number of comments
of a given post (assuming two tables "post" and "comment" where a "comment"
entry can have a "post", so a post as many comments):
db.post.virtual_comments_nb
You have two options -- you can let the .process() method handle the
insert, in which case the record id will be in form.vars.id after that, or
you can do the insert manually, in which case the id will be returned by
the .insert() method (i.e., id = db.post.insert(**dict(form.vars))).
Note, I d
Can you show your code?
On Friday, December 23, 2011 6:08:25 AM UTC-5, Thomas Dall'Agnese wrote:
>
> Hi,
>
> I set the format of a table to a given field, and reference it in another
> table.
> Unfortunately, the format seems to be ignored and instead of a combobox
> there is a textfield where I
Hi Anthony,
Thanks for your answer.
I used the form.vars.id way.
And indeed, I had to change my process because the form.process().acceptedwas
false after doing a
form.validate().
So I changed the form.validate() with form.process().accepted and delete
the inserted post if an exception is rais
Instead of row.id, try: row.post.id :-)
Marin
On Fri, Dec 23, 2011 at 2:34 PM, Thomas Dall'Agnese <
thomas.dallagn...@gmail.com> wrote:
> Hi,
>
> Is it possible to get the ID of a row in a virtual field?
>
> I tried the following piece of code to virtually get the number of
> comments of a give
>
> No. The problem is that the router doesn't introspect the controller, and
> it doesn't know what its function names are. So it assumes that 2011 is a
> function in the default controller.
>
> For this to work, it's necessary to provide the router with a list of
> valid functions in the defa
It works, thanks!
In the examples, they can call directly row.field_name.
Why do I have to specify the table name as well in my case?
(row.tablename.fieldbame)
Is it a mistake in the book or is my case different than the examples?
Book
example:
http://www.web2py.com/book/default/chapter/06#New
Another question: the virtual field is not displayed in the SQLTABLE() html
rendering but is correctly displayed in the JSON rendering, is it normal?
All the elements of the URL after the controller and function are
request.args (except the query string, of course). You could have a
function called company(), and then companyid and storeid would be in
request.args(0) and request.args(2), respectively. Or you might want a more
general functio
Sure.
db.define_table('comment',
Field('user', type='reference auth_user',
label=T('User')),
Field('date_added', type='datetime',
label=T('Date Added')),
Field('error_type', type='reference error_type',
label=T('Error Type')),
Field('balise', type='ref
I am guessing from the lack of responses this is not possible with Web2py's
current admin?
On Wed, Dec 21, 2011 at 4:49 PM, Bruce Wade wrote:
> Hello, I know django has this ability so I am assuming web2py also does.
> (Here is to hoping :D)
>
> First the models:
> db.define_table('adreports',
>
I used it in production, it not differs from any other certification.
Startssl CA is included in all modern browsers and operating system, so the
certs they issues are valid ones.
2011/12/23 LightDot
> What do you mean by "it's not insured"? Do you refer to the sign up checks
> or to the lack of
Maybe an error in the book... Table_name has to be present for
disambiguation in case there the same field name is present in many
table... Imagine you use viritual field in the context of a join where your
other table having the same field name is joint into that request...
Richard
On Fri, Dec 2
The web2py admin works diferently to the django admin.
The web2py admin is for install apps and manage instances.
2011/12/23 Bruce Wade
> I am guessing from the lack of responses this is not possible with
> Web2py's current admin?
>
>
> On Wed, Dec 21, 2011 at 4:49 PM, Bruce Wade wrote:
>
>> H
I see, thanks for your explanation.
Cheers,
Thomas
On Sat, Dec 24, 2011 at 12:06 AM, Richard Vézina <
ml.richard.vez...@gmail.com> wrote:
> Maybe an error in the book... Table_name has to be present for
> disambiguation in case there the same field name is present in many
> table... Imagine yo
I think that SQLTABLE need you to specify the columns you want to expose...
So it should need that you specify the virtual field in the "columns="
parameter under that format tablename.fieldname. I read also that columns
will be replace by fields so have a look to the doc about that...
Richard
On
I understand that, but you can also use the database portion to create new
data. That is mainly the part I am talking about.
When clicking database then insert in a table, it would be nice if the
relationships could be linked on that insert. This would make performing
inserts more efficiently.
An
Hi,
I noticed something strange when testing the registration of users.
If I attempt to register as user: 'My Name' (note the space), the form
validation passes and I get an 'email sent' message.
What actually happens though, is the the username gets inserted into
the db as 'my'.
I'm fine with th
You can have a look into the web2py/scripts folder. There is web2py setup
scripts for different distros... You maybe read the command related to SSL
certificate creation and configuration with web2py and try to do the same
thing manually... Or you can just use the setup script... I never have
probl
In order for the validators for a reference field to be created
automatically, I think the referenced tables have to be defined first
(otherwise the validators cannot be defined because they refer to the
referenced table). So, try defining db.comment after the other tables that
it references.
Correct!
It works now, thanks!
[image: Screenshot at 2011-12-24 00:29:10.png]
Best Regards,
Thomas
On Sat, Dec 24, 2011 at 12:26 AM, Anthony wrote:
> In order for the validators for a reference field to be created
> automatically, I think the referenced tables have to be defined first
> (ot
On Dec 23, 10:11 am, Bruce Wade wrote:
> Anyway which files should I start looking at to see how I can implement
> this functionality for myself and anyone else who wants it?
Look for controller appadmin under your or any other app folder.
On Dec 23, 2011, at 6:04 AM, Anthony wrote:
> No. The problem is that the router doesn't introspect the controller, and it
> doesn't know what its function names are. So it assumes that 2011 is a
> function in the default controller.
>
> For this to work, it's necessary to provide the router wi
By default, the 'username' field gets the following validators:
(IS_MATCH('[\w\.\-]+'), IS_NOT_IN_DB(db, table.username))
The IS_MATCH is doing the truncating. Actually, I think that's a bug --
IS_MATCH isn't supposed to transform the input, only check the regex
pattern. For now, though, I supp
IS_MATCH is using the default strict=False parameter in this case, so
it returns the part that matches.
Using strict=True it won't match:
>>> IS_MATCH('[\w\.\-]+', strict=True)('my name')
('my name', 'invalid expression')
Anyways, userids are not supposed to have blanks.
On Dec 23, 10:46 am,
Here good article, how to create certificates itselves, better than
selfsigned:
http://www.garex.net/apache
Or StartSSL.
Look at the code samples under
http://web2py.com/books/default/chapter/29/10#CSV
On Dec 22, 10:09 pm, thstart wrote:
> I want the visitors to be able to download a CSV file.
>
> here is my code:
> def download():
> response.headers['Content-Type'] = 'text/csv'
> attachment = 'at
routers = dict(
BASE = dict(default_application = 'init',
default_controller = 'default',
default_function = 'index',
functions = ['index'],
),
)
With the above routes, admin doesn't work. i.e: localhost:8080/admin/index
throws a password pg but after that the control goes to /admin/site and it
Hmm... doesn't seem to work.
Controller below. As you can see, I've solved the puzzle to my
satisfaction, but I would like to know why the call to oncreate
misfires.
def handle_create(form):
# never happens
print 'hello, world'
def index():
fields = [db.owner.name, db.dog.id]
db
I have bought a certificate from GKG.net sine I have tried some of the
other suggested solutions and asked lots of questions and the process
was very convoluted. Eventually got stuck because web2py.com does not
run an email server and I could not verify ownership. Since I bought
the domain from GKG
On Dec 23, 2011, at 9:14 AM, Joseph Jude wrote:
> routers = dict(
> BASE= dict(default_application = 'init',
> default_controller = 'default',
> default_function = 'index',
> functions = ['index'],
> ),
> )
>
> With the above routes, admin doesn
On Friday, December 23, 2011 12:14:32 PM UTC-5, Joseph Jude wrote:
>
> routers = dict(
> BASE = dict(default_application = 'init',
> default_controller = 'default',
> default_function = 'index',
> functions = ['index'],
> ),
> )
>
> With the above routes, admin doesn't work. i.e: localhost:8080/a
this works:
grid=SQLFORM.smartgrid(db.purchase_order, details=False,
links_in_grid=True,
maxtextlengths={'purchase_order.po_number':15,},
maxtextlength=30,
paginate=20,
sortable=True,
I can't make changes to the load balancer. The x-forwarded-for is
populated but I can not change the config so the source up is kept the
same. If I could, that would have been my first choice.
The network between the lb and web server isn't routed so the ip
source must be the local LAN RFC1018 add
Bruce, you are more brave than me ;)
I always like to get the parent record committed in the database
before adding child records.
that way you know the ID of the parent record and it has the minimal
required fieldset safely saved away. If there's a session
interruption you don't have some poten
I have solved these kinds of concerns with pyramid based applications using
sqlalchemy. However I need to look into the core of how Web2py handles
things to figure out the best way.
Sqlachemy allows you to put everything in:
1) Transactions
2) Sessions
So on submit you first create the parent rec
web2py wraps each request in a single transaction by default, so if you
make multiple inserts during a request and the request ultimately fails due
to an error, the inserts should be rolled back automatically.
See http://web2py.com/books/default/chapter/29/4#Workflow
and http://web2py.com/books
Adi,
Is this 1.99.4?
Is your controller named 'purchase_order'?
Thanks,
Cliff
On Dec 23, 12:44 pm, Adi wrote:
> this works:
>
> grid=SQLFORM.smartgrid(db.purchase_order, details=False,
> links_in_grid=True,
> maxtextlengths={'purchase_order.po_number':15,},
>
Hello,
In the book there is this example :
db.define_table('numbers',
Field('a', 'integer'),
Field('b', 'integer'),
Field('c', 'integer', readable=False, writable=False))
def my_form_processing(form):
c = form.vars.a * form.vars.b
if c < 0:
form.errors.b = 'a*b cannot
Hi Cliff,
No. The name of the controller is "default", but the table, on which
smartgrid is operating is called "purchase_order".
Yes, it is the latest version. 1.99.4
Hi Cliff,
No. The name of the controller is "default", but the table, on which
smartgrid is operating is called "purchase_order".
Yes, it is the latest version. 1.99.4
onvalidation = my_form_processing
registers a callback (called after validation and before accepting).
This does not work
def my_form_processing(table_name, form): form.vars.field1 =
table_name # I know useless, it just
because the callback function must take a single parameter, the form.
Yo
Thanks for explanation...
But I am unable to do what you explain because I try to make a kind of
virtual table to form submission... So I need the "virtual table name" I
pass by request.args(0) to access some dict that I build to make my virtual
table to work...
May I request "request.args(0)" fo
Looking good Massimo - thank you so much for making the book available
online!
I did come across one bug:
http://web2py.com/books/default/reference/29/ReportLab results in "invalid
function (default/reference)"
That URL does not exist, is there a link to it somewhere?
On Dec 23, 3:46 pm, Brian M wrote:
> Looking good Massimo - thank you so much for making the book available
> online!
>
> I did come across one bug:
>
> http://web2py.com/books/default/reference/29/ReportLabresults in "invalid
> function (
I think what you try to do is a kind of bulk insert or bulk update...
I write my own bulk update function with a SQLTABLE table displaying the
rows that will be update and a SQLFORM.factory form for handling the
submission... Then you just manually process records base on the id of the
rows you ha
Have you seen
http://web2py.com/books/default/chapter/29/7#One-form-for-multiple-tables?
If my_form_processing is defined in your controller or a model, it should have
access to the request object.
What web server are you running? On Nginx there's a module to take the
x-forwarded-for and make it the client ip.
http://wiki.nginx.org/HttpRealIpModule
If you create your own cert with OpenSSL, many or most browsers are going
to warn the user that it's not a "real" cert.
You can get an SSL cert from most domain registers or hosting companies
(ie, GoDaddy, NameCheap, Enom, etc).
Also, there is one free provider:
http://www.startssl.com/?app=1
If you want to create your own certs with your own ca you can use this
simple web2py app:
https://simpatica.googlecode.com
mic
2011/12/24 pbreit :
> If you create your own cert with OpenSSL, many or most browsers are going to
> warn the user that it's not a "real" cert.
>
> You can get an SSL c
You are right there's no easy way to do it.
Turns out to stick with SQLFORM instead.
SQLFORM.factory for inserts are great, but not updates.
Thanks Richard!
On Dec 24, 6:30 am, Richard Vézina
wrote:
> I think what you try to do is a kind of bulk insert or bulk update...
>
> I write my own bulk
When I try to access the ad1 table from appadmin, a message is displayed
"Invalid Query 'name'" and the table isn't displayed. No exceptions or
tickets are generated. If I comment out the virtual field, it works fine.
What is wrong in my virtual field definition below?
geo.define_table('country'
When I try to access the ad1 table from appadmin, a message is displayed
"Invalid Query 'name'" and the table isn't displayed. No exceptions or
tickets are generated. If I comment out the virtual field, it works fine.
What is wrong in my virtual field definition below?
geo.define_table('country'
When I try to access the ad1 table from appadmin, a message is displayed
"Invalid Query 'name'" and the table isn't displayed. No exceptions or
tickets are generated. If I comment out the virtual field, it works fine.
What is wrong in my virtual field definition below?
geo.define_table('country'
This something I would definitely be interested in seeing, as well as
input forms for many-to-many in general (not just admin).
Thanks
Vincent
On Dec 23, 12:50 pm, Anthony wrote:
> web2py wraps each request in a single transaction by default, so if you
> make multiple inserts during a request an
Just downloaded and installed web2py version 1.99.4 (2011-12-14 14:4614) ..
I created a new app, and Janrain auth was enabled as standard, but required
creating a private/janrain.key file, and inserting the ID within .. Later
had to add the domain upon seeing errors .. So, now in that file, I ha
This seems even more significant than I realized ..
It seems after getting in by manually editing the URL, after janrain auth,
I am unable to use the admin application .. it now claims, admin interface
is disabled because password file was not found.
I have now disabled janrain by deleting the
This is very nice,
I was presently surprise when during setup my system when I discovered
package web2py.
Thanks for link, I will make update of my web2py...
Regards
- - Miroslav Gojic - -
2011/12/23 José Luis Redrejo Rodríguez
>
>
> 2011/12/22 miroslavgojic
>
>> Today I make installation
Do you have parameters_81.py file in web2py folder?
On Sat, Dec 24, 2011 at 5:01 AM, Chux wrote:
> This seems even more significant than I realized ..
>
> It seems after getting in by manually editing the URL, after janrain auth,
> I am unable to use the admin application .. it now claims, admin
69 matches
Mail list logo