[web2py] Re: Attaching files stored in blobstore in a mail
No, there is no stacktrace in the logs only the warning. Also I have tried passing the stream as payload but I get an error there as well. Its stacktrace is: File /base/data/home/apps/s~app-id/1.357014326405166801/applications/ abc/controllers/xyz.py:download, line 384, in report_download File /base/data/home/apps/s~app-id/1.357014326405166801/gluon/ tools.py, line 132, in __init__ payload = read_file(payload, 'rb') File /base/data/home/apps/s~app-id/1.357014326405166801/gluon/ fileutils.py, line 46, in read_file f = open(filename, mode) IOError: [Errno 13] Permission denied Is it possible to attach the stream in mail or even blobstore file? Thanks
[web2py] Re: Attaching files stored in blobstore in a mail
I tried using GAE mail class directly and it worked without the need to use blobstore. I just passed the filename and stream.getvalue() in the attachment tuple and it worked. Thanks a lot everyone for your suggestions.
[web2py] Attaching files stored in blobstore in a mail
I have a google app engine application developed using web2py framework. I have stored the files in blobstore and I am mailing the link to the user. Since I need to perform the delete operation every time(delete all the files from blobstore) and add a new file to the blobstore, except for the latest mail all other mails contain link that throws error. Is it possible to attach a file stored in blobstore in a mail and send it? Please provide your suggestion. Thanks
[web2py] Re: Attaching files stored in blobstore in a mail
Thanks Alan, What do you suggest me to send to the mail attachment as payload - blob info object or blob reader? On Feb 22, 4:30 pm, Alan Etkin spame...@gmail.com wrote: web2py have a Mail class to send emails. It supports attachments. If you have not, you can check the manual at section 8.2 Sending emails for detailed examples. The Mail constructor accepts an attachments argument (a single or sequence of Mail.Attachment instances). It is possible to pass a file- like object to the payload argument in the nested class Attachment containing the blob data with it. Here is the API documentation for the Mail feature:http://www.web2py.com/examples/static/epydoc/web2py.gluon.tools.Mail-... On Feb 22, 6:25 am, Saurabh S ggtestlo...@gmail.com wrote: I have a google app engine application developed using web2py framework. I have stored the files in blobstore and I am mailing the link to the user. Since I need to perform the delete operation every time(delete all the files from blobstore) and add a new file to the blobstore, except for the latest mail all other mails contain link that throws error. Is it possible to attach a file stored in blobstore in a mail and send it? Please provide your suggestion. Thanks
[web2py] Re: Attaching files stored in blobstore in a mail
Yes I m using GAE blobstore. I am sending the blob reader as payload and a filename. I m getting this error: 'Int' object has no attribute lower. Can you please suggest what might be the reason behind it? On Feb 23, 1:03 am, howesc how...@umich.edu wrote: by blobstore you mean you are running on GAE using the GAE blobstore right? checkout this section of the GAE docs: http://code.google.com/appengine/docs/python/blobstore/overview.html#...
[web2py] Re: Attaching files stored in blobstore in a mail
This is my code: def report_download(result, colnames): import cStringIO stream = cStringIO.StringIO() render_report_csv(stream, result, colnames=colnames) filename = '%s-%s-%s.csv' % (request.function, request.args(0), request.now) #For inserting file to the blobstore file_name = files.blobstore.create(mime_type='text/csv') with files.open(file_name, 'a') as f: f.write(stream.getvalue()) files.finalize(file_name) blob_key = files.blobstore.get_blob_key(file_name) blob_reader = blobstore.BlobReader(blob_key) blob_info = blobstore.get(blob_key) url = https://+http_host+/+request.controller+/+download+;? key=+str(blob_key)# email url to admin message = htmla href=+url+Download/a/html mail.send(to=person_email, subject='Report Download', message=message, attachments = Mail.Attachment(payload=blob_reader,filename = filename)) return stream.getvalue() This is the error that is shown in google app engine log: Mail.send failure:'int' object has no attribute 'lower' That too it shows as a warning. Please suggest On Feb 23, 11:57 am, Christian Foster Howes how...@umich.edu wrote: do you have a full stack trace with that and a code sample? I've never tried to do this myself, but perhaps i can help debug. On 2/22/12 22:55 , Saurabh S wrote: Yes I m using GAE blobstore. I am sending the blob reader as payload and a filename. I m getting this error: 'Int' object has no attribute lower. Can you please suggest what might be the reason behind it? On Feb 23, 1:03 am, howeschow...@umich.edu wrote: by blobstore you mean you are running on GAE using the GAE blobstore right? checkout this section of the GAE docs: http://code.google.com/appengine/docs/python/blobstore/overview.html#...
[web2py] Re: Implementing task queue using web2py
Now the task queue is working fine. I have another problem. I am generating a csv file.. Now since its running at background there will not be any popup so I want to attach the file as an attachment in mail and send or store the file in blobstore and send the link to user. This is my code: def report_download(result, colnames): import cStringIO stream = cStringIO.StringIO() logging.info('Before sending to render_report_csv') render_report_csv(stream, result, colnames=colnames) logging.info('After render_report_csv') filename = '%s-%s-%s.csv' % (request.function, request.args(0), request.now) logging.info(filename) response.headers['Content-Type'] = 'text/csv' response.headers['Content-Disposition'] = 'attachment; filename= %s' % filename logging.info('print stream') mail.send(to='rohit.agumbe.ram...@accenture.com', subject='Report Download',message='') return stream.getvalue() please suggest me on how to attach the csv to mail or get the blob url of file stored in blob Thanks On Feb 14, 9:08 pm, Christian Foster Howes how...@umich.edu wrote: what is the error in the logs when the task fails? what is the URL shown in the task list? something is either amok with the URL itself, or something is causing that function to fail when called via the task queue. On 2/13/12 20:05 , Saurabh S wrote: It worked when I passed a different controller in the url other than the one it is being called from. It is production. I checked the task queue it simply retries continuously if the same controller is provided. No params is not a mandatory argument to takqueue.add() I guess. Because it does not throw any syntax error if not provided. On Feb 10, 8:52 pm, howeschow...@umich.edu wrote: some questions/thoughts: - local test server or production? - did you check the task queue? in production go to the admin console and find the task queues link. in local test go to /_ah/admin and find the task queue link - is params a required argument to taskqueue.add()? i don't know if i always use it cause i need it or cause it is required.
[web2py] Attaching csv in mail without providing path
Is it possible to attach a csv in mail in web2py without providing path? I have these 2 methods for generating csv: def report_download(result, colnames): import cStringIO stream = cStringIO.StringIO() render_report_csv(stream, result, colnames=colnames) filename = '%s-%s-%s.csv' % (request.function, request.args(0), request.now) response.headers['Content-Type'] = 'text/csv' response.headers['Content-Disposition'] = 'attachment; filename= %s' % filename mail.send('rohit.agumbe.ram...@accenture.com', 'Message subject',attachments = Mail.attachment()) #attachments = Mail.Attachment(stream.getvalue(), filename=filename,content_id='text/csv') return stream.getvalue() def render_report_csv(ofile, result, colnames=[], null='NULL', *args, **kwargs): delimiter = kwargs.get('delimiter', ',') quotechar = kwargs.get('quotechar', '') quoting = kwargs.get('quoting', csv.QUOTE_MINIMAL) writer = csv.writer(ofile, delimiter=delimiter, quotechar=quotechar, quoting=quoting) writer.writerow(colnames) for record in result: row = [] for col in colnames: if '.' in col: (t, f) = col.split('.') row.append(record.get(t).get(f)) else: row.append(record.get(col)) writer.writerow(row) Is it possible to use the stream and attach it in the mail as a csv? Please provide your suggestion
[web2py] Re: Implementing task queue using web2py
It worked when I passed a different controller in the url other than the one it is being called from. It is production. I checked the task queue it simply retries continuously if the same controller is provided. No params is not a mandatory argument to takqueue.add() I guess. Because it does not throw any syntax error if not provided. On Feb 10, 8:52 pm, howesc how...@umich.edu wrote: some questions/thoughts: - local test server or production? - did you check the task queue? in production go to the admin console and find the task queues link. in local test go to /_ah/admin and find the task queue link - is params a required argument to taskqueue.add()? i don't know if i always use it cause i need it or cause it is required.
[web2py] Join operations on google app engine
I have an online application deployed on google cloud. I have used web2py framework to develop the application. I have 2 tables the auth_user table and tasks table.Both of them have more than 1000 records each.The tasks table contains person_id field which stores the id's in auth_user table I need to fetch the data from 2 tables and display it. Since I am having large data it results in request time out(Deadline Exceeded Error). When I fetch from a single table it works fine. Since Google App Engine does not support JOIN operations I was fetching the entire data from both tables and then peforming operations, it would result to request time out. So I thought of adding the necessary fields that are in auth_user to tasks table but since there are more than 1000 records updating each record manually is cumbersome. Does web2py provide any bultin methods(like database validations) to update the fields based on person_id present or I should update it manually?
[web2py] Re: best way to fetch data from multiple tables?
Omi, We tried the solution that you have mentioned using join provided by web2py, it works fine on local server. But when we run it in google appengine sandbox or deploy it using google app engine it gives the error Too many tables in the query. Is there a solution to resolve this? Is there any other way of implementing joins on google app engine which increases the performance? On Feb 9, 8:25 pm, Omi Chiba ochib...@gmail.com wrote: Also will it possible for me put filters on table 1(say Employees) and then perform join with othertables? I'm not sure. I think it's more like join then filter. Something like below... query = (db.person.id==db.dog.owner) (db.person.name.like('Omi%')) rows = db(query).select() On Feb 9, 8:53 am, Sonal_b sonalba...@gmail.com wrote: Thanks Omi. I will give it a try. Also will it possible for me put filters on table 1(say Employees) and then perform join with othertables? On Feb 9, 7:34 pm, Omi Chiba ochib...@gmail.com wrote: Sound like you're looping all the records to connect different table. I use join for the purpose and working fine though I only have about 1 records. http://www.web2py.com/books/default/chapter/29/6?search=join#Inner-joins On Feb 9, 8:19 am, Sonal_b sonalba...@gmail.com wrote: I have to query 3tableswhich contains large number ofdata I have to come up with report which displays Employee Firstname, Lastname, Manager's FirstName, Manager's Lastname and Organisation name. Table Structure/Details: 1. Employee table: which contains employee information(First name, lastname), Organisation id and manager's id. 2. Manager Table: Which contains firstname, lastname etc. 3. Organisation table: which contains organisation's name. The process i follow is: 1.Fetchall the employees 1.a for each employee get the manager id 1.b For the manager id get the manager's firstname and lastname by querying the Manager table 1.c for each employee get the organisation id 1.d For each organisation id get the Organisation name by querying the Organisation table. When I try tofetchthe records from 3tablesfollowing the above approach, I get deadlineexceedederror as my request could not complete in 30 seconds time. Please suggest a betterwayto do this. Also what should i use which can improve performance and also get me the result in the 30 second timeframe.
[web2py] Implementing task queue using web2py
I have an application on google app engine. I have used web2py framework to develop the application I have a module in which I need to fetch the records from 3 tables and the final set of records contain data from all the 3 tables. Here each of my tables contain more than 1000 records so when I implemented it, it started throwing request time out error. So I thought of implementing it using task queue. While using task queue (push queue) . I have used the below code def func(): from google.appengine.api import taskqueue result=[] if request.vars.download: logging.info('Before task') taskqueue.add(url=URL(r=request,c='abc',f='hello')) # abc is the controller logging.info('After Task') return dict(result=result) def hello(): logging.info('task queue implementation') return When I checked the log 'before task' and 'after task' info are present but there is nothing logged in the log for hello function(where 'task queue implementation' should have been present). Please suggest if there is anything I need to add to this code to make it work or If there is anything missing that I am unaware of. Thanks
[web2py] login with blank password:problem
Hi , i am developing an online booking system in web2py on GAE. The problem that i am facing is when i create an entity (client/ volunteer/employee) in my system , i store a random password in the db (auth_random_password()) and 'pending' in the registration key initially. but when i enable the login (registration_key = ) for an entity. i can login the system without typing anything in the password field. also if i do request_reset_password then the login functionality is working absolutely fine.(email as well as password is required after request_reset_password ) is it neccessary that when ever an entity (client/employee/volunteer) is created that we must do a request reset password in order for login functionality to work properly (with email and valid password) Is there any solution to avoid this ? Please suggest on this Thanks in advance.
[web2py] Pagination issue in GAE using web2py
Hi, I am developing an online booking application in python using web2py framework on google app engine. I have two tables, one is users table and other is activities table. My users table contains user id for each record and my activities table contains user id for whom an activity has been created. My user table has different authorization levels such as clients and volunteers. I have more than 1000 records in both activities table and user table. Now I need to fetch all the activities of all the clients. Since all the data cannot be displayed at a single click, I have used pagination. So I have used the limitby on my database queries. The issue that I am facing is When I try to match the id of people with the id present in activities, if first set of activities have been fetched using limitby and then I match them with the user id of clients and there is no match then the the records for the remaing id's are not fetched from the database. Please provide any suggestion on how to use limitby filter when we have data coming from more than one table(there is a one to one mapping in these two tables) Thanks in advance
[web2py] Deadline exceeded error/ Downloading data in csv via application
Hi, I am developing an online booking system. one of the functionality that i have implemented is to generate reports by gathering the data from two or more different tables. the problem that i am facing is due to large number of records (greater than thousand) , i was unable to render all the records into the view.(request time out) . to overcome this i implemented pagination which displays the records in small sets (using limitby filter on the database). by implementing the pagination i was able to remove the error while viewing the data. But in addition to viewing , i also have the functionality to download the same report in csv. due to the large data size i am unable to download the csv. it gives me deadline exceeded error. Please note my requirement is to download whole set of report in one csv.(more than 1000 records) I am thinking of implementing task queues for this ? Please suggest any solution for this. Thanks in advance
[web2py] Image broken in exported CSV
Hi , I have a table in my application , i have stored a image field in one column of that table. but when i export the table via /appadmin, the image field appears to be broken/in some format which is not readable. How can i export the image as it is ? Please provide suggestions.
[web2py] Image broken in exported CSV
Hi , I have a table in my application , i have an image colomn in that table which stores images. when i export the table via /appadmin, the image field appears to be broken/in some format which is not readable. How can i export the image as it is (in the same format is it was stored) ? Please provide suggestions.
[web2py] Logout if browser is closed
Hi , Is there any way possible to log-out the user if browser in closed ? Please provide suggestions
[web2py] Logout if browser is closed
Hi , Is there any way possible to log-out the user if browser is closed ? Please provide suggestions
[web2py] Automatic logout in Web2py
Hi , I am developing an online booking system in web2py framework. 1. I want to have the functionality where a user will be logged out after some time(say 1 hour) if the system remains idle. 2. The user will be logged out if the browser window is closed Please suggest what are the possible ways of achieving this.
[web2py] Re: Automatic logout in Web2py
Hi thanks fir the reply, I wrote that line in db_init.py but that is not working also i tried it by writing the same in gluon/tools.py but still was not working, from my applications point of view , i want to log out the user after 30 mins , Is there any other place in the application where i can write auth.settings.expiration=1800 to enable log out after idle time...please reply...thanks in advance On Dec 7, 9:34 am, Anthony abasta...@gmail.com wrote: On Tuesday, December 6, 2011 10:27:42 PM UTC-5, Saurabh S wrote: Hi , I am developing an online booking system in web2py framework. 1. I want to have the functionality where a user will be logged out after some time(say 1 hour) if the system remains idle. auth.settings.expiration defaults to 3600 (i.e., 1 hour) 2. The user will be logged out if the browser window is closed Auth depends on the session, which depends on a session cookie in the browser, which I believe should automatically expire when the browser closes (not just the tab being used for your app, but the whole browser). I'm not sure if there's a way to detect when a single tab is closed (you can use jQuery unload(), but that will trigger on a page reload or back button as well). Anthony
[web2py] Numbers only field
Hi i have used custom form in my application example: tr td {{=form.custom.label.mobile}}:/td td{{=form.custom.widget.mobile}}/td td{{=form.custom.label.email}}:/td td{{=form.custom.widget.email}}/td /tr I need a javascript/jqeury function to allow spaces and numbers only in the mobile field, even if user tries to enter some character or special character or anything else other than spaces and number , it should not allow the user to write it there. Please suggest..
[web2py] Re: Numbers only field
Thanks Massimo :) On Dec 6, 9:18 am, Massimo Di Pierro massimo.dipie...@gmail.com wrote: scriptjQuery('#tablename_fieldname').keyup(function() {this.value=this.value.replace(/[^ 0-9]/g,'');});/script On Dec 5, 9:46 pm, Saurabh S ggtestlo...@gmail.com wrote: Hi i have used custom form in my application example: tr td {{=form.custom.label.mobile}}:/td td{{=form.custom.widget.mobile}}/td td{{=form.custom.label.email}}:/td td{{=form.custom.widget.email}}/td /tr I need a javascript/jqeury function to allow spaces and numbers only in the mobile field, even if user tries to enter some character or special character or anything else other than spaces and number , it should not allow the user to write it there. Please suggest..
[web2py] Retrieving values
Hi , I have two controllers namely REGISTRATIONS and EVENTS , i have calender in my application. values and the data are printed on the calender via EVENTS controller. I have come across a requirement where i need to have a variable who's value is determined in the REGISTRATION controller is to be printed on the calender, but the problem is there is no linking between this two controller (i.e request does travarse in between these two controllers). Is there any possible way to bring that variable (who's value is determined in REGISTRATION controller) in the event controller. please provide suggestions.
[web2py] BULKLOADER IMPORT
Hi , i used inbuilt import function provided by web2py on GAE but after import my id's in the table were changing so i opted for BULKLOADER to perform import via command line (i want id's in the datastore table to be same as they are in the file) 1. while importing a file via command line i am getting error as below TypeError: expected string or buffer [INFO] [WorkerThread-1] Backing off due to errors: 1.0 seconds [INFO] An error occurred. Shutting down... [ERROR ] Error in WorkerThread-0: expected string or buffer [INFO] 4 entities total, 0 previously transferred [INFO] 0 entities (2396 bytes) transferred in 17.1 seconds [INFO] Some entities not successfully transferred 2. I wanted to know even if i successfully perform import via command line . whether the id's will change or they will remain the same ? Please provide suggestions
Re: [web2py] Problem while Importing a csv file into the database
Hi , thanks for the reply...i tried what you suggested but even that is not working out...is there any other solution for this ? please suggest as i am complately stuck up with this from last three daysplz suggest On Thu, Nov 3, 2011 at 12:08 PM, Johann Spies johann.sp...@gmail.comwrote: On 2 November 2011 13:36, Saurabh S ggtestlo...@gmail.com wrote: Questions: 1. What is the correct way to create the CSV file so that the file can be imported using appadmin feature. 2. How to debug the error in case data is not reflected after importing the .csv file? 3. Is there any particular steps that needs to be followed while importing the file. Please share the documentation/reference in case it is available. What I normall do is to create an empty table, use the admin function to export it to a csv-file, open the file in a spreadsheet and populate the columns - but I leave the data in the 'id' column empty. If I am struggling to get this working in using the admin interface I try it on the commandline where it is a bit easier to debug. There were cases that I could not import csv files (created by web2py) on another computer. As a last resort I just did a dump of the table using Postgresql and imported the dump using 'psql -f filename dbname' Regards Johann -- Because experiencing your loyal love is better than life itself, my lips will praise you. (Psalm 63:3)
Re: [web2py] Problem while Importing a csv file into the database
Thanks for replying philip, I will be deploying my code to GAEdatabase will be Google's datastore...is there any tool available to migrate a data template into GAE datastore ? On Thu, Nov 3, 2011 at 2:57 PM, Philip Kilner phil.kil...@gmail.com wrote: Hi, On 03/11/2011 09:01, Saurabh S wrote: is there any other solution for this ? please suggest as i am complately stuck up with this from last three daysplz suggest I can't help with web2py's CSV import function, but if you are stuck, why not try importing directly into the database? You don't say what database you using, but if you can share that it should be possible to suggest a tool to talk to the database directly. -- Regards, PhilK 'a bell is a cup...until it is struck'
[web2py] Saurabh S wants to chat
--- Saurabh S wants to stay in better touch using some of Google's coolest new products. If you already have Gmail or Google Talk, visit: http://mail.google.com/mail/b-4d6c4a2f3-0feaf224bf-Oir9iudbwgceMu0GRBc4DXQyDAI You'll need to click this link to be able to chat with Saurabh S. To get Gmail - a free email account from Google with over 2,800 megabytes of storage - and chat with Saurabh S, visit: http://mail.google.com/mail/a-4d6c4a2f3-0feaf224bf-Oir9iudbwgceMu0GRBc4DXQyDAI Gmail offers: - Instant messaging right inside Gmail - Powerful spam protection - Built-in search for finding your messages and a helpful way of organizing emails into conversations - No pop-up ads or untargeted banners - just text ads and related information that are relevant to the content of your messages All this, and its yours for free. But wait, there's more! By opening a Gmail account, you also get access to Google Talk, Google's instant messaging service: http://www.google.com/talk/ Google Talk offers: - Web-based chat that you can use anywhere, without a download - A contact list that's synchronized with your Gmail account - Free, high quality PC-to-PC voice calls when you download the Google Talk client We're working hard to add new features and make improvements, so we might also ask for your comments and suggestions periodically. We appreciate your help in making our products even better! Thanks, The Google Team To learn more about Gmail and Google Talk, visit: http://mail.google.com/mail/help/about.html http://www.google.com/talk/about.html (If clicking the URLs in this message does not work, copy and paste them into the address bar of your browser).
[web2py] Problem while Importing a csv file into the database
Hi , Step1: Created table headers(cloumns) in the excel file EXACTLY SIMILAR TO THOSE which are present in the database
[web2py] Problem while Importing a csv file into the database
Hi, I am facing the problem while importing csv file. Please find the steps below that i am following. Step1: Created table headers(cloumns) in the excel file EXACTLY SIMILAR to those which are present in the database table Step2: Inserted some dummy data as rows in the columns. All the validations are taken care of while creating/filling out the dummy rows. For example: Inserted values in rows where the validation on field was not null =True Step3: Saved the file with .csv extension Step4: Tried to import this .csv file into the database using / appadmin It is been observed that no data has been inserted into the database table. Also there was no error message displayed. Questions: 1. What is the correct way to create the CSV file so that the file can be imported using appadmin feature. 2. How to debug the error in case data is not reflected after importing the .csv file? 3. Is there any particular steps that needs to be followed while importing the file. Please share the documentation/reference in case it is available.
[web2py] Import And Export of Database Tables
Hi , is it possible to built a module in the application itself to have a functionality of import and export , just like /appadmin ? i.e. can we have a button in our application on click of which we can import/export the data ?
[web2py] Import/Export issuse in web2py
Hi , I have deployed single app to two different instances , i want to have some of the data to be common in both the system so i exported the data in csv from one app and added some data manually into the same csv then tried to add this csv to another app via import...but this is not workingbut when i tried to import it without any modifications , it works fine please suggest on this . also please answer the questions below : 1. if the DB structure is different than the coloumns in csv , will the import work ? for example my x table in DB has 10 columns and i am importing a csv into it with 8 columns...will i be able to do this successfully ?... if yes then what about values in those two fields ? 2. As we know GAE datastore stores the date in yy/mm/dd , now if i am importing a csv file with the date column in the format which is not yy/mm/dd , will the import happens ? or it fails ?
[web2py] Import/Export issue in web2py.
Hi , I have deployed single app to two different instances , i want to have some of the data to be common in both the system so i exported the data in csv from one app and added some data manually into the same csv then tried to add this csv to another app via import...but this is not workingbut when i tried to import it without any modifications , it works fine please suggest on this . also please answer the questions below : 1. if the DB structure is different than the coloumns in csv , will the import work ? for example my x table in DB has 10 columns and i am importing a csv into it with 8 columns...will i be able to do this successfully ?... if yes then what about values in those two fields ? 2. As we know GAE datastore stores the date in yy/mm/dd , now if i am importing a csv file with the date column in the format which is not yy/mm/dd , will the import happens ? or it fails ? Thanks
[web2py] HOW TO RETRIEVE IMAGE FROM DATABASE
Hi , i am developing an online booking system using web2py ...i have come across a requiremnt where i need to store the clients photo into the database( 2MB)...how should i proceed with this .i have achieved the functionality to store a image into the database when i create a perticuler client...but the problem is the same image should be visible when the we edit the clients page..but this is not happeningwhen i checked in appadmin that image is getting stored into the DB but i am unable to retrieve it back(for viewing) on the edit client page for storing i have used a filed only , Field('image','upload') also i am using td{{=form.custom.label.image}}:/td td{{=form.custom.widget.image}}/td how i can retrieve image back so that it becomes visible in smaller size on the edit client page Please suggest ...
[web2py] HOW TO RETRIEVE IMAGE FROM DATABASE.....
Hi , i am developing an online booking system using web2py ...i have come across a requiremnt where i need to store the clients photo into the database( 2MB)...how should i proceed with this .i have achieved the functionality to store a image into the database when i create a perticuler client...but the problem is the same image should be visible when the we edit the clients page..but this is not happeningwhen i checked in appadmin that image is getting stored into the DB but i am unable to retrieve it back(for viewing) on the edit client page for storing i have used a DB field i.e. , Field('image','upload') . also i am using td{{=form.custom.label.image}}:/td td{{=form.custom.widget.image}}/td how i can retrieve image back so that it becomes visible in smaller size on the edit client page Please suggest ...
Re: [web2py] Re: image uploading and storing in web2py
hi thanks for you reply...please tell me how can i store the path of image into the databse and actuall image image on the file system ?...i mean what would the field in database.if i go with this approach will i be able to view the same image when i edit a perticuler client...please reply On Mon, Oct 17, 2011 at 3:43 PM, Bruno Rocha rochacbr...@gmail.com wrote: The recommended is: Store the pictures on the file system and picture locations in the database. Why? Because... 1. You will be able to serve the pictures as static files. 2. No database access or application code will be required to fetch the pictures. 3. The images could be served from a different server to improve performance. 4. It will reduce database bottleneck. 5. The database ultimately stores its data on the file system. 6. Images can be easily cached when stored on the file system. But if it is a requirement to store in database there is not to do about. On Mon, Oct 17, 2011 at 6:19 AM, Gour g...@atmarama.net wrote: On Mon, 17 Oct 2011 05:57:32 -0200 Bruno Rocha rochacbr...@gmail.com wrote: If your image needs to be stored in database (not in filesystem) do: Is it, in general, recommended to store image (blob) of such size in the {sqlite3,postgresql} database? Sincerely, Gour -- When your intelligence has passed out of the dense forest of delusion, you shall become indifferent to all that has been heard and all that is to be heard. http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810 -- -- Bruno Rocha [ About me: http://zerp.ly/rochacbruno ] [ Aprenda a programar: http://CursoDePython.com.br ] [ O seu aliado nos cuidados com os animais: http://AnimalSystem.com.br ] [ Consultoria em desenvolvimento web: http://www.blouweb.com ]
[web2py] image uploading and storing in web2py
Hi , i am developing an online booking system using web2py ...i have come across a requiremnt where i need to store the clients photo into the database( 2MB)...how should i proceed with this...i mean what should be the field in databasehow i can populate a select image box so that user/admin can upload a image into the DB. Please suggest
[web2py] Back to home page every time i click cancle button
tr class=submitrow td{{=form.custom.submit}}/td tdinput style=margin-left:0px id=cancel class=submit type=reset onclick=window.history.back() value=Cancel/td i want to replace on-click function with something that always redirects me to my home pagesuppose my home page is http://127.0.0.1:8000...how it would be possible please suggest...
[web2py] how to restrict a field to be alphabet only
how i am developing a system in which i require a validation on name field...validation shoould be : the field should not accept numbers ...it should only accept alphabets...i know this is possible using IS_MATCH in web2py...i tried using db.organisations.name.requires=[IS_MATCH('^[a-z]', error_message='This is not a valid name')] but it is not working please help me out.
[web2py] how to restrict a field to be alphabet only
hi i am developing a system in which i require a validation on name field...validation shoould be : the field should not accept numbers ...it should only accept alphabets...i know this is possible using IS_MATCH in web2py...i tried using db.organisations.name.requires=[IS_MATCH('^[a-z]', error_message='This is not a valid name')] but it is not working please help me out.
[web2py] Re: how to restrict a field to be alphabet only
thank you all On Oct 12, 7:37 pm, Vinicius Assef vinicius...@gmail.com wrote: But not '*', '%' and so on. hehehe On Wed, Oct 12, 2011 at 10:00 AM, Anthony abasta...@gmail.com wrote: Yeah, that's probably better for names. Names can include hyphens as well. On Wednesday, October 12, 2011 8:56:35 AM UTC-4, spyker wrote: On 12 October 2011 13:33, Anthony abas...@gmail.com wrote: On Wednesday, October 12, 2011 7:13:53 AM UTC-4, spyker wrote: Field('your_name', requires=IS_MATCH('\D+') Note, \D will match any non-digit character, not just letters. That is what I said: anything except 0-9. It allows for surnames like 'Van der Merwe', O'Sullivan, 'Cronjé' For finetuning - read the howto. Regards Johann -- May grace and peace be yours in abundance through the full knowledge of God and of Jesus our Lord! His divine power has given us everything we need for life and godliness through the full knowledge of the one who called us by his own glory and excellence. 2 Pet. 1:2b,3a
[web2py] Multi tenency in web2py
hi , i am developing the configurable system for four clients . i want the code should be deployed on the single instance and should support the diffrent features depending upon who is logged in...also there should be a single database for all the clients..in order to impliment multi tenecy i tried to use request.tenent in web2py...but as this will store only the first part of URL into the database and will create the namespace by same name...so to have this solved i had to deploy the code on diffrent instances but this is voilating my systems configurability...is there any solution by which i can have the code deployed on single version and have diffrent namespaces in database depending upon who is logged in ...also a client should not be able to view other clients data for security purpose.
[web2py] Automatic data import and export in web2py application
Hi , i am developing an application for online booking system.i have come across a requirement where i nedd to automatically import and and export data to/from google datastore i know this is possible from command line...but i wanted to have this automizedcan i have a link or a button in my application on click of which i can call import/exportif there is any pre existing code for this please paste that here ..and if there are any other suggestion please post a reply
[web2py] GAE BULK UPLOAD AND DOWNLOAD
Hi , i am developing an application for GAE in python using web2py frameworki have come across a requirement where i need to import and export the data from CSV or XML files into the google datastorei was able import and export the data from the command line..but i want this to be done on click of a link or a button ...can i have a link or a button in my application to automatically import and export the data when clickedif yes ..please guide me how to go further with this..
[web2py] Re: Automatic data import and export in web2py application
sorry i didnt get youcould you please elaborate this ... On Oct 6, 6:47 am, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Why not run the app directly there? Perhaps an app that simply exposes the service. On Oct 5, 6:29 pm, Saurabh S ggtestlo...@gmail.com wrote: Hi , i am developing an application for online booking system.i have come across a requirement where i nedd to automatically import and and export data to/from google datastore i know this is possible from command line...but i wanted to have this automizedcan i have a link or a button in my application on click of which i can call import/exportif there is any pre existing code for this please paste that here ..and if there are any other suggestion please post a reply