Model:
db.define_table('product',
Field('title', 'string', length=64),
Field('image', 'upload'),
)
Controller:
def edit_product_0():
form = SQLFORM(db.product, _id='product_table')
if form.accepts(request.vars, session, keepvalues=True,
dbio=False):
form.vars.id =
Is it possible to use SQLFORM to generate forms which show different
fields?
I.E. I have a model:
db.define_table('client',
Field('uid', auth_user),
Field('name', 'string'),
migrate = 'client.table'
)
I want a page which the client uses that hides the 'uid' field, which
gets
On Jan 15, 9:18 am, mdipierro mdipie...@cs.depaul.edu wrote:
You can change
db.client.uid.readbale=True or False
where you need it, for example in the action before form=.
Massimo
On Jan 15, 11:08 am, kbochert kboch...@copper.net wrote:
Is it possible to use SQLFORM to generate forms which
or RuntimeError.
It is possible that the database does not like the field name 'uid'. I
do not think this is a web2py error.
On Jan 15, 11:35 am, kbochert kboch...@copper.net wrote:
No good.
It hides the field correctly but again after:
form.vars.uid = 2 # set the uid explicitly
:
On Jan 15, 12:13 pm, kbochert kboch...@copper.net wrote:
Error traceback
Traceback (most recent call last):
File gluon/restricted.py, line 173, in restricted
File E:/web2py/applications/mug/controllers/admin.py, line 325, in
module
File E:/web2py/applications/mug/models/db.py
How about:
1. Save the database with db.export_to_csv_file(open('somefile.csv',
'wb'))
-- The csv file should only contain columns defined in the current
database. I have not checked this - seems reasonable.
2. Erase the entire contents of applications\myapp\databases
-- This includes the
Problem:
I have database tables for customers, members, etc that look like
db.define_table('customer',
Field('user_id', db.auth_user),
address('bill'),#inherit address fields
address('ship'),#inherit address fields
phone, #inherit phone fields
migrate =
us know?
Massimo
On Jan 3, 1:53 am, kbochert kboch...@copper.net wrote:
Ok, that works. Now I correctly get to my logon page at
/myapp/admin/user/login?_next=/myapp/admin/home
instead of default\index. But if that logon fails, I get redirected
to
/myapp/admin/user/login
which
these things.
Karl
On Jan 1, 9:25 am, mdipierro mdipie...@cs.depaul.edu wrote:
auth.settings.controller='myctl'
On Jan 1, 8:01 am, kbochert kboch...@copper.net wrote:
I'm trying to use my custom login page.
In models\db.py I put
auth.settings.login_url = /myapp/myctl/user/login
, 12:54 pm, mdipierro mdipie...@cs.depaul.edu wrote:
Silly me. Too much food.
password=db.auth_user.requires('yourpassword')[0]
On Dec 25, 1:12 pm, kbochert kboch...@copper.net wrote:
No Luck.
Causes a missing key error. (db does not have a 'auth_table') Maybe
this is new since 1.72.3
It does work. Just a moment of update panic on my part.
On Dec 26, 5:32 am, kbochert kboch...@copper.net wrote:
Just loaded it.
Has something changed with routes.py??
The web2py directory does not have a routes.py, and when I add mine it
does not appear to have any effect.
Karl
On Dec 25
Pardon the multiple posts. 1.74.4 and requested_uri work as expected
Happy Holidays
Karl
On Dec 26, 6:24 am, kbochert kboch...@copper.net wrote:
It does work. Just a moment of update panic on my part.
On Dec 26, 5:32 am, kbochert kboch...@copper.net wrote:
Just loaded it.
Has something
) that looked like many concatenated url's, each with
an error ticket attached
Karl
On Dec 26, 7:39 am, mdipierro mdipie...@cs.depaul.edu wrote:
password=db.auth_user.password.requires('yourpassword')[0]
On Dec 26, 7:46 am, kbochert kboch...@copper.net wrote:
Traceback (most recent call last):
File
())
db.auth_user.password.requires[0]('...') calls the validator and
return (hashed_password,None)
db.auth_user.password.requires[0]('...')[0] is the properly hashed
password whatever the CRYPT parameters are
On Dec 26, 4:25 pm, kbochert kboch...@copper.net wrote:
Sigh--
With that line I
Nope.
In routes.py I have:
routes_onerror = [
('myapp/400' , '/myapp/error/index'),
]
which correctly catches the error
In \myapp\views\error\index.html I have
request.vars.requested_uri-- {{=request.vars.requested_uri}}br
which renders as:
request.vars.requested_uri-- None
When I startup web2py without a database, it creates it. When this
happens I wish to 'pre-load' some data for testing.
How do I create a user with a password?
I'm putting code in db.py like:
if not db().select(db.auth_user.ALL): #database is empty
import hashlib
key =
:
replace
password=hmac.new(key, 'jh', hashlib.sha512).hexdigest()
with
password=db.auth_table.requires('yourpassword')[0]
I think the problem is that if you use hashlib.sha512 you have to add
'sha512:' in front of the hexdigest. look into CRYPT for details.
On Dec 25, 4:31 am, kbochert kboch
Version 1.72.3
Karl
On Dec 25, 7:16 am, mdipierro mdipie...@cs.depaul.edu wrote:
Which web2py version?
On Dec 25, 3:38 am, kbochert kboch...@copper.net wrote:
Nope.
In routes.py I have:
routes_onerror = [
('myapp/400' , '/myapp/error/index'),
]
which correctly catches
When I request a URL - host/myapp/non_existant_fct
a 400 error is generated.
routes_onerror sends it to my custom error page.
How does my custom page find out the URL that generated the 400 error?
Karl
--
You received this message because you are subscribed to the Google Groups
web2py-users
Jonathon wrote:
2x seems like an awful lot, since a newline is only one byte. Are you sure?
The output typically has multiple leading spaces on those blank
lines, presumably driven by the indenting of the original html.
DenesL wrote:
Do you want you view or your final output to be legible and
, Jonathan Lundell jlund...@pobox.com wrote:
On Dec 15, 2009, at 12:08 PM, Alex Fanjul wrote:
Hello Kbochert, it seems you found out a way to make cleaner output, do
you get it working automatically? (ie. with out manual action for output
clean process)
I'm thinking in alway pass
On Dec 15, 3:24 pm, Thadeus Burgess thade...@thadeusb.com wrote:
It messes up my pre tags.
However this helps in cleaning up bad html generated from WYSIWYG editors.
-Thadeus
Works fine for my pre's. Just have to keep in mind the difference
between
pre
abc
def
/pre
which works
On Dec 15, 3:23 pm, mdipierro mdipie...@cs.depaul.edu wrote:
You may also want to look into scripts/cleanhtml.py and scripts/
cleancss.py. The only problem is that it breaks flash.
So flash passes through the renderer, AND is sensitive to blank
lines ?!
And people complain about Python
Just a thought---
Is it possible to serve a css file through the template system?
It might be very useful to be able to use css like:
{{ # define the colors }}
{{primary_color = 0xff3366}}
body {
color: {{=primary_color}} ;
background-color: {{= response.users_background}} ;
...
}
Amazingly enough, the following snippet appears to filter excess lines
while leaving pre blocks unchanged!!
import re
def remove_line(mo):
s = mo.group()
if s.startswith('pre'): return s
return '\n'
def filter(d):
if not isinstance(d,dict): d = d()
pat =
In a view, I have a paginator with code that looks like:
div id='paginator'
{{if ARGS.currentpage == 1:}}
span class=pagerdisabled/span
{{else:}}
a href=./{{=ARGS.currentpage - 1}}Prev/a
{{pass}}
{{for i in range(1,ARGS.pagecnt+1):}}
{{if
I added a slice at web2pyslices.com showing how I 'solved' this
problem.
see 'cleaner urls with routes.py'
Karl
On Nov 29, 6:58 am, mdipierro mdipie...@cs.depaul.edu wrote:
If I understand you want that
/f is mapped into /app/default/f
for every f in default.py if there is no app called f
While trying to use multiple models files, I tried to use a file named
db-mymodel.py
It was totally ignored by web2py until I changed the name to
db_mymodel.py
Is this something to do with windows/linux file naming?
Karl
--
You received this message because you are subscribed to the Google
On Nov 26, 11:05 am, kbochert kboch...@copper.net wrote:
On Nov 26, 10:36 am, mdipierro mdipie...@cs.depaul.edu wrote:
technically you can reload routes without restarting. From the admin
web based shell
from gluon.rewrite improt *
load()
On Nov 26, 12:02 pm, Yarko Tymciurak
As a new user to web2py, I am trying to get routes.py to work.
Nothing I put into web2py/routes.py has any effect.
example:
routes_in=(
('^127\.0\.0\.1:.*',
'/examples/default/index'),
)
Moreover , clear errors in the routes.py have no effect.
i.e.
x = 6/0; @!
Am I overlooking
On Nov 26, 10:36 am, mdipierro mdipie...@cs.depaul.edu wrote:
technically you can reload routes without restarting. From the admin
web based shell
from gluon.rewrite improt *
load()
On Nov 26, 12:02 pm, Yarko Tymciurak resultsinsoftw...@gmail.com
wrote:
routes.py is read when web2py
31 matches
Mail list logo