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 = d
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
15, 12:13 pm, kbochert 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
> >
>
in
the form?
Karl
On Jan 15, 9:46 am, mdipierro wrote:
> What is the traceback? Is this an OperationalError 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
lay.
Karl
On Jan 15, 9:18 am, mdipierro 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 wrote:
>
> > Is it possible to use SQLFOR
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 fill
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 = 'c
>
> python web2py.py
>
> On Jan 4, 5:07 am, kbochert wrote:
>
> > I'm assuming that by 'trunk' you mean the top mercurial version.
> > I downloaded it (via TortoiseHg' . Now what?
> > My file explorer (PowerDesk) blinks every 2 sec when it sh
P.S. I just remembered the cause of the explorer blinking. It happens
when my ancient file explorer tries to display too many icon
overlays.
Karl
On Jan 4, 3:07 am, kbochert wrote:
> I'm assuming that by 'trunk' you mean the top mercurial version.
> I downloaded it (via T
gt; Can you please give it a try and let us know?
>
> Massimo
>
> On Jan 3, 1:53 am, kbochert 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
m seldom right about these things.
Karl
On Jan 1, 9:25 am, mdipierro wrote:
> auth.settings.controller='myctl'
>
> On Jan 1, 8:01 am, kbochert wrote:
>
> > I'm trying to use my custom login page.
>
> > In models\db.py I put
>
> > a
I'm trying to use my custom login page.
In models\db.py I put
auth.settings.login_url = "/myapp/myctl/user/login"
When I go to a protected page, I get the expected login page 'myapp
\myctl\user\login' .
If I enter a user email and a bad password, I get sent to the page
'myapp\default\use
] is the first and only validator
> (CTRYPT())
> 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
&
that looked like many concatenated url's, each with
an error ticket attached
Karl
On Dec 26, 7:39 am, mdipierro wrote:
> password=db.auth_user.password.requires('yourpassword')[0]
>
> On Dec 26, 7:46 am, kbochert wrote:
>
> > Traceback (most recent call last):
>
Pardon the multiple posts. 1.74.4 and requested_uri work as expected
Happy Holidays
Karl
On Dec 26, 6:24 am, kbochert wrote:
> It does work. Just a moment of update panic on my part.
>
> On Dec 26, 5:32 am, kbochert wrote:
>
> > Just loaded it.
> > Has somethin
It does work. Just a moment of update panic on my part.
On Dec 26, 5:32 am, kbochert 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
>
3 until I get 1.74.4 working
Karl
On Dec 25, 12:54 pm, mdipierro wrote:
> Silly me. Too much food.
>
> password=db.auth_user.requires('yourpassword')[0]
>
> On Dec 25, 1:12 pm, kbochert wrote:
>
> > No Luck.
> > Causes a missing key error. (db doe
> Massimo
>
> On Dec 25, 1:13 pm, kbochert wrote:
>
> > Version 1.72.3
>
> > Karl
>
> > On Dec 25, 7:16 am, mdipierro wrote:
>
> > > Which web2py version?
>
> > > On Dec 25, 3:38 am, kbochert wrote:
>
> > > > Nope.
>
>
Version 1.72.3
Karl
On Dec 25, 7:16 am, mdipierro wrote:
> Which web2py version?
>
> On Dec 25, 3:38 am, kbochert wrote:
>
> > Nope.
>
> > In routes.py I have:
> > routes_onerror = [
> > ('myapp/400' , '/myapp/error/index'),
>
> 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
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 = auth.settings.hmac_
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}}
which renders as:
request.vars.requested_uri-- None
What
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"
Amazingly enough, the following snippet appears to filter excess lines
while leaving blocks unchanged!!
import re
def remove_line(mo):
s = mo.group()
if s.startswith(''): return s
return '\n'
def filter(d):
if not isinstance(d,dict): d = d()
pat = re.compile(r'(\n\s\s+\n
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}} ;
...
}
On Dec 15, 3:23 pm, mdipierro 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 being indentation sensiti
On Dec 15, 3:24 pm, Thadeus Burgess wrote:
> It messes up my tags.
>
> However this helps in cleaning up bad html generated from WYSIWYG editors.
>
> -Thadeus
>
Works fine for my 's. Just have to keep in mind the difference
between
abc
def
which works as expected, and:
abc
ith my style.
karl
On Dec 15, 12:55 pm, Jonathan Lundell 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
>
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 an
In a view, I have a paginator with code that looks like:
{{if ARGS.currentpage == 1:}}
{{else:}}
Prev
{{pass}}
{{for i in range(1,ARGS.pagecnt+1):}}
{{if i == ARGS.currentpage:}}
{{=i}}
{{else:}}
{{=i}}
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 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 and no
> controller
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 Grou
On Nov 26, 11:05 am, kbochert wrote:
> On Nov 26, 10:36 am, mdipierro 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
On Nov 26, 10:36 am, mdipierro 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
> wrote:
>
> > routes.py is read when web2py starts - be sure to re-start whatever
> >
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 so
35 matches
Mail list logo