Re: [web2py] Re: Some trouble with the oracle driver

2014-12-21 Thread Manuele Pesenti
Il 21/12/14 08:00, Paolo Valleri ha scritto:
 My guest is the alias name 'group', have you already tried with a
 different name?
uhm no... but I solved adding later on the needed values :) with
something like:

for row in mres:
row['table'] = 'municipio'
row['group'] = 'Municipio'

removing the expressions from the select.

thank you

Manuele

 Paolo

-- 
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/d/optout.


[web2py] Other trouble with the oracle driver

2014-12-21 Thread Manuele Pesenti
performing this query I get the subsequent traceback error:

In [24]: res = ora(multe_join).select(limitby=(0,5))
---
DatabaseError Traceback (most recent call last)
/home/manuele/web2py.trunk/applications/theseus2/models/dashboard/dashboard.py
in module()
 1 res = ora(multe_join).select(limitby=(0,5))

/home/manuele/web2py.trunk/gluon/dal/objects.pyc in select(self,
*fields, **attributes)
   2062 attributes.get('groupby',None))
   2063 fields = adapter.expand_all(fields, tablenames)
- 2064 return adapter.select(self.query,fields,attributes)
   2065
   2066 def nested_select(self,*fields,**attributes):

/home/manuele/web2py.trunk/gluon/dal/adapters/base.pyc in select(self,
query, fields, attributes)
   1229 time_expire)
   1230 else:
- 1231 return self._select_aux(sql,fields,attributes)
   1232
   1233 def _count(self, query, distinct=None):

/home/manuele/web2py.trunk/gluon/dal/adapters/base.pyc in
_select_aux(self, sql, fields, attributes)
   1194 cache = args_get('cache',None)
   1195 if not cache:
- 1196 self.execute(sql)
   1197 rows = self._fetchall()
   1198 else:

/home/manuele/web2py.trunk/gluon/dal/adapters/oracle.pyc in
execute(self, command, args)
134 if command[-1:]==';':
135 command = command[:-1]
-- 136 return self.log_execute(command, args)
137
138 def create_sequence_and_triggers(self, query, table, **args):

/home/manuele/web2py.trunk/gluon/dal/adapters/base.pyc in
log_execute(self, *a, **b)
   1310 self.db._lastsql = command
   1311 t0 = time.time()
- 1312 ret = self.cursor.execute(command, *a[1:], **b)
   1313 self.db._timings.append((command,time.time()-t0))
   1314 del self.db._timings[:-TIMINGSSIZE]

DatabaseError: ORA-00918: column ambiguously defined

the raw query written from the driver looks like this:

In [26]: ora(multe_join)._select(limitby=(0,5))
Out[26]: 'SELECT  quartiere.id, quartiere.cod, quartiere.odonimo,
municipio.id, municipio.cod, municipio.roman_cod, municipio.odonimo,
strada.id, strada.cod, strada.odonimo, strada.quartiere,
strada.municipio, multe.id, multe.NUMERO_REGISTRAZIONE,
multe.NUMERO_AVVISO, multe.TIPO, multe.DATA_ACCERTAMENTO,
multe.MATRICOLA, multe.MATRICOLA_2, multe.CODICE_VIA, multe.TIPOST1,
multe.CODICE_VIA2, multe.NUMERO_CIVICO, multe.TARGA,
multe.IMPORTO_TOTALE, multe.SEZIONE, multe.NUMERO_PATENTE,
multe.TIPO_DOCUMENTO, multe.DATA_PATENTE, multe.CATEGORIA_PATENTE,
multe.RILASCIATA_DA, multe.NOME, multe.COGNOME, multe.DATA_NASCITA,
multe.LUOGO_NASCITA, multe.PROV_NASCITA, multe.LUOGO_RESIDENZA,
multe.PROV_RESIDENZA, multe.CAP_RESIDENZA, multe.INDIRIZZO_RESIDENZA,
multe.NUMERO_CIVICO_RESIDENZA, multe.SOCIETA_O_PERSONA,
multe.CODICE_FISCALE_PI, multe.NOTE, multe.SESSO, multe.ARTICOLO,
multe.COMMA, multe.DESCRIZIONE_VIOLAZIONE FROM (SELECT w_tmp.*, ROWNUM
w_row FROM (SELECT quartiere.id, quartiere.cod, quartiere.odonimo,
municipio.id, municipio.cod, municipio.roman_cod, municipio.odonimo,
strada.id, strada.cod, strada.odonimo, strada.quartiere,
strada.municipio, multe.id, multe.NUMERO_REGISTRAZIONE,
multe.NUMERO_AVVISO, multe.TIPO, multe.DATA_ACCERTAMENTO,
multe.MATRICOLA, multe.MATRICOLA_2, multe.CODICE_VIA, multe.TIPOST1,
multe.CODICE_VIA2, multe.NUMERO_CIVICO, multe.TARGA,
multe.IMPORTO_TOTALE, multe.SEZIONE, multe.NUMERO_PATENTE,
multe.TIPO_DOCUMENTO, multe.DATA_PATENTE, multe.CATEGORIA_PATENTE,
multe.RILASCIATA_DA, multe.NOME, multe.COGNOME, multe.DATA_NASCITA,
multe.LUOGO_NASCITA, multe.PROV_NASCITA, multe.LUOGO_RESIDENZA,
multe.PROV_RESIDENZA, multe.CAP_RESIDENZA, multe.INDIRIZZO_RESIDENZA,
multe.NUMERO_CIVICO_RESIDENZA, multe.SOCIETA_O_PERSONA,
multe.CODICE_FISCALE_PI, multe.NOTE, multe.SESSO, multe.ARTICOLO,
multe.COMMA, multe.DESCRIZIONE_VIOLAZIONE FROM quartiere, municipio,
strada, multe WHERE (((strada.cod = multe.CODICE_VIA) AND
(strada.quartiere = quartiere.id)) AND (strada.municipio =
municipio.id)) ORDER BY quartiere.id, municipio.id, strada.id, multe.id)
w_tmp WHERE ROWNUM=5) quartiere, municipio, strada, multe  WHERE
(((strada.cod = multe.CODICE_VIA) AND (strada.quartiere = quartiere.id))
AND (strada.municipio = municipio.id)) AND w_row  0  ORDER BY
quartiere.id, municipio.id, strada.id, multe.id;'

