[web2py] admin panle with uwsgi

2013-05-20 Thread yashar
using ssh for connecting to admin panel is slow, if it was possible to use something like connecting to application folder for retrieving models/controller/view.. files and using local admin panel could boost the speed. my question: is this possible to use uwsgi and pass password to it? --

[web2py] Re: admin panle with uwsgi

2013-05-20 Thread yashar
to do exactly? Il giorno lunedì 20 maggio 2013 10:51:00 UTC+2, yashar ha scritto: using ssh for connecting to admin panel is slow, if it was possible to use something like connecting to application folder for retrieving models/controller/view.. files and using local admin panel could boost

[web2py] Re: admin panle with uwsgi

2013-05-20 Thread yashar
yes , if i want to run it from uwsgi. On Monday, May 20, 2013 2:44:53 PM UTC+4:30, Niphlod wrote: so the problem is that you can't reach the https://yourhost/appname/appadmin page ? Il giorno lunedì 20 maggio 2013 11:58:48 UTC+2, yashar ha scritto: thanks for the fast reply, yes

[web2py] Re: admin panle with uwsgi

2013-05-20 Thread yashar
lunedì 20 maggio 2013 12:31:31 UTC+2, yashar ha scritto: yes , if i want to run it from uwsgi. On Monday, May 20, 2013 2:44:53 PM UTC+4:30, Niphlod wrote: so the problem is that you can't reach the https://yourhost/appname/appadmin page ? Il giorno lunedì 20 maggio 2013 11:58:48 UTC+2, yashar

[web2py] change dal connection string user

2013-05-19 Thread yashar
hi, i want to change connection string user from postgres to another_user but it said relation auth_user already exist, i thought that i set fake_migrate = True to solve it but i'm not sure. any idea to how to solve it? -- --- You received this message because you are subscribed to the

[web2py] sqlform custom fails to hide errors

2013-04-25 Thread yashar
i set form.errors = dict() at the end of controller but i still get errors, is this a bug or i'm doing a wrong way? -- --- 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

[web2py] Re: sqlform custom fails to hide errors

2013-04-25 Thread yashar
, April 25, 2013 3:02:46 AM UTC-4, yashar wrote: i set form.errors = dict() at the end of controller but i still get errors, is this a bug or i'm doing a wrong way? -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from

[web2py] auth ajax - how about this way?

2013-04-01 Thread yashar
is this true that SQLFORMs redirected to _next value when SQLFORM is accepted? so i did this: def lost_password(): from gluon.serializers import json try: form = auth.retrieve_password() except: ### i assume that form redirected only if email send to user return

[web2py] Re: signed url

2013-03-30 Thread yashar
manually change the query string part of the URL and still have the request verified). See http://web2py.com/books/default/chapter/29/04#Digitally-signed-urls for more details. Anthony On Wednesday, March 27, 2013 6:55:21 AM UTC-4, yashar wrote: here is the link : script

[web2py] signed url

