[web2py] Re: Quick contract job

2013-08-04 Thread Dmitri Husti
Hi,
Success?
Your deadline is over, do you need someone else for web2py?
Im not a professional but most of the questions you posted I could answer 
:P.

Best regards
Dmitri Husti

Am Donnerstag, 1. August 2013 06:11:59 UTC+2 schrieb davedigerati:

 I have been learning web2py for a project and while I am really enjoying 
 it I am up against a deadline for my client and looking for help.

 I would like to hire someone (preferably one of the frequent contributors 
 as a way of saying thank you, this is a great community;) to take care of 
 one sticking point, which I suspect a knowledgable web2py'er could knock 
 out in an hour or two.  Deadline is noon E.S.T. this Saturday and I'll pay 
 for a working solution through paypal.

 If interested please contact hyprlyt at the usual big G's email domain and 
 I will explain in more detail.
 Thanks!
 Dave


-- 

--- 
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: How do I pass a query object to a different controller?

2013-07-18 Thread Dmitri Husti
Hi,
you can use a dialog widget from jquery ui to pop up the form.
Would be a nicer solution.

Best regards
Dmitri Husti

Am Donnerstag, 18. Juli 2013 10:50:27 UTC+2 schrieb Sarbjit singh:

 Now all the problems are solved, with problem remaining. Here is what I 
 did to solve the problem :

 In the view for search2, I added the code as :

 {{extend 'layout.html'}}
 h1This is the default/search2.html template/h1
 {{if results.update_form:}}
 {{=results}}
 {{elif results.view_form:}}
 {{=results}}
 {{else:}}
 {{=form}}
 {{pass}}

 Problem that is remaining is, when I click on Back button from the 
 Edit/View operation of grid, it took me back to search form, but I want to 
 see the search results. Can some one please help me on how to handle it?

 -Sarbjit

 On Thursday, July 18, 2013 12:36:25 PM UTC+5:30, Sarbjit singh wrote:

 Just to be clear on exception (crash) :

 On clicking search, pickle error is seen if the url is like :


 http://127.0.0.1:8000/sampleapp/default/search2/edit/customer/2?_signature=.
 ..

 If it is simple : (first time search which works) :

 http://127.0.0.1:8000/sampleapp/default/search2

 But no edit/view forms are seen on redirection from results view back 
 to search2.

 -Sarbjit





 On Thursday, July 18, 2013 9:18:18 AM UTC+5:30, Sarbjit singh wrote:

 Thanks guys for the help.

 I followed the approach as suggested by Massimo, so I did the following :

 @auth.requires_login()  
 def search2():
 form,results = dynamic_search(db.customer)
 if form.process().accepted:
 session.results = results
 redirect(URL('results'))
 return dict(form=form)

 @auth.requires_login() 
 def results():
 results = session.results
 return dict(results=results)

 Please note that the dynamic_search is returning grid and form, so I am 
 storing grid in the session.


 But I am still facing problems, not sure what wrong steps I am doing. 
 For the first time, when I click on search, desired results are opened in 
 controller results (in a new page). But when I click on edit/view of grid 
 operation, some how the page gets redirected to search page and on 
 subsequent search it crashes with the same problem (can't pickle ..). My 
 question is when i click on edit operations on a grid, why it is 
 redirecting to search. Isn't it is supposed to open edit form there itself?

 To me it looks like, since the grid was generated when the control was 
 in the search2, so the links of the grid operations are pointing to 
 search2 view though the results are now seen in different view results. 
 So when I click on any operation, it is redirected to search2 view - BUT 
 strangely contents of edit form are not seen (Not sure of the reason?). 

 Can some one please help me to resolve this issue ? Is there a way I can 
 recompute the grid links in results controller such that they do not 
 redirect to search2 view. Also what could be the check added to avoid 
 crash on subsequent search.

 Thanks
 Sarbjit




-- 

--- 
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: Web2py bootstrap modal with jquery datetimepicker not working after AJAX post

2013-07-18 Thread Dmitri Husti
Hi,
I had the same problem.
I've used this workaround.
_onclick=jQuery(this).datepicker();jQuery(this).datepicker('show');

Am Donnerstag, 18. Juli 2013 17:43:50 UTC+2 schrieb Remco K:

 Hi all,

 I have a SQLFORM inserted into a modal (requested as a LOAD file), which 
 includes a datetimepicker from Jquery. This is working well until i submit 
 my form and get a result back from my form validator. After clicking on the 
 datetime field again i don't see the datetimepicker anymore.

 I've already struggled with Jquery on(), but this doesn't seem to be the 
 answer. I'm a bit afraid that the web2py_ajax_page function is causing this 
 problem.

 Is there a way to get this to work? I think that the web2py solution of 
 its own datetimepicker work, but i want to use the Jquery plugin (or just 
 another jquery plugin in the future).

 I'm afraid that i can't be more specific about this problem, because i 
 can't debug a lot since i'm working from a modal. I just hope that someone 
 else here already dealt with this problem...

 Thanks in advance!
 Remco


-- 

--- 
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: How do I pass a query object to a different controller?

2013-07-17 Thread Dmitri Husti
HI,
you can pass results to the next page;
redirect(URL(test,vars=dict(results=results))

On the next page you can do 
return dict(results=request.vars[results])

Am Mittwoch, 17. Juli 2013 12:37:24 UTC+2 schrieb Sarbjit singh:

 Hi,

 I am trying to use dynamic search form from 
 http://www.web2pyslices.com/slice/show/1403/dynamic-search. Current 
 implementation shows both the form and results on the same page.

 I want to display the search results (using GRID) in a new page and wants 
 to use customized forms for edit/view operations associated with GRID.

 As of now, I tried handling it in the view to not to show form contents 
 once the form is accessed but some how it is not working on subsequent 
 operations.

 So, I am thinking to pass query to a new controller and can hence handle 
 the custom forms there. But I am not able to do so.

 So here is what I tried :

 @auth.requires_login()  
 def search2():
 form,query = dynamic_search(db.customer)
 if form.process().accepted:
 session.sqlquery = query
 redirect(URL('results'))
 return dict(form=form)

 @auth.requires_login() 
 def results():
 query = session.sqlquery
 print query
 results =  SQLFORM.grid(query,searchable=False,create=False,csv=False)
 results = None
 return dict(results=results)

 With this code, first error that is encountered is in session.sqlquery = 
 query - Can't pickle objects 

 So I modified it as 

 session.sqlquery = str(query)

 With this error appeared in query = session.sqlquery - str object has 
 no attribute _db

 Can some one please suggest what is the right way to achieve this?

 -Sarbjit



-- 

--- 
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: How do I pass a query object to a different controller?

2013-07-17 Thread Dmitri Husti
Hi,
Is it possible to pass the request vars and call the function 
dynamic_search twice?
redirect(URL(test,vars=request.vars))



Am Mittwoch, 17. Juli 2013 18:46:07 UTC+2 schrieb Massimo Di Pierro:

 You can store the results in session then.

 session.rows = db(...).select()

 Passing to much data in request.vars can be a problem. For example nginx 
 limits the size of the query string.




 On Wednesday, 17 July 2013 10:48:15 UTC-5, Dmitri Husti wrote:

 HI,
 you can pass results to the next page;
 redirect(URL(test,vars=dict(results=results))

 On the next page you can do 
 return dict(results=request.vars[results])

 Am Mittwoch, 17. Juli 2013 12:37:24 UTC+2 schrieb Sarbjit singh:

 Hi,

 I am trying to use dynamic search form from 
 http://www.web2pyslices.com/slice/show/1403/dynamic-search. Current 
 implementation shows both the form and results on the same page.

 I want to display the search results (using GRID) in a new page and 
 wants to use customized forms for edit/view operations associated with GRID.

 As of now, I tried handling it in the view to not to show form contents 
 once the form is accessed but some how it is not working on subsequent 
 operations.

 So, I am thinking to pass query to a new controller and can hence handle 
 the custom forms there. But I am not able to do so.

 So here is what I tried :

 @auth.requires_login()  
 def search2():
 form,query = dynamic_search(db.customer)
 if form.process().accepted:
 session.sqlquery = query
 redirect(URL('results'))
 return dict(form=form)

 @auth.requires_login() 
 def results():
 query = session.sqlquery
 print query
 results =  
 SQLFORM.grid(query,searchable=False,create=False,csv=False)
 results = None
 return dict(results=results)

 With this code, first error that is encountered is in session.sqlquery 
 = query - Can't pickle objects 

 So I modified it as 

 session.sqlquery = str(query)

 With this error appeared in query = session.sqlquery - str object has 
 no attribute _db

 Can some one please suggest what is the right way to achieve this?

 -Sarbjit



-- 

--- 
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: Component Login required via web2py the loginform doesnt render right

2013-07-10 Thread Dmitri Husti
Hi,
I've got it. I need to create a default/user.load with the same content 
like default/user.
A little bit redundant but OK.
My next Problem is Howto mark this thread as successful completed.

Am Dienstag, 9. Juli 2013 21:39:43 UTC+2 schrieb Dmitri Husti:

 Hi,
 I ve got a Component, with access required.
 Instead of the Component a msg apears with a login link.
 If I follow the login link the Loginform will not be rendered right.
 It's like its not extended by layout.html.
 What have I done wrong?
 The mentioned login link:

 http://127.0.0.1:8000/myapp/default/user.load/login?_next=http%3A//127.0.0.1%3A8000/myapp/occupants
 And it should be

 http://127.0.0.1:8000/myapp/default/user/login?_next=http%3A//127.0.0.1%3A8000/myapp/occupantshttp://127.0.0.1:8000/myapp/default/user.load/login?_next=http%3A//127.0.0.1%3A8000/myapp/occupants
 Also without load.
 How can I fix it?

 Best regards 
 Dmitri Husti


-- 

--- 
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] Component Login required via web2py the loginform doesnt render right

2013-07-09 Thread Dmitri Husti
Hi,
I ve got a Component, with access required.
Instead of the Component a msg apears with a login link.
If I follow the login link the Loginform will not be rendered right.
It's like its not extended by layout.html.
What is my failure?

Best regards 
Dmitri Husti

-- 

--- 
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: from sqlite to mysql with error

2013-07-09 Thread Dmitri Husti


Hi,

I guess the error is in this line.

db.validades.empresa.*requires=requires*=IS_IN_DB 
http://localhost/examples/global/vars/IS_IN_DB(db, 
'auth_user.id','auth_user.empresa',error_message=e_m['not_in_db'])


You are writing two times requires this cant be right.
best regards
Dmitri Husti

Am Montag, 8. Juli 2013 18:56:47 UTC+2 schrieb Ramos:

 hello i changed from sqlite to mysql and now i have an error

 class 'gluon.contrib.pymysql.err.ProgrammingError' (1064, uYou have an 
 error in your SQL syntax; check the manual that corresponds to your MySQL 
 server version for the right syntax to use near 'desc VARCHAR(512),\n 
 validade DATE,\n PRIMARY KEY(id)\n) ENGINE=InnoDB CHARAC' at line 4) 


 Traceback (most recent call last):
   File /home/ubuntu/web2py/gluon/restricted.py, line 212, in restricted


 exec ccode in environment
   File /home/ubuntu/web2py/applications/EMPRE/models/db.py 
 http://localhost/admin/default/edit/EMPRE/models/db.py, line 115, in 
 module


 Field('validade','date', required=True,label='Validade da informação 
 apresentada'))


   File /home/ubuntu/web2py/gluon/dal.py, line 7755, in define_table


 table = self.lazy_define_table(tablename,*fields,**args)


   File /home/ubuntu/web2py/gluon/dal.py, line 7792, in lazy_define_table


 polymodel=polymodel)
   File /home/ubuntu/web2py/gluon/dal.py, line 963, in create_table


 self.create_sequence_and_triggers(query,table)


   File /home/ubuntu/web2py/gluon/dal.py, line 1781, in 
 create_sequence_and_triggers


 self.execute(query)
   File /home/ubuntu/web2py/gluon/dal.py, line 1798, in execute


 return self.log_execute(*a, **b)


   File /home/ubuntu/web2py/gluon/dal.py, line 1792, in log_execute


 ret = self.cursor.execute(command, *a[1:], **b)


   File /home/ubuntu/web2py/gluon/contrib/pymysql/cursors.py, line 117, in 
 execute


 self.errorhandler(self, exc, value)


   File /home/ubuntu/web2py/gluon/contrib/pymysql/connections.py, line 202, 
 in defaulterrorhandler


 raise errorclass, errorvalue
 ProgrammingError: (1064, uYou have an error in your SQL syntax; check the 
 manual that corresponds to your MySQL server version for the right syntax to 
 use near 'desc VARCHAR(512),\nvalidade DATE,\nPRIMARY KEY(id)\n) 
 ENGINE=InnoDB CHARAC' at line 4)



 my model where i think is the problem is 

 db.define_table('validades',
 Field 
 http://localhost/examples/global/vars/Field('empresa',db.auth_user,unique=True),


 Field http://localhost/examples/global/vars/Field('desc',compute=lambda 
 row: db.auth_user[row.empresa]['empresa']),


 Field http://localhost/examples/global/vars/Field('validade','date', 
 required=True,label='Validade da informação apresentada'))

 # -requires
 db.validades.empresa.requires=requires=IS_IN_DB 
 http://localhost/examples/global/vars/IS_IN_DB(db, 
 'auth_user.id','auth_user.empresa',error_message=e_m['not_in_db'])

 db.validades.validade.requires=[IS_DATE(format=T('%Y/%m/%d'),error_message=T(Formato
  pretendido aaa/mm/dd))]


 *What is the problem?*