the problem seams in the limitby attributes because without it no error
is raised...

In [28]: ora(multe_join).select()
Out[28]: Rows (42547)

here you can see the raw query again without the limitby:

In [27]: ora(multe_join)._select()
Out[27]: 'SELECT  quartiere.id, quartiere.cod, quartiere.odonimo,
municipio.id, municipio.cod, municipio.roman_cod, municipio.odonimo,
strada.id, strada.cod, strada.odonimo, strada.quartiere,
strada.municipio, multe.id, multe.NUMERO_REGISTRAZIONE,
multe.NUMERO_AVVISO, 

[web2py] Re: new feature in trunk: TODO panel in admin editor

2014-12-21 Thread LightDot
Didn't have time to take look yet, but If I understand correctly, just make 
a comment in any .py file, starting with TODO and it will show in the panel.

This is similar to e.g. Sublime text's SublimeTODO plugin and others... I 
suggest looking at those for ideas, e.g. SublimeTODO shows comments 
starting with TODO:, NOTE:, FIXME:, CHANGED:.

I use the first three, mostly.

Regards

On Saturday, December 20, 2014 10:08:36 PM UTC+1, LoveWeb2py wrote:

 How do we add to the TODO panel? I've tried double clicking and looking 
 for additional documentation but can't seem to find anything.

 On Sunday, December 8, 2013 4:36:00 AM UTC-5, Paolo Valleri wrote:

 Dear all,
 the online editor has got a new TODO panel in which are listed all TODO 
 you might have in the current application.
 For the time being it highlights only TODO in python files, in the short 
 future we will support other file types and special keywords, along with 
 the keyword TODO I've seen users using FIXME (please let me know the ones 
 you use most). 

 It is still in a work in progress feature, given that please let me know 
 not only any issue you will find but also all extensions you foresee.

 Paolo



-- 
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/d/optout.


[web2py] Re: new feature in trunk: TODO panel in admin editor

2014-12-21 Thread LoveWeb2py
Wow!  Awesome.  Thank you

-- 
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/d/optout.


[web2py] Re: SQLFORM.factory with upload field - the operation is insecure

2014-12-21 Thread Cynthia Butler
Did you find an answer to this? Just curious. Thanks.

