[web2py] Re: Need more than one value to unpack

2014-01-10 Thread Rufus
so, the string object,  val is not composed of two substrings separated by 
a space.  There are
no spaces in the val string, based on that error.

The way the statement looks, I would say it is expecting a time string of 
the format:

dd/mm/yy hh:mm

or similar

On Tuesday, January 7, 2014 1:10:45 PM UTC-5, Akash Agrawall wrote:

  Traceback (most recent call last):
   File 
 /home/hornet632/webapps/joyofreading/web2py/applications/AK_M14/controllers/appadmin.py,
  line 243, in select
 limitby=(start, stop))
   File /home/hornet632/webapps/joyofreading/web2py/gluon/dal.py, line 
 10335, in select
 return adapter.select(self.query,fields,attributes)
   File /home/hornet632/webapps/joyofreading/web2py/gluon/dal.py, line 2388, 
 in select
 return super(SQLiteAdapter, self).select(query, fields, attributes)
   File /home/hornet632/webapps/joyofreading/web2py/gluon/dal.py, line 1831, 
 in select
 return self._select_aux(sql,fields,attributes)
   File /home/hornet632/webapps/joyofreading/web2py/gluon/dal.py, line 1796, 
 in _select_aux
 self.execute(sql)
   File /home/hornet632/webapps/joyofreading/web2py/gluon/dal.py, line 1916, 
 in execute
 return self.log_execute(*a, **b)
   File /home/hornet632/webapps/joyofreading/web2py/gluon/dal.py, line 1910, 
 in log_execute
 ret = self.cursor.execute(command, *a[1:], **b)
   File /usr/local/lib/python2.7/sqlite3/dbapi2.py, line 66, in 
 convert_timestamp
 datepart, timepart = val.split( )
 ValueError: need more than 1 value to unpack




-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Need more than one value to unpack

2014-01-07 Thread Akash Agrawall


 Traceback (most recent call last):
  File 
/home/hornet632/webapps/joyofreading/web2py/applications/AK_M14/controllers/appadmin.py,
 line 243, in select
limitby=(start, stop))
  File /home/hornet632/webapps/joyofreading/web2py/gluon/dal.py, line 10335, 
in select
return adapter.select(self.query,fields,attributes)
  File /home/hornet632/webapps/joyofreading/web2py/gluon/dal.py, line 2388, 
in select
return super(SQLiteAdapter, self).select(query, fields, attributes)
  File /home/hornet632/webapps/joyofreading/web2py/gluon/dal.py, line 1831, 
in select
return self._select_aux(sql,fields,attributes)
  File /home/hornet632/webapps/joyofreading/web2py/gluon/dal.py, line 1796, 
in _select_aux
self.execute(sql)
  File /home/hornet632/webapps/joyofreading/web2py/gluon/dal.py, line 1916, 
in execute
return self.log_execute(*a, **b)
  File /home/hornet632/webapps/joyofreading/web2py/gluon/dal.py, line 1910, 
in log_execute
ret = self.cursor.execute(command, *a[1:], **b)
  File /usr/local/lib/python2.7/sqlite3/dbapi2.py, line 66, in 
convert_timestamp
datepart, timepart = val.split( )
ValueError: need more than 1 value to unpack