2013-03-27 Thread yashar
here is the link : script window.location.href = '{{=URL('CS','close_inqueries',user_signature=True)}}' + '' + data; /script and here is the controler: def close_inqueries(): print request.vars print '-'*20 print session and here is the result: Storage {'_signature':

[web2py] signed url

2013-03-27 Thread yashar
here is the link : script window.location.href = '{{=URL('CS','close_inqueries',user_signature=True)}}' + '' + data; /script and here is the controler: def close_inqueries(): print request.vars print '-'*20 print session and here is the result: Storage {'_signature':

[web2py] Re: postgres error

2013-03-22 Thread yashar
thank you, very helpful. On Thursday, March 21, 2013 11:57:40 PM UTC+3:30, Niphlod wrote: just to clear out doubts. a field 'reference sometable' gets: - a foreign key to the id of sometable - a validator that by default builds up on the format argument of sometable you CAN'T have

[web2py] postgres error

2013-03-21 Thread yashar
db.define_table('countries', Field('country_name') ) db.define_table('testing', Field('origin','reference countries',requires=IS_IN_DB(db,'countries.country_name',error_message='Choose origin country')) ) when i try to input testing from database administration, i get this

[web2py] Re: postgres error

2013-03-21 Thread yashar
the form is created by the admin app, no validation error, just i get this error for any insert with relation. i dont understand. On Thursday, March 21, 2013 10:06:54 PM UTC+3:30, Alan Etkin wrote: class 'psycopg2.IntegrityError' insert or update on table testing violates foreign key

[web2py] Re: postgres error

2013-03-21 Thread yashar
there is no string validator, i just use IS_IN_DB to create drop down widget On Thursday, March 21, 2013 10:26:38 PM UTC+3:30, Alan Etkin wrote: the form is created by the admin app, no validation error, just i get this error for any insert with relation. Wait, your model has something odd

[web2py] Re: login by ajax

2013-03-01 Thread yashar
, yashar wrote: def ajax_login_bare(self, username, password): check user login and return tuple of (boolean,msg) which first field is successfull login or not and second is failure massage request = current.request session = current.session

[web2py] Re: login by ajax

2013-02-27 Thread yashar
def ajax_login_bare(self, username, password): check user login and return tuple of (boolean,msg) which first field is successfull login or not and second is failure massage request = current.request session = current.session table_user =

[web2py] Re: login by ajax

2013-02-20 Thread yashar
this is what i added in tools.py inside auth class, this is just modification of login() function and difference from main login_bare is this one also check, creates and logs in users which authenticated with other authentication methods. def ajax_login_bare(self, username, password):

[web2py] Re: login by ajax

2013-02-19 Thread yashar
i think login_bare needs to write again, in login() function, it first checks the login_methods and then local database and also create_or_get_user and update session.auth, but in login_bare it just check the database if user is there add it to session but not doing any of the login() steps

[web2py] login by ajax

2013-02-17 Thread yashar
login form is modal form inside index, and send login form via ajax to login() function, but i can not login. def login(): form=auth.login() if form.accepts(request,session=None): return 'logged' else: return 'failed' below section is in index page view: form action=''

[web2py] Re: login by ajax

2013-02-17 Thread yashar
thank you, i solve the problem like this: def index(): form = auth.login() form.elements('input',_type='submit')[0]['_Onclick']='login();return false;' return dict(form=form) def login(): if not auth.login_bare(request.vars.email,request.vars.password): return 'login

[web2py] Re: login by ajax

2013-02-17 Thread yashar
is there any way that i log in user by code? for example after checking username and password with login_bare, i push the user into the session as logged in user? in this case there is no need to write ajax/login directly, and the programmer has a better control. if i write : def login(): --

[web2py] different form of registration based on

2013-01-03 Thread yashar
i have two different set of users to register, employees and employers. their common fields are , username, email, active, password but the rest of the fields are different, how should i create register form for each one? is this possible to do something like this somewhere in registration

[web2py] Re: different form of registration based on

2013-01-03 Thread yashar
thanks, i think that i should use auth.register.on_success and auth.register.on_validation methods for your first advice. --

[web2py] what is wrong with this function in view

2012-12-09 Thread yashar
i get syntax error for the first 'elif', i tried if pass, if pass... but i wasnt able to escape error, what is wrong? {{ def populate_row(value): currency_map={'U':'USD','E':'Euro','P':'Pound'} if value: currency = value[-1:].upper() value = int(value[:-1]) pass if (value 0 and currency == 'B')

[web2py] Re: Ref: custom form issue

2012-12-09 Thread yashar
insert like this: {{form.insert(0,my_extra_element)}} return like this: {{=form[0]}} if this solve your problem. --

[web2py] Re: what is wrong with this function in view

2012-12-09 Thread yashar
it works, thank you. --

[web2py] sqlform hidden values

2012-10-10 Thread yashar
this is my form: form = SQLFORM(db.records,record_id,showid=False,deletable=True,hidden=dict(DN=DN)) but i cannot access form.vars.DN in controler nither in validator function, in controller in returns error ( DN is not in table ) and in validator it returns None. --

[web2py] Re: conditionally process form

2012-10-10 Thread yashar
On Tuesday, October 9, 2012 8:14:54 PM UTC+3:30, Annet wrote: In a function I have the following code: validate(form): organization=db((db. organization.cocNumber==form.vars.cocNumber)\

[web2py] Re: sqlform hidden values

2012-10-10 Thread yashar
, yashar wrote: this is my form: form = SQLFORM(db.records,record_id,showid=False,deletable=True,hidden=dict(DN=DN)) but i cannot access form.vars.DN in controler nither in validator function, in controller in returns error ( DN is not in table ) and in validator it returns None. --

[web2py] i get 'server error'

2012-10-06 Thread yashar
last): File /home/yashar/Documents/web2py/gluon/rocket.py, line 1302, in run self.run_app(conn) File /home/yashar/Documents/web2py/gluon/rocket.py, line 2003, in run_app output = self.app(environ, self.start_response) File /home/yashar/Documents/web2py/gluon/main.py, line 693

[web2py] Re: i get 'server error'

2012-10-06 Thread yashar
solved redirect url is wrong --

[web2py] varchar size in database

2012-09-25 Thread yashar
my database is postgres and i'm using this: Field('name',required=IS_LENGTH(255)); but it creates a varchar(512) in database, , how could i fix it? --

Re: [web2py] varchar size in database

2012-09-25 Thread yashar
thanks On Tuesday, September 25, 2012 3:22:54 PM UTC+3:30, Marin Pranjić wrote: Field(..., length=255, ...) Marin On Tue, Sep 25, 2012 at 1:28 PM, yashar yva...@gmail.com javascript:wrote: my database is postgres and i'm using this: Field('name',required=IS_LENGTH(255

[web2py] Re: Read file attached from gmail

2012-09-18 Thread yashar
check this: http://stackoverflow.com/questions/8307809/save-email-attachment-python3-pop3-ssl-gmail On Tuesday, September 18, 2012 2:53:35 AM UTC+4:30, visuallinux wrote: Dear All. Every day i did received a email (gmail) with a file attached (text) as rar. My question is how i can

[web2py] manipulate db.field.attrib

2012-09-16 Thread yashar
below solution not working, because when you open form1 then form2, web2py will look for joe for field, and not saving form1, so how could i solve it? db.define_table('test', Field('name')) def form1(): db.test.name.requires=IS_IN_SET(['yashar']) form = SQLFORM(db.test

[web2py] manipulating dal.field.attrib

2012-09-16 Thread yashar
i used this: db.define_table('test', Field('service_type')) def form1(): db.test.service_type.requires=IS_IN_SET(['Trial']) form = SQLFORM(db.test) if form.process().accepted: pass return dict(form=form) def form2():

[web2py] Re: manipulate db.field.attrib

2012-09-16 Thread yashar
(..., formname='form1') Anthony On Sunday, September 16, 2012 7:12:52 AM UTC-4, yashar wrote: below solution not working, because when you open form1 then form2, web2py will look for joe for field, and not saving form1, so how could i solve it? db.define_table('test', Field('name