On Monday, December 15, 2014 8:42:00 AM UTC-7, Jim S wrote:

 I've got an issue that is really puzzling me.

 I have a form, SQLFORM.factory with one field, an upload field.

 When I click on submit to submit the form (adding a new record), I get a 
 javascript error that flashes by quickly in Firebug.  All I can get from it 
 is that the text says 'the operation is insecure'.

 Here is the controller code:

 @auth.requires_permission('select', db.helpdesk)
 def attachments():
 ticket_id = request.vars['ticketId']
 ticket = db.ticket(ticket_id)


 updateQuery = db.ticket_attachment.ticket==ticket_id


 form = SQLFORM.factory(Field('attachment_file', 'upload', required=
 True,
  uploadfolder='%s/tickets' % (connect_util
 .getFileLocation('uploads'))),
table_name='ticket_attachment', submit_button=
 'Add', formstyle=my_formstyle, ui=grid_ui,
formname='attachment_form', _id=
 'attachment_form')


 if form.process(formname='attachment_form').accepted:
 attachment = form.vars.attachment_file
 db.ticket_attachment.insert(ticket=ticket_id, attachment=
 attachment)


 ticket_notification(ticket_id, 'new tag added',
 'Tag %s added.' % (helpdesk_tag.tag),
 log_activity=True)
 else:
 print 'err'


 Here is the view

 script type=text/javascript
 function delete_attachment(ticket_attachment_id) {
 $.ajax({url: 
 {{=URL('ticket','delete_ticket_attachment',user_signature=True)}},
 data: {ticket_attachment_id:ticket_attachment_id }})
 .fail(function() {
 alert('There was a problem removing the attachment from this 
 ticket.  Please contact support.');
 })
 .success(function(msg) {
 location.reload();
 });
 }
 /script
 br /
 div class=col-sm-12 col-md-9 col-lg-6
 {{=form.custom.begin}}
 div class=col-sm-12 style=margin-bottom: 10px;
 {{=form.custom.widget.attachment_file}}
 {{=form.custom.submit}}
 /div
 {{=form.custom.end}}
 table class=table style=margin-left: 20px;
 {{for attachment in ticket_attachments:}}
 tr
 td
 {{=attachment.attachment}}
 /td
 {{if can_delete:}}
 td
 a href=javascript:void(0); onclick=
 delete_attachment({{=attachment.ticket_attachment.id}});i class=fa 
 fa-trash-o/i/a
 /td
 {{pass}}
 /tr
 {{pass}}
 /table
 /div


 Any ideas on what may be causing this or how to capture the javascript 
 error?

 -Jim





-- 
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/d/optout.


[web2py] Re: Australian Users

2014-12-21 Thread Tim Richardson
Hi Simon,
are you in Melbourne as well?
tim

On Thursday, December 18, 2014 4:18:29 PM UTC+11, Simon Ashley wrote:

 Where are you at? What do you need?



-- 
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/d/optout.


Re: [web2py] Re: SQLFORM.factory with upload field - the operation is insecure

2014-12-21 Thread Jim Steil
Yes.  The issue was that I had it in a loaded component.  That is not
supported and doesn't work.  And,  I know better,  I've ran into this
before and just forgot about that restriction this time.

Jim
 On Dec 21, 2014 12:18 PM, Cynthia Butler cindybutl...@gmail.com wrote:

 Did you find an answer to this? Just curious. Thanks.

 On Monday, December 15, 2014 8:42:00 AM UTC-7, Jim S wrote:

 I've got an issue that is really puzzling me.

 I have a form, SQLFORM.factory with one field, an upload field.

 When I click on submit to submit the form (adding a new record), I get a
 javascript error that flashes by quickly in Firebug.  All I can get from it
 is that the text says 'the operation is insecure'.

 Here is the controller code:

 @auth.requires_permission('select', db.helpdesk)
 def attachments():
 ticket_id = request.vars['ticketId']
 ticket = db.ticket(ticket_id)


 updateQuery = db.ticket_attachment.ticket==ticket_id


 form = SQLFORM.factory(Field('attachment_file', 'upload', required=
 True,
  uploadfolder='%s/tickets' % (
 connect_util.getFileLocation('uploads'))),
table_name='ticket_attachment', submit_button=
 'Add', formstyle=my_formstyle, ui=grid_ui,
formname='attachment_form', _id=
 'attachment_form')


 if form.process(formname='attachment_form').accepted:
 attachment = form.vars.attachment_file
 db.ticket_attachment.insert(ticket=ticket_id, attachment=
 attachment)


 ticket_notification(ticket_id, 'new tag added',
 'Tag %s added.' % (helpdesk_tag.tag),
 log_activity=True)
 else:
 print 'err'


 Here is the view

 script type=text/javascript
 function delete_attachment(ticket_attachment_id) {
 $.ajax({url: {{=URL('ticket','delete_ticket_attachment',user_
 signature=True)}},
 data: {ticket_attachment_id:ticket_attachment_id }})
 .fail(function() {
 alert('There was a problem removing the attachment from this
 ticket.  Please contact support.');
 })
 .success(function(msg) {
 location.reload();
 });
 }
 /script
 br /
 div class=col-sm-12 col-md-9 col-lg-6
 {{=form.custom.begin}}
 div class=col-sm-12 style=margin-bottom: 10px;
 {{=form.custom.widget.attachment_file}}
 {{=form.custom.submit}}
 /div
 {{=form.custom.end}}
 table class=table style=margin-left: 20px;
 {{for attachment in ticket_attachments:}}
 tr
 td
 {{=attachment.attachment}}
 /td
 {{if can_delete:}}
 td
 a href=javascript:void(0); onclick=
 delete_attachment({{=attachment.ticket_attachment.id}});i class=fa
 fa-trash-o/i/a
 /td
 {{pass}}
 /tr
 {{pass}}
 /table
 /div


 Any ideas on what may be causing this or how to capture the javascript
 error?

 -Jim



  --
 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 a topic in the
 Google Groups web2py-users group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/web2py/NGmfPpUVvds/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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/d/optout.


[web2py] pass query from client to sever

2014-12-21 Thread Massimo Di Pierro
We do not have a way to serialize queries in a server independent way but we 
should. 

-- 
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/d/optout.