On Tuesday, January 7, 2014 2:11:35 AM UTC+5:30, Dave S wrote:

 On Monday, January 6, 2014 12:32:01 PM UTC-8, Akash Agrawall wrote:

 I am getting this error:
 Need more than one value to unpack


 Can you tell us which line the error message is referencing?  Is there a 
 traceback in the ticket?

 /dps


  

 *db.py:*
 class IS_CATEGORYIT(object):
 def __init__(self, error_message=Zip code not allowed):
 self.error_message = error
 def __call__(self, value):
 error = None
 print len(value)
 if len(value)==0:
 error = self.error_message
 return (value, error)
 db.define_table('book',
 db.Field('Name','string'),
 db.Field('Category','string',requires=IS_CATEGORYIT),
 db.Field('Quantity','integer'),
 db.Field('ISBN','string',unique=True),
 db.Field('Age_group','list:string', 
 requires=IS_IN_SET(['1-4','5-8','9-12','13-17'])),
 
 db.Field('entry_date','date',default=datetime.date.today(),requires=IS_DATE(format=('%d-%m-%Y'))),
 db.Field('Description','text'),
 db.Field('Image','upload',uploadfield='picture_file'),
 db.Field('picture_file','blob'),
 db.Field('Available','integer'),
 db.Field('Author','string'),
 db.Field('Link','string',requires=IS_EMPTY_OR(IS_URL(

 db.book.Description.widget= lambda field,value: 
 SQLFORM.widgets.text.widget(field,value,_style='width:400px',_rows=5)
 db.book.Category.requires=IS_IN_SET(['ficton','non-fiction','action and 
 adventure','travel','biography','story'],multiple=True,zero=None),IS_NOT_EMPTY(error_message=cannot
  
 be empty)
 db.book.Category.widget= lambda field,value: 
 SQLFORM.widgets.checkboxes.widget(field,value)

 *controller: default.py*
 def add_book():
 form1=SQLFORM(db.book)
 form1.add_button('Cancel', URL('add_book'))
 if form1.accepts(request.vars,session):
 response.flash=Book Inserted
 elif form1.errors:
 response.flash=Errors in form
 return dict(form1=form1)

 *view:add_book.html*
 {{=form1.custom.begin}}
 table
 trtd  style=width:51%Namenbsp;span 
 style=color:red;*/span:/tdtd {{=form1.custom.widget.Name
 }}/td/tr
 trtd Quantitynbsp;span style=color:red;*/span:/tdtd 
 {{=form1.custom.widget.Quantity}}/td/tr
 trtd  style=width:51%Availablenbsp;span 
 style=color:red;*/span:/tdtd 
 {{=form1.custom.widget.Available}}/td/tr
 trtd  style=width:51%ISBNnbsp;span style=color:red;*/span: 
 /tdtd{{=form1.custom.widget.ISBN}}/td/tr
 trtd  style=width:51%Entry Datenbsp;span 
 style=color:red;*/span: 
 /tdtd{{=form1.custom.widget.entry_date}}/td/tr
 /table
 nbsp;
 span style=color:#66; Category/spanspan 
 style=color:red;*/span: nbsp;nbsp;
 br/
 span style=position:relative;left:43%;color:rgb(102, 102, 102);label 
 class=checkbox inline{{=form1.custom.widget.Category[0]}}/label/span
 span style=position:relative;left:50%;color:rgb(102, 102, 102);label 
 class=checkbox 
 inline{{=form1.custom.widget.Category[1]}}/label/spanbr/
 span style=position:relative;left:43%;color:rgb(102, 102, 102);label 
 class=checkbox inline{{=form1.custom.widget.Category[3]}}/label/span
 span style=position:relative;left:50.5%;color:rgb(102, 102, 
 102);label class=checkbox 
 inline{{=form1.custom.widget.Category[4]}}/label/spanbr/
 span style=position:relative;left:43%;color:rgb(102, 102, 102);label 
 class=checkbox inline{{=form1.custom.widget.Category[5]}}/label/span
 span style=position:relative;left:51%;color:rgb(102, 102, 102);label 
 class=checkbox inline{{=form1.custom.widget.Category[2]}}/label/span
 /tr
  /tr
 table
 trtd style=width:45%Age Groupnbsp;span 
 style=color:red;*/span:/td 
 

[web2py] Re: Need more than one value to unpack

2014-01-07 Thread Akash Agrawall


On Tuesday, January 7, 2014 2:11:35 AM UTC+5:30, Dave S wrote:

 On Monday, January 6, 2014 12:32:01 PM UTC-8, Akash Agrawall wrote:

 I am getting this error:
 Need more than one value to unpack


 Can you tell us which line the error message is referencing?  Is there a 
 traceback in the ticket?

 /dps



Traceback (most recent call last):
  File 
/home/hornet632/webapps/joyofreading/web2py/applications/AK_M14/controllers/appadmin.py,
 line 243, in select
limitby=(start, stop))
  File /home/hornet632/webapps/joyofreading/web2py/gluon/dal.py, line 10335, 
in select
return adapter.select(self.query,fields,attributes)
  File /home/hornet632/webapps/joyofreading/web2py/gluon/dal.py, line 2388, 
in select
return super(SQLiteAdapter, self).select(query, fields, attributes)
  File /home/hornet632/webapps/joyofreading/web2py/gluon/dal.py, line 1831, 
in select
return self._select_aux(sql,fields,attributes)
  File /home/hornet632/webapps/joyofreading/web2py/gluon/dal.py, line 1796, 
in _select_aux
self.execute(sql)
  File /home/hornet632/webapps/joyofreading/web2py/gluon/dal.py, line 1916, 
in execute
return self.log_execute(*a, **b)
  File /home/hornet632/webapps/joyofreading/web2py/gluon/dal.py, line 1910, 
in log_execute
ret = self.cursor.execute(command, *a[1:], **b)
  File /usr/local/lib/python2.7/sqlite3/dbapi2.py, line 66, in 
convert_timestamp
datepart, timepart = val.split( )
ValueError: need more than 1 value to unpack

 

  

 *db.py:*
 class IS_CATEGORYIT(object):
 def __init__(self, error_message=Zip code not allowed):
 self.error_message = error
 def __call__(self, value):
 error = None
 print len(value)
 if len(value)==0:
 error = self.error_message
 return (value, error)
 db.define_table('book',
 db.Field('Name','string'),
 db.Field('Category','string',requires=IS_CATEGORYIT),
 db.Field('Quantity','integer'),
 db.Field('ISBN','string',unique=True),
 db.Field('Age_group','list:string', 
 requires=IS_IN_SET(['1-4','5-8','9-12','13-17'])),
 
 db.Field('entry_date','date',default=datetime.date.today(),requires=IS_DATE(format=('%d-%m-%Y'))),
 db.Field('Description','text'),
 db.Field('Image','upload',uploadfield='picture_file'),
 db.Field('picture_file','blob'),
 db.Field('Available','integer'),
 db.Field('Author','string'),
 db.Field('Link','string',requires=IS_EMPTY_OR(IS_URL(

 db.book.Description.widget= lambda field,value: 
 SQLFORM.widgets.text.widget(field,value,_style='width:400px',_rows=5)
 db.book.Category.requires=IS_IN_SET(['ficton','non-fiction','action and 
 adventure','travel','biography','story'],multiple=True,zero=None),IS_NOT_EMPTY(error_message=cannot
  
 be empty)
 db.book.Category.widget= lambda field,value: 
 SQLFORM.widgets.checkboxes.widget(field,value)

 *controller: default.py*
 def add_book():
 form1=SQLFORM(db.book)
 form1.add_button('Cancel', URL('add_book'))
 if form1.accepts(request.vars,session):
 response.flash=Book Inserted
 elif form1.errors:
 response.flash=Errors in form
 return dict(form1=form1)

 *view:add_book.html*
 {{=form1.custom.begin}}
 table
 trtd  style=width:51%Namenbsp;span 
 style=color:red;*/span:/tdtd {{=form1.custom.widget.Name
 }}/td/tr
 trtd Quantitynbsp;span style=color:red;*/span:/tdtd 
 {{=form1.custom.widget.Quantity}}/td/tr
 trtd  style=width:51%Availablenbsp;span 
 style=color:red;*/span:/tdtd 
 {{=form1.custom.widget.Available}}/td/tr
 trtd  style=width:51%ISBNnbsp;span style=color:red;*/span: 
 /tdtd{{=form1.custom.widget.ISBN}}/td/tr
 trtd  style=width:51%Entry Datenbsp;span 
 style=color:red;*/span: 
 /tdtd{{=form1.custom.widget.entry_date}}/td/tr
 /table
 nbsp;
 span style=color:#66; Category/spanspan 
 style=color:red;*/span: nbsp;nbsp;
 br/
 span style=position:relative;left:43%;color:rgb(102, 102, 102);label 
 class=checkbox inline{{=form1.custom.widget.Category[0]}}/label/span
 span style=position:relative;left:50%;color:rgb(102, 102, 102);label 
 class=checkbox 
 inline{{=form1.custom.widget.Category[1]}}/label/spanbr/
 span style=position:relative;left:43%;color:rgb(102, 102, 102);label 
 class=checkbox inline{{=form1.custom.widget.Category[3]}}/label/span
 span style=position:relative;left:50.5%;color:rgb(102, 102, 
 102);label class=checkbox 
 inline{{=form1.custom.widget.Category[4]}}/label/spanbr/
 span style=position:relative;left:43%;color:rgb(102, 102, 102);label 
 class=checkbox inline{{=form1.custom.widget.Category[5]}}/label/span
 span style=position:relative;left:51%;color:rgb(102, 102, 102);label 
 class=checkbox inline{{=form1.custom.widget.Category[2]}}/label/span
 /tr
  /tr
 table
 trtd style=width:45%Age Groupnbsp;span 
 style=color:red;*/span:/td 
 

[web2py] Re: Need more than one value to unpack

2014-01-07 Thread Akash Agrawall


Traceback (most recent call last):
  File 
/home/hornet632/webapps/joyofreading/web2py/applications/AK_M14/controllers/appadmin.py,
 line 243, in select
limitby=(start, stop))
  File /home/hornet632/webapps/joyofreading/web2py/gluon/dal.py, line 10335, 
in select
return adapter.select(self.query,fields,attributes)
  File /home/hornet632/webapps/joyofreading/web2py/gluon/dal.py, line 2388, 
in select
return super(SQLiteAdapter, self).select(query, fields, attributes)
  File /home/hornet632/webapps/joyofreading/web2py/gluon/dal.py, line 1831, 
in select
return self._select_aux(sql,fields,attributes)
  File /home/hornet632/webapps/joyofreading/web2py/gluon/dal.py, line 1796, 
in _select_aux
self.execute(sql)
  File /home/hornet632/webapps/joyofreading/web2py/gluon/dal.py, line 1916, 
in execute
return self.log_execute(*a, **b)
  File /home/hornet632/webapps/joyofreading/web2py/gluon/dal.py, line 1910, 
in log_execute
ret = self.cursor.execute(command, *a[1:], **b)
  File /usr/local/lib/python2.7/sqlite3/dbapi2.py, line 66, in 
convert_timestamp
datepart, timepart = val.split( )
ValueError: need more than 1 value to unpack



On Tuesday, January 7, 2014 3:21:09 AM UTC+5:30, Anthony wrote:

 Yes, please provide more detail.

 Also, requires=IS_CATEGORYIT should be requires=IS_CATEGORYIT().

 Anthony

 On Monday, January 6, 2014 3:41:35 PM UTC-5, Dave S wrote:

 On Monday, January 6, 2014 12:32:01 PM UTC-8, Akash Agrawall wrote:

 I am getting this error:
 Need more than one value to unpack


 Can you tell us which line the error message is referencing?  Is there a 
 traceback in the ticket?

 /dps


  

 *db.py:*
 class IS_CATEGORYIT(object):
 def __init__(self, error_message=Zip code not allowed):
 self.error_message = error
 def __call__(self, value):
 error = None
 print len(value)
 if len(value)==0:
 error = self.error_message
 return (value, error)
 db.define_table('book',
 db.Field('Name','string'),
 db.Field('Category','string',requires=IS_CATEGORYIT),
 db.Field('Quantity','integer'),
 db.Field('ISBN','string',unique=True),
 db.Field('Age_group','list:string', 
 requires=IS_IN_SET(['1-4','5-8','9-12','13-17'])),
 
 db.Field('entry_date','date',default=datetime.date.today(),requires=IS_DATE(format=('%d-%m-%Y'))),
 db.Field('Description','text'),
 db.Field('Image','upload',uploadfield='picture_file'),
 db.Field('picture_file','blob'),
 db.Field('Available','integer'),
 db.Field('Author','string'),
 db.Field('Link','string',requires=IS_EMPTY_OR(IS_URL(

 db.book.Description.widget= lambda field,value: 
 SQLFORM.widgets.text.widget(field,value,_style='width:400px',_rows=5)
 db.book.Category.requires=IS_IN_SET(['ficton','non-fiction','action and 
 adventure','travel','biography','story'],multiple=True,zero=None),IS_NOT_EMPTY(error_message=cannot
  
 be empty)
 db.book.Category.widget= lambda field,value: 
 SQLFORM.widgets.checkboxes.widget(field,value)

 *controller: default.py*
 def add_book():
 form1=SQLFORM(db.book)
 form1.add_button('Cancel', URL('add_book'))
 if form1.accepts(request.vars,session):
 response.flash=Book Inserted
 elif form1.errors:
 response.flash=Errors in form
 return dict(form1=form1)

 *view:add_book.html*
 {{=form1.custom.begin}}
 table
 trtd  style=width:51%Namenbsp;span 
 style=color:red;*/span:/tdtd {{=form1.custom.widget.Name
 }}/td/tr
 trtd Quantitynbsp;span style=color:red;*/span:/tdtd 
 {{=form1.custom.widget.Quantity}}/td/tr
 trtd  style=width:51%Availablenbsp;span 
 style=color:red;*/span:/tdtd 
 {{=form1.custom.widget.Available}}/td/tr
 trtd  style=width:51%ISBNnbsp;span style=color:red;*/span: 
 /tdtd{{=form1.custom.widget.ISBN}}/td/tr
 trtd  style=width:51%Entry Datenbsp;span 
 style=color:red;*/span: 
 /tdtd{{=form1.custom.widget.entry_date}}/td/tr
 /table
 nbsp;
 span style=color:#66; Category/spanspan 
 style=color:red;*/span: nbsp;nbsp;
 br/
 span style=position:relative;left:43%;color:rgb(102, 102, 
 102);label class=checkbox 
 inline{{=form1.custom.widget.Category[0]}}/label/span
 span style=position:relative;left:50%;color:rgb(102, 102, 
 102);label class=checkbox 
 inline{{=form1.custom.widget.Category[1]}}/label/spanbr/
 span style=position:relative;left:43%;color:rgb(102, 102, 
 102);label class=checkbox 
 inline{{=form1.custom.widget.Category[3]}}/label/span
 span style=position:relative;left:50.5%;color:rgb(102, 102, 
 102);label class=checkbox 
 inline{{=form1.custom.widget.Category[4]}}/label/spanbr/
 span style=position:relative;left:43%;color:rgb(102, 102, 
 102);label class=checkbox 
 inline{{=form1.custom.widget.Category[5]}}/label/span
 span style=position:relative;left:51%;color:rgb(102, 102, 

[web2py] Re: Need more than one value to unpack

2014-01-07 Thread Akash Agrawall
on doing the change you mentioned a ticket comes up. 

Traceback (most recent call last):
  File /home/hornet632/webapps/joyofreading/web2py/gluon/restricted.py, line 
217, in restricted
exec ccode in environment
  File 
/home/hornet632/webapps/joyofreading/web2py/applications/AK_M14/models/db.py 
https://joyofreading.org/admin/default/edit/AK_M14/models/db.py, line 125, in 
module
db.Field('Category','string',requires=IS_CATEGORYIT()),
  File 
/home/hornet632/webapps/joyofreading/web2py/applications/AK_M14/models/db.py 
https://joyofreading.org/admin/default/edit/AK_M14/models/db.py, line 105, in 
__init__
self.error_message = error
NameError: global name 'error' is not defined



On Tuesday, January 7, 2014 3:21:09 AM UTC+5:30, Anthony wrote:

 Yes, please provide more detail.

 Also, requires=IS_CATEGORYIT should be requires=IS_CATEGORYIT().

 Anthony

 On Monday, January 6, 2014 3:41:35 PM UTC-5, Dave S wrote:

 On Monday, January 6, 2014 12:32:01 PM UTC-8, Akash Agrawall wrote:

 I am getting this error:
 Need more than one value to unpack


 Can you tell us which line the error message is referencing?  Is there a 
 traceback in the ticket?

 /dps


  

 *db.py:*
 class IS_CATEGORYIT(object):
 def __init__(self, error_message=Zip code not allowed):
 self.error_message = error
 def __call__(self, value):
 error = None
 print len(value)
 if len(value)==0:
 error = self.error_message
 return (value, error)
 db.define_table('book',
 db.Field('Name','string'),
 db.Field('Category','string',requires=IS_CATEGORYIT),
 db.Field('Quantity','integer'),
 db.Field('ISBN','string',unique=True),
 db.Field('Age_group','list:string', 
 requires=IS_IN_SET(['1-4','5-8','9-12','13-17'])),
 
 db.Field('entry_date','date',default=datetime.date.today(),requires=IS_DATE(format=('%d-%m-%Y'))),
 db.Field('Description','text'),
 db.Field('Image','upload',uploadfield='picture_file'),
 db.Field('picture_file','blob'),
 db.Field('Available','integer'),
 db.Field('Author','string'),
 db.Field('Link','string',requires=IS_EMPTY_OR(IS_URL(

 db.book.Description.widget= lambda field,value: 
 SQLFORM.widgets.text.widget(field,value,_style='width:400px',_rows=5)
 db.book.Category.requires=IS_IN_SET(['ficton','non-fiction','action and 
 adventure','travel','biography','story'],multiple=True,zero=None),IS_NOT_EMPTY(error_message=cannot
  
 be empty)
 db.book.Category.widget= lambda field,value: 
 SQLFORM.widgets.checkboxes.widget(field,value)

 *controller: default.py*
 def add_book():
 form1=SQLFORM(db.book)
 form1.add_button('Cancel', URL('add_book'))
 if form1.accepts(request.vars,session):
 response.flash=Book Inserted
 elif form1.errors:
 response.flash=Errors in form
 return dict(form1=form1)

 *view:add_book.html*
 {{=form1.custom.begin}}
 table
 trtd  style=width:51%Namenbsp;span 
 style=color:red;*/span:/tdtd {{=form1.custom.widget.Name
 }}/td/tr
 trtd Quantitynbsp;span style=color:red;*/span:/tdtd 
 {{=form1.custom.widget.Quantity}}/td/tr
 trtd  style=width:51%Availablenbsp;span 
 style=color:red;*/span:/tdtd 
 {{=form1.custom.widget.Available}}/td/tr
 trtd  style=width:51%ISBNnbsp;span style=color:red;*/span: 
 /tdtd{{=form1.custom.widget.ISBN}}/td/tr
 trtd  style=width:51%Entry Datenbsp;span 
 style=color:red;*/span: 
 /tdtd{{=form1.custom.widget.entry_date}}/td/tr
 /table
 nbsp;
 span style=color:#66; Category/spanspan 
 style=color:red;*/span: nbsp;nbsp;
 br/
 span style=position:relative;left:43%;color:rgb(102, 102, 
 102);label class=checkbox 
 inline{{=form1.custom.widget.Category[0]}}/label/span
 span style=position:relative;left:50%;color:rgb(102, 102, 
 102);label class=checkbox 
 inline{{=form1.custom.widget.Category[1]}}/label/spanbr/
 span style=position:relative;left:43%;color:rgb(102, 102, 
 102);label class=checkbox 
 inline{{=form1.custom.widget.Category[3]}}/label/span
 span style=position:relative;left:50.5%;color:rgb(102, 102, 
 102);label class=checkbox 
 inline{{=form1.custom.widget.Category[4]}}/label/spanbr/
 span style=position:relative;left:43%;color:rgb(102, 102, 
 102);label class=checkbox 
 inline{{=form1.custom.widget.Category[5]}}/label/span
 span style=position:relative;left:51%;color:rgb(102, 102, 
 102);label class=checkbox 
 inline{{=form1.custom.widget.Category[2]}}/label/span
 /tr
  /tr
 table
 trtd style=width:45%Age Groupnbsp;span 
 style=color:red;*/span:/td 
 td{{=form1.custom.widget.Age_group}}/td/tr
 trtd style=width:45%Author:/tdtd 
 {{=form1.custom.widget.Author}}/td/tr
 trtd style=width:45%Amazon Link:/td 
 td{{=form1.custom.widget.Link}}/td/tr
 trtd style=width:45%Description:/tdtd 
 {{=form1.custom.widget.Description}}/td/tr
 trtd 

[web2py] Re: Need more than one value to unpack

2014-01-07 Thread Dave S
On Tuesday, January 7, 2014 10:11:27 AM UTC-8, Akash Agrawall wrote:



 On Tuesday, January 7, 2014 2:11:35 AM UTC+5:30, Dave S wrote:

 On Monday, January 6, 2014 12:32:01 PM UTC-8, Akash Agrawall wrote:

 I am getting this error:
 Need more than one value to unpack


 Can you tell us which line the error message is referencing?  Is there a 
 traceback in the ticket?

 [...]

  

   File /usr/local/lib/python2.7/sqlite3/dbapi2.py, line 66, in 
 convert_timestamp
 datepart, timepart = val.split( )
 ValueError: need more than 1 value to unpack

  


The following seem to be the two places where you are dealing with dates, 
and this is the sort of message that the Python date parser gives when your 
date string being parsed doesn't match the pattern it is parsing to.

 

  

 *db.py:*

  

 db.define_table('book',
 db.Field('Name','string'),
 db.Field('Category','string',requires=IS_CATEGORYIT),
 db.Field('Quantity','integer'),
 db.Field('ISBN','string',unique=True),
 db.Field('Age_group','list:string', 
 requires=IS_IN_SET(['1-4','5-8','9-12','13-17'])),
 
 db.Field('entry_date','date',default=datetime.date.today(),requires=IS_DATE(format=('%d-%m-%Y'))),

  

 *view:add_book.html*
 {{=form1.custom.begin}}
 table
 trtd  style=width:51%Namenbsp;span 
 style=color:red;*/span:/tdtd {{=form1.custom.widget.Name
 }}/td/tr
 trtd Quantitynbsp;span style=color:red;*/span:/tdtd 
 {{=form1.custom.widget.Quantity}}/td/tr
 trtd  style=width:51%Availablenbsp;span 
 style=color:red;*/span:/tdtd 
 {{=form1.custom.widget.Available}}/td/tr
 trtd  style=width:51%ISBNnbsp;span style=color:red;*/span: 
 /tdtd{{=form1.custom.widget.ISBN}}/td/tr
 trtd  style=width:51%Entry Datenbsp;span 
 style=color:red;*/span: 
 /tdtd{{=form1.custom.widget.entry_date}}/td/tr

  
 
 Good luck!

/dps

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Need more than one value to unpack

2014-01-07 Thread Anthony
There's a bug in your custom validator code -- should be:

 self.error_message = error_message


On Tuesday, January 7, 2014 1:12:51 PM UTC-5, Akash Agrawall wrote:

 on doing the change you mentioned a ticket comes up. 

 Traceback (most recent call last):
   File /home/hornet632/webapps/joyofreading/web2py/gluon/restricted.py, 
 line 217, in restricted
 exec ccode in environment
   File 
 /home/hornet632/webapps/joyofreading/web2py/applications/AK_M14/models/db.py
  https://joyofreading.org/admin/default/edit/AK_M14/models/db.py, line 125, 
 in module
 db.Field('Category','string',requires=IS_CATEGORYIT()),
   File 
 /home/hornet632/webapps/joyofreading/web2py/applications/AK_M14/models/db.py
  https://joyofreading.org/admin/default/edit/AK_M14/models/db.py, line 105, 
 in __init__
 self.error_message = error
 NameError: global name 'error' is not defined



 On Tuesday, January 7, 2014 3:21:09 AM UTC+5:30, Anthony wrote:

 Yes, please provide more detail.

 Also, requires=IS_CATEGORYIT should be requires=IS_CATEGORYIT().

 Anthony

 On Monday, January 6, 2014 3:41:35 PM UTC-5, Dave S wrote:

 On Monday, January 6, 2014 12:32:01 PM UTC-8, Akash Agrawall wrote:

 I am getting this error:
 Need more than one value to unpack


 Can you tell us which line the error message is referencing?  Is there a 
 traceback in the ticket?

 /dps


  

 *db.py:*
 class IS_CATEGORYIT(object):
 def __init__(self, error_message=Zip code not allowed):
 self.error_message = error
 def __call__(self, value):
 error = None
 print len(value)
 if len(value)==0:
 error = self.error_message
 return (value, error)
 db.define_table('book',
 db.Field('Name','string'),
 db.Field('Category','string',requires=IS_CATEGORYIT),
 db.Field('Quantity','integer'),
 db.Field('ISBN','string',unique=True),
 db.Field('Age_group','list:string', 
 requires=IS_IN_SET(['1-4','5-8','9-12','13-17'])),
 
 db.Field('entry_date','date',default=datetime.date.today(),requires=IS_DATE(format=('%d-%m-%Y'))),
 db.Field('Description','text'),
 db.Field('Image','upload',uploadfield='picture_file'),
 db.Field('picture_file','blob'),
 db.Field('Available','integer'),
 db.Field('Author','string'),
 
 db.Field('Link','string',requires=IS_EMPTY_OR(IS_URL(

 db.book.Description.widget= lambda field,value: 
 SQLFORM.widgets.text.widget(field,value,_style='width:400px',_rows=5)
 db.book.Category.requires=IS_IN_SET(['ficton','non-fiction','action and 
 adventure','travel','biography','story'],multiple=True,zero=None),IS_NOT_EMPTY(error_message=cannot
  
 be empty)
 db.book.Category.widget= lambda field,value: 
 SQLFORM.widgets.checkboxes.widget(field,value)

 *controller: default.py*
 def add_book():
 form1=SQLFORM(db.book)
 form1.add_button('Cancel', URL('add_book'))
 if form1.accepts(request.vars,session):
 response.flash=Book Inserted
 elif form1.errors:
 response.flash=Errors in form
 return dict(form1=form1)

 *view:add_book.html*
 {{=form1.custom.begin}}
 table
 trtd  style=width:51%Namenbsp;span 
 style=color:red;*/span:/tdtd {{=form1.custom.widget.Name
 }}/td/tr
 trtd Quantitynbsp;span style=color:red;*/span:/tdtd 
 {{=form1.custom.widget.Quantity}}/td/tr
 trtd  style=width:51%Availablenbsp;span 
 style=color:red;*/span:/tdtd 
 {{=form1.custom.widget.Available}}/td/tr
 trtd  style=width:51%ISBNnbsp;span style=color:red;*/span: 
 /tdtd{{=form1.custom.widget.ISBN}}/td/tr
 trtd  style=width:51%Entry Datenbsp;span 
 style=color:red;*/span: 
 /tdtd{{=form1.custom.widget.entry_date}}/td/tr
 /table
 nbsp;
 span style=color:#66; Category/spanspan 
 style=color:red;*/span: nbsp;nbsp;
 br/
 span style=position:relative;left:43%;color:rgb(102, 102, 
 102);label class=checkbox 
 inline{{=form1.custom.widget.Category[0]}}/label/span
 span style=position:relative;left:50%;color:rgb(102, 102, 
 102);label class=checkbox 
 inline{{=form1.custom.widget.Category[1]}}/label/spanbr/
 span style=position:relative;left:43%;color:rgb(102, 102, 
 102);label class=checkbox 
 inline{{=form1.custom.widget.Category[3]}}/label/span
 span style=position:relative;left:50.5%;color:rgb(102, 102, 
 102);label class=checkbox 
 inline{{=form1.custom.widget.Category[4]}}/label/spanbr/
 span style=position:relative;left:43%;color:rgb(102, 102, 
 102);label class=checkbox 
 inline{{=form1.custom.widget.Category[5]}}/label/span
 span style=position:relative;left:51%;color:rgb(102, 102, 
 102);label class=checkbox 
 inline{{=form1.custom.widget.Category[2]}}/label/span
 /tr
  /tr
 table
 trtd style=width:45%Age Groupnbsp;span 
 style=color:red;*/span:/td 
 td{{=form1.custom.widget.Age_group}}/td/tr
 trtd style=width:45%Author:/tdtd 
 

[web2py] Re: Need more than one value to unpack

2014-01-07 Thread Anthony
This error comes from appadmin. Exactly what were you doing in appadmin to 
generate this error (what URL was requested)?

Anthony

On Tuesday, January 7, 2014 1:10:45 PM UTC-5, Akash Agrawall wrote:

  Traceback (most recent call last):
   File 
 /home/hornet632/webapps/joyofreading/web2py/applications/AK_M14/controllers/appadmin.py,
  line 243, in select
 limitby=(start, stop))
   File /home/hornet632/webapps/joyofreading/web2py/gluon/dal.py, line 
 10335, in select
 return adapter.select(self.query,fields,attributes)
   File /home/hornet632/webapps/joyofreading/web2py/gluon/dal.py, line 2388, 
 in select
 return super(SQLiteAdapter, self).select(query, fields, attributes)
   File /home/hornet632/webapps/joyofreading/web2py/gluon/dal.py, line 1831, 
 in select
 return self._select_aux(sql,fields,attributes)
   File /home/hornet632/webapps/joyofreading/web2py/gluon/dal.py, line 1796, 
 in _select_aux
 self.execute(sql)
   File /home/hornet632/webapps/joyofreading/web2py/gluon/dal.py, line 1916, 
 in execute
 return self.log_execute(*a, **b)
   File /home/hornet632/webapps/joyofreading/web2py/gluon/dal.py, line 1910, 
 in log_execute
 ret = self.cursor.execute(command, *a[1:], **b)
   File /usr/local/lib/python2.7/sqlite3/dbapi2.py, line 66, in 
 convert_timestamp
 datepart, timepart = val.split( )
 ValueError: need more than 1 value to unpack



 On Tuesday, January 7, 2014 2:11:35 AM UTC+5:30, Dave S wrote:

 On Monday, January 6, 2014 12:32:01 PM UTC-8, Akash Agrawall wrote:

 I am getting this error:
 Need more than one value to unpack


 Can you tell us which line the error message is referencing?  Is there a 
 traceback in the ticket?

 /dps


  

 *db.py:*
 class IS_CATEGORYIT(object):
 def __init__(self, error_message=Zip code not allowed):
 self.error_message = error
 def __call__(self, value):
 error = None
 print len(value)
 if len(value)==0:
 error = self.error_message
 return (value, error)
 db.define_table('book',
 db.Field('Name','string'),
 db.Field('Category','string',requires=IS_CATEGORYIT),
 db.Field('Quantity','integer'),
 db.Field('ISBN','string',unique=True),
 db.Field('Age_group','list:string', 
 requires=IS_IN_SET(['1-4','5-8','9-12','13-17'])),
 
 db.Field('entry_date','date',default=datetime.date.today(),requires=IS_DATE(format=('%d-%m-%Y'))),
 db.Field('Description','text'),
 db.Field('Image','upload',uploadfield='picture_file'),
 db.Field('picture_file','blob'),
 db.Field('Available','integer'),
 db.Field('Author','string'),
 db.Field('Link','string',requires=IS_EMPTY_OR(IS_URL(

 db.book.Description.widget= lambda field,value: 
 SQLFORM.widgets.text.widget(field,value,_style='width:400px',_rows=5)
 db.book.Category.requires=IS_IN_SET(['ficton','non-fiction','action and 
 adventure','travel','biography','story'],multiple=True,zero=None),IS_NOT_EMPTY(error_message=cannot
  
 be empty)
 db.book.Category.widget= lambda field,value: 
 SQLFORM.widgets.checkboxes.widget(field,value)

 *controller: default.py*
 def add_book():
 form1=SQLFORM(db.book)
 form1.add_button('Cancel', URL('add_book'))
 if form1.accepts(request.vars,session):
 response.flash=Book Inserted
 elif form1.errors:
 response.flash=Errors in form
 return dict(form1=form1)

 *view:add_book.html*
 {{=form1.custom.begin}}
 table
 trtd  style=width:51%Namenbsp;span 
 style=color:red;*/span:/tdtd {{=form1.custom.widget.Name
 }}/td/tr
 trtd Quantitynbsp;span style=color:red;*/span:/tdtd 
 {{=form1.custom.widget.Quantity}}/td/tr
 trtd  style=width:51%Availablenbsp;span 
 style=color:red;*/span:/tdtd 
 {{=form1.custom.widget.Available}}/td/tr
 trtd  style=width:51%ISBNnbsp;span style=color:red;*/span: 
 /tdtd{{=form1.custom.widget.ISBN}}/td/tr
 trtd  style=width:51%Entry Datenbsp;span 
 style=color:red;*/span: 
 /tdtd{{=form1.custom.widget.entry_date}}/td/tr
 /table
 nbsp;
 span style=color:#66; Category/spanspan 
 style=color:red;*/span: nbsp;nbsp;
 br/
 span style=position:relative;left:43%;color:rgb(102, 102, 
 102);label class=checkbox 
 inline{{=form1.custom.widget.Category[0]}}/label/span
 span style=position:relative;left:50%;color:rgb(102, 102, 
 102);label class=checkbox 
 inline{{=form1.custom.widget.Category[1]}}/label/spanbr/
 span style=position:relative;left:43%;color:rgb(102, 102, 
 102);label class=checkbox 
 inline{{=form1.custom.widget.Category[3]}}/label/span
 span style=position:relative;left:50.5%;color:rgb(102, 102, 
 102);label class=checkbox 
 inline{{=form1.custom.widget.Category[4]}}/label/spanbr/
 span style=position:relative;left:43%;color:rgb(102, 102, 
 102);label class=checkbox 
 inline{{=form1.custom.widget.Category[5]}}/label/span
 

[web2py] Re: Need more than one value to unpack

2014-01-06 Thread Dave S
On Monday, January 6, 2014 12:32:01 PM UTC-8, Akash Agrawall wrote:

 I am getting this error:
 Need more than one value to unpack


Can you tell us which line the error message is referencing?  Is there a 
traceback in the ticket?

/dps


 

 *db.py:*
 class IS_CATEGORYIT(object):
 def __init__(self, error_message=Zip code not allowed):
 self.error_message = error
 def __call__(self, value):
 error = None
 print len(value)
 if len(value)==0:
 error = self.error_message
 return (value, error)
 db.define_table('book',
 db.Field('Name','string'),
 db.Field('Category','string',requires=IS_CATEGORYIT),
 db.Field('Quantity','integer'),
 db.Field('ISBN','string',unique=True),
 db.Field('Age_group','list:string', 
 requires=IS_IN_SET(['1-4','5-8','9-12','13-17'])),
 
 db.Field('entry_date','date',default=datetime.date.today(),requires=IS_DATE(format=('%d-%m-%Y'))),
 db.Field('Description','text'),
 db.Field('Image','upload',uploadfield='picture_file'),
 db.Field('picture_file','blob'),
 db.Field('Available','integer'),
 db.Field('Author','string'),
 db.Field('Link','string',requires=IS_EMPTY_OR(IS_URL(

 db.book.Description.widget= lambda field,value: 
 SQLFORM.widgets.text.widget(field,value,_style='width:400px',_rows=5)
 db.book.Category.requires=IS_IN_SET(['ficton','non-fiction','action and 
 adventure','travel','biography','story'],multiple=True,zero=None),IS_NOT_EMPTY(error_message=cannot
  
 be empty)
 db.book.Category.widget= lambda field,value: 
 SQLFORM.widgets.checkboxes.widget(field,value)

 *controller: default.py*
 def add_book():
 form1=SQLFORM(db.book)
 form1.add_button('Cancel', URL('add_book'))
 if form1.accepts(request.vars,session):
 response.flash=Book Inserted
 elif form1.errors:
 response.flash=Errors in form
 return dict(form1=form1)

 *view:add_book.html*
 {{=form1.custom.begin}}
 table
 trtd  style=width:51%Namenbsp;span 
 style=color:red;*/span:/tdtd {{=form1.custom.widget.Name
 }}/td/tr
 trtd Quantitynbsp;span style=color:red;*/span:/tdtd 
 {{=form1.custom.widget.Quantity}}/td/tr
 trtd  style=width:51%Availablenbsp;span 
 style=color:red;*/span:/tdtd 
 {{=form1.custom.widget.Available}}/td/tr
 trtd  style=width:51%ISBNnbsp;span style=color:red;*/span: 
 /tdtd{{=form1.custom.widget.ISBN}}/td/tr
 trtd  style=width:51%Entry Datenbsp;span 
 style=color:red;*/span: 
 /tdtd{{=form1.custom.widget.entry_date}}/td/tr
 /table
 nbsp;
 span style=color:#66; Category/spanspan 
 style=color:red;*/span: nbsp;nbsp;
 br/
 span style=position:relative;left:43%;color:rgb(102, 102, 102);label 
 class=checkbox inline{{=form1.custom.widget.Category[0]}}/label/span
 span style=position:relative;left:50%;color:rgb(102, 102, 102);label 
 class=checkbox 
 inline{{=form1.custom.widget.Category[1]}}/label/spanbr/
 span style=position:relative;left:43%;color:rgb(102, 102, 102);label 
 class=checkbox inline{{=form1.custom.widget.Category[3]}}/label/span
 span style=position:relative;left:50.5%;color:rgb(102, 102, 
 102);label class=checkbox 
 inline{{=form1.custom.widget.Category[4]}}/label/spanbr/
 span style=position:relative;left:43%;color:rgb(102, 102, 102);label 
 class=checkbox inline{{=form1.custom.widget.Category[5]}}/label/span
 span style=position:relative;left:51%;color:rgb(102, 102, 102);label 
 class=checkbox inline{{=form1.custom.widget.Category[2]}}/label/span
 /tr
  /tr
 table
 trtd style=width:45%Age Groupnbsp;span 
 style=color:red;*/span:/td 
 td{{=form1.custom.widget.Age_group}}/td/tr
 trtd style=width:45%Author:/tdtd 
 {{=form1.custom.widget.Author}}/td/tr
 trtd style=width:45%Amazon Link:/td 
 td{{=form1.custom.widget.Link}}/td/tr
 trtd style=width:45%Description:/tdtd 
 {{=form1.custom.widget.Description}}/td/tr
 trtd style=width:45%Image:/tdtd 
 {{=form1.custom.widget.Image}}/td/tr
 trtd 
 style=width:45%/tdtd{{=form1.custom.submit}}nbsp;nbsp;nbsp;{{=form1[0][11][1][1]}}/td/tr
 /table
 {{=form1.custom.end}}

 Please hava look at this. need reply to this. ASAP. thanx in 
 advance



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Need more than one value to unpack

2014-01-06 Thread Anthony
Yes, please provide more detail.

Also, requires=IS_CATEGORYIT should be requires=IS_CATEGORYIT().

Anthony

On Monday, January 6, 2014 3:41:35 PM UTC-5, Dave S wrote:

 On Monday, January 6, 2014 12:32:01 PM UTC-8, Akash Agrawall wrote:

 I am getting this error:
 Need more than one value to unpack


 Can you tell us which line the error message is referencing?  Is there a 
 traceback in the ticket?

 /dps


  

 *db.py:*
 class IS_CATEGORYIT(object):
 def __init__(self, error_message=Zip code not allowed):
 self.error_message = error
 def __call__(self, value):
 error = None
 print len(value)
 if len(value)==0:
 error = self.error_message
 return (value, error)
 db.define_table('book',
 db.Field('Name','string'),
 db.Field('Category','string',requires=IS_CATEGORYIT),
 db.Field('Quantity','integer'),
 db.Field('ISBN','string',unique=True),
 db.Field('Age_group','list:string', 
 requires=IS_IN_SET(['1-4','5-8','9-12','13-17'])),
 
 db.Field('entry_date','date',default=datetime.date.today(),requires=IS_DATE(format=('%d-%m-%Y'))),
 db.Field('Description','text'),
 db.Field('Image','upload',uploadfield='picture_file'),
 db.Field('picture_file','blob'),
 db.Field('Available','integer'),
 db.Field('Author','string'),
 db.Field('Link','string',requires=IS_EMPTY_OR(IS_URL(

 db.book.Description.widget= lambda field,value: 
 SQLFORM.widgets.text.widget(field,value,_style='width:400px',_rows=5)
 db.book.Category.requires=IS_IN_SET(['ficton','non-fiction','action and 
 adventure','travel','biography','story'],multiple=True,zero=None),IS_NOT_EMPTY(error_message=cannot
  
 be empty)
 db.book.Category.widget= lambda field,value: 
 SQLFORM.widgets.checkboxes.widget(field,value)

 *controller: default.py*
 def add_book():
 form1=SQLFORM(db.book)
 form1.add_button('Cancel', URL('add_book'))
 if form1.accepts(request.vars,session):
 response.flash=Book Inserted
 elif form1.errors:
 response.flash=Errors in form
 return dict(form1=form1)

 *view:add_book.html*
 {{=form1.custom.begin}}
 table
 trtd  style=width:51%Namenbsp;span 
 style=color:red;*/span:/tdtd {{=form1.custom.widget.Name
 }}/td/tr
 trtd Quantitynbsp;span style=color:red;*/span:/tdtd 
 {{=form1.custom.widget.Quantity}}/td/tr
 trtd  style=width:51%Availablenbsp;span 
 style=color:red;*/span:/tdtd 
 {{=form1.custom.widget.Available}}/td/tr
 trtd  style=width:51%ISBNnbsp;span style=color:red;*/span: 
 /tdtd{{=form1.custom.widget.ISBN}}/td/tr
 trtd  style=width:51%Entry Datenbsp;span 
 style=color:red;*/span: 
 /tdtd{{=form1.custom.widget.entry_date}}/td/tr
 /table
 nbsp;
 span style=color:#66; Category/spanspan 
 style=color:red;*/span: nbsp;nbsp;
 br/
 span style=position:relative;left:43%;color:rgb(102, 102, 102);label 
 class=checkbox inline{{=form1.custom.widget.Category[0]}}/label/span
 span style=position:relative;left:50%;color:rgb(102, 102, 102);label 
 class=checkbox 
 inline{{=form1.custom.widget.Category[1]}}/label/spanbr/
 span style=position:relative;left:43%;color:rgb(102, 102, 102);label 
 class=checkbox inline{{=form1.custom.widget.Category[3]}}/label/span
 span style=position:relative;left:50.5%;color:rgb(102, 102, 
 102);label class=checkbox 
 inline{{=form1.custom.widget.Category[4]}}/label/spanbr/
 span style=position:relative;left:43%;color:rgb(102, 102, 102);label 
 class=checkbox inline{{=form1.custom.widget.Category[5]}}/label/span
 span style=position:relative;left:51%;color:rgb(102, 102, 102);label 
 class=checkbox inline{{=form1.custom.widget.Category[2]}}/label/span
 /tr
  /tr
 table
 trtd style=width:45%Age Groupnbsp;span 
 style=color:red;*/span:/td 
 td{{=form1.custom.widget.Age_group}}/td/tr
 trtd style=width:45%Author:/tdtd 
 {{=form1.custom.widget.Author}}/td/tr
 trtd style=width:45%Amazon Link:/td 
 td{{=form1.custom.widget.Link}}/td/tr
 trtd style=width:45%Description:/tdtd 
 {{=form1.custom.widget.Description}}/td/tr
 trtd style=width:45%Image:/tdtd 
 {{=form1.custom.widget.Image}}/td/tr
 trtd 
 style=width:45%/tdtd{{=form1.custom.submit}}nbsp;nbsp;nbsp;{{=form1[0][11][1][1]}}/td/tr
 /table
 {{=form1.custom.end}}

 Please hava look at this. need reply to this. ASAP. thanx in 
 advance



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.