Sure,
This is the "cookbook" application lightly modifed to take notes on
case followup. I believe I had it running on 1.67. I think this is
where it is hanging:
def new_sda():
form=SQLFORM(db.sda,fields=
['date','fidname','vetname','status','acctdue_at_513',\
'filenum','employee','comments'])
if form.accepts(request.vars,session):
redirect(URL(r=request,f='sdas'))
return dict(form=form)
Below is all of the code:
The Model:
import datetime; now=datetime.date.today()
db=SQLDB('sqlite://db.db')
db.define_table('identify',SQLField('fidname','string'))
db.define_table('current_status',SQLField('status','string'))
db.define_table('sda',
SQLField('fidname',db.identify),
SQLField('status',db.current_status),
SQLField('employee','string'),
SQLField('comments','text'),
SQLField('filenum', length=10),
SQLField('date','date',default=now),
SQLField
('acctdue_at_513','string',default='0000-00-00'),
SQLField('vetname','string'))
db.current_status.status.requires=[IS_NOT_EMPTY(),IS_NOT_IN_DB
(db,'current_status.status')]
db.identify.fidname.requires=[IS_NOT_EMPTY(),IS_NOT_IN_DB
(db,'identify.fidname')]
db.sda.filenum.requires=[IS_NOT_EMPTY()]
db.sda.comments.requires=IS_NOT_EMPTY()
db.sda.fidname.requires=IS_IN_DB
(db,'identify.fidname','identify.fidname')
db.sda.status.requires=IS_IN_DB
(db,'current_status.status','current_status.status')
db.sda.employee.requires=IS_NOT_EMPTY()
Controller:
@auth.requires_login()
def sdas():
if not session.counter:
session.counter = 1
else:
session.counter += 1
records=db(db.sda.fidname==request.vars.fidname)\
.select(
orderby=db.sda.filenum | ~db.sda.date)
form=SQLFORM(db.sda, fields=['fidname'])
return dict(form=form,records=records,counter=session.counter)
@auth.requires_login()
def show():
id=request.vars.id
sdas=db(db.sda.id==id).select()
if not len(sdas): redirect(URL(r=request,f='sdas'))
return dict(sda=sdas[0])
@auth.requires_login()
def new_sda():
form=SQLFORM(db.sda,fields=
['date','fidname','vetname','status','acctdue_at_513',\
'filenum','employee','comments'])
if form.accepts(request.vars,session):
redirect(URL(r=request,f='sdas'))
return dict(form=form)
def new_fiduciary():
form=SQLFORM(db.identify)
if form.accepts(request.vars,session):
redirect(URL(r=request, f='sdas'))
return dict(form=form)
@auth.requires_login()
def count():
results=db(db.sda.id>1).count()
if results < 1: redirect(URL(r=request,f='sdas'))
# sdas=db(db.sda.id==id).select()
# if not len(sdas): redirect(URL(r=request,f='sdas'))
# return dict(results=results, sda=sdas[0])
return dict(results=results)
On Nov 30, 9:41 am, mdipierro <[email protected]> wrote:
> Can you show us a could of lines from the code that cause the error?
> What version are you upgrading from?
>
> On Nov 30, 9:53 am, cadrentes <[email protected]> wrote:
>
>
>
> > I'm not sure this is the right forum for this discussion, any guidance
> > in appreciated. After upgrading to 1.72.3 I get the following error
> > in one of my applications: "TypeError: slice indices must be integers
> > or None or have an __index__ method"
>
> > What should I be looking at to fix this. The bug report takes me to
> > the "if vars accepts" line.
>
> > Thanks
> > Richard- Hide quoted text -
>
> - Show quoted text -
--
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en.