Am Montag, 8. Juli 2013 18:56:47 UTC+2 schrieb Ramos:

 hello i changed from sqlite to mysql and now i have an error

 class 'gluon.contrib.pymysql.err.ProgrammingError' (1064, uYou have an 
 error in your SQL syntax; check the manual that corresponds to your MySQL 
 server version for the right syntax to use near 'desc VARCHAR(512),\n 
 validade DATE,\n PRIMARY KEY(id)\n) ENGINE=InnoDB CHARAC' at line 4) 


 Traceback (most recent call last):
   File /home/ubuntu/web2py/gluon/restricted.py, line 212, in restricted


 exec ccode in environment
   File /home/ubuntu/web2py/applications/EMPRE/models/db.py 
 http://localhost/admin/default/edit/EMPRE/models/db.py, line 115, in 
 module


 Field('validade','date', required=True,label='Validade da informação 
 apresentada'))


   File /home/ubuntu/web2py/gluon/dal.py, line 7755, in define_table


 table = self.lazy_define_table(tablename,*fields,**args)


   File /home/ubuntu/web2py/gluon/dal.py, line 7792, in lazy_define_table


 polymodel=polymodel)
   File /home/ubuntu/web2py/gluon/dal.py, line 963, in create_table


 self.create_sequence_and_triggers(query,table)


   File /home/ubuntu/web2py/gluon/dal.py, line 1781, in 
 create_sequence_and_triggers


 self.execute(query)
   File /home/ubuntu/web2py/gluon/dal.py, line 1798, in execute


 return self.log_execute(*a, **b)


   File /home/ubuntu/web2py/gluon/dal.py, line 1792, in log_execute


 ret = self.cursor.execute(command, *a[1:], **b)


   File /home/ubuntu/web2py/gluon/contrib/pymysql/cursors.py, line 117, in 
 execute


 self.errorhandler(self, exc, value)


   File /home/ubuntu/web2py/gluon/contrib/pymysql/connections.py, line 202, 
 in defaulterrorhandler


 raise errorclass, errorvalue
 ProgrammingError: (1064, uYou have an error in your SQL syntax; check the 
 manual that corresponds to your MySQL server version for the right syntax

[web2py] form ajax

2013-07-04 Thread Dmitri Husti
Hi,
I cant figure out how to use FORMS with ajax.
Howto refresh the FORM in frontend if you dont pass the validation.
And howto renew the data in frontend if the validation was passed and a new 
row is in
the database.
The whole thing with ajax. A small example would be nice.

Best regards 
Dmitri Husti

-- 

--- 
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: form ajax

2013-07-04 Thread Dmitri Husti
Hi,
thanks Anthony that was it.

Am Donnerstag, 4. Juli 2013 13:55:45 UTC+2 schrieb Dmitri Husti:

 Hi,
 I cant figure out how to use FORMS with ajax.
 Howto refresh the FORM in frontend if you dont pass the validation.
 And howto renew the data in frontend if the validation was passed and a 
 new row is in
 the database.
 The whole thing with ajax. A small example would be nice.

 Best regards 
 Dmitri Husti


-- 

--- 
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] automigration with referenced table and a feature request

2013-06-23 Thread Dmitri Husti
Hi,
I've got the problem I cant change a attribute like notnull at a referenced 
column.
Is this a bug or a feature?
I also want to suggest a new feature.
It usually happens I'm forgetting to save.
Would it be possible to add a msg like in word.
You havent saved yet, do you want to save now.
When im changing the site.

-- 

--- 
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.