image handling

2015-03-24 Thread akash . patni
hi.. Can anyone please tell me how to handle old image after uploading new image. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@google

Re: image handling

2015-03-24 Thread akash . patni
Hi , I want to delete the old image. On Tuesday, March 24, 2015 at 2:40:35 PM UTC+5:30, akash...@ranosys.com wrote: > > hi.. > Can anyone please tell me how to handle old image after uploading new > image. > -- You received this message because you are subscribed to the Google Groups "Django

Re: image handling

2015-03-24 Thread akash . patni
This is my model class User(models.Model): first_name=models.CharField(verbose_name = "First Name *",max_length=20,blank=False) last_name=models.CharField(verbose_name = "Last Name *",max_length=20,blank=False) username=models.EmailField(verbose_name = "Email *",max_length=30,blank=F

Image resizing

2015-03-24 Thread akash . patni
Hi.. can anyone please tell me how to resize the uploaded image This is my model class User(models.Model): first_name=models.CharField( verbose_name = "First Name *",max_length=20,blank=False) last_name=models.CharField(verbose_name = "Last Name *",max_length=20,blank=False) userna

Re: image handling

2015-03-24 Thread akash . patni
This is my edit profile function in view def edit_profile(request): if 'username' in request.session: user_id=request.POST.get('id') user_id=request.GET.get('id') usr_obj=User.objects.get(id=int(user_id)) if request.method=="POST": regform=

Re: image handling

2015-03-24 Thread akash . patni
hi any answer On Tuesday, March 24, 2015 at 2:40:35 PM UTC+5:30, akash...@ranosys.com wrote: > > hi.. > Can anyone please tell me how to handle old image after uploading new > image. > -- You received this message because you are subscribed to the Google Groups "Django users" group. T

Re: image handling

2015-03-24 Thread akash . patni
When i edit image that is when i upload new image,the old image should get deleted On Tuesday, March 24, 2015 at 2:40:35 PM UTC+5:30, akash...@ranosys.com wrote: > > hi.. > Can anyone please tell me how to handle old image after uploading new > image. > -- You received this message because yo

Re: Image resizing

2015-03-24 Thread Akash Patni
go-users/5938a0d0-af8a-44aa-96c4-5d234f3e2cc4%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > > -- > You received this message because you are subscribed to a topic in the >

Re: image handling

2015-03-24 Thread Akash Patni
6op303LMxA2iGNuzqgzB%3DjBPWw2KXkpjwdaho2Z%2BQ%40mail.gmail.com > <https://groups.google.com/d/msgid/django-users/CALXYUbkpM6op303LMxA2iGNuzqgzB%3DjBPWw2KXkpjwdaho2Z%2BQ%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://gro

Re: image handling

2015-03-24 Thread Akash Patni
7;s more sensible and more DRY to do it in the model. > > Regards, > > Andréas > > 2015-03-24 14:10 GMT+01:00 Akash Patni : > >> Hey, >> I am new to django. I have other feilds also other than image field in my >> form, so will you please tell me how to use abo

Re: image handling

2015-03-24 Thread Akash Patni
arField(verbose_name = "Sex *",max_length=5,blank=False) image=models.FileField(verbose_name = "Image(limit 1Mb) *",blank=True,upload_to=path_and_rename('')) def __unicode__(self): return self.first_name On Tue, Mar 24, 2015 at 6:47 PM, Akash Patni

Re: image handling

2015-03-24 Thread Akash Patni
to have 4 blankspaces in your file, so make sure > the indentation is the same). > > Secondly, I think that you should add the code I sent to the __init__.py > file in the project itself (in the same directory that you have you > models.py). That way it will be run during startup (which

Re: image handling

2015-03-24 Thread Akash Patni
field which i have highlighted. Is it right, Please sugges. On Wed, Mar 25, 2015 at 9:28 AM, Akash Patni wrote: > Hi, > I have added the code to my __init__.py file but still its not working. > > __init__.py > from django.core.files.storage import default_storage as storage &g

Re: Image resizing

2015-03-25 Thread Akash Patni
uot;edit_profile.html",{"form":regform,}) else: regform=Edit_Registration(instance=usr_obj) return render_to_response("edit_profile.html",{"form":regform,"user_id":user_id}) else: return HttpResponseRedir

Re: image handling

2015-03-25 Thread Akash Patni
Of course the other parts of the user object needs to be added as well. As > you can see, I have also set a path for upload_to instead of a function, > because using a function is only necessary when you want to set a unique > path for each image (for example using the id for it). > &

Re: Image resizing

2015-03-25 Thread Akash Patni
te: > Hi, > > Again, you should really put this in your database model instead of in the > view. If you use your overriden save function, you would be able to add > this there. Also, you check if the image is not an L or RGB image (don't > know what L is) and resize it ONLY

Re: Image resizing

2015-03-26 Thread Akash Patni
27;address1':user_id.address1,'city':user_id.city,'state':user_id.state,'pincode':user_id.pincode,'country':user_id.country,'comment':user_id.comment,'sex':user_id.sex} regform=Edit_Registration(instance=usr_obj)

Textarea taking htnml tags

2015-03-26 Thread akash . patni
Hie to all, In one of my template i am using text area. The issue is that when i write html tags with some image link using img tag, when i am saving this i am getting image on the desription field. Actual-Image is comming Expected-I want HTML code to be displayed in the discription. Please su

textarea showing image instead of code

2015-03-27 Thread akash . patni
Hie to all, In one of my template i am using text area. The issue is that when i write html tags with some image link using img tag, when i am saving this i am getting image on the desription field. Actual-Image is comming Expected-I want HTML code to be displayed in the discription. Please su

Re: textarea showing image instead of code

2015-03-27 Thread Akash Patni
the web visit > https://groups.google.com/d/msgid/django-users/55151EC7.3090403%40arkade.info > <https://groups.google.com/d/msgid/django-users/55151EC7.3090403%40arkade.info?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout

Re: Textarea taking htnml tags

2015-03-29 Thread Akash Patni
+unsubscr...@googlegroups.com. > To post to this group, send email to django-users@googlegroups.com. > Visit this group at http://groups.google.com/group/django-users. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/55159AA1.9070605%40arkade.in

Re: Textarea taking htnml tags

2015-03-30 Thread Akash Patni
{% endfor %} {% endif %} {% endfor %} I had also used striptag filter and this is also not working... On Mon, Mar 30, 2015 at 9:11 AM, Akash Patni wrote: > *Hi,* > *This my template* > {% block content %} > > > > > src="

TIMEZONE

2015-04-08 Thread akash . patni
Hi to all , Previously my settings.py file was having time zone as TIME_ZONE = 'America/Chicago' now i have changed to TIME_ZONE = 'Europe/London' that not getting reflected means date and time are getting stored in database as of previous timezone... Please suggest. -- You received this

No exception supplied error while resizing image by using blobproperty

2015-05-19 Thread akash . patni
Hi guys, I am resizing image using blobproperty but it s giving BadImageError with no exception supllied. Here is my code for resizing: *bg_image = request.FILES['bg_image'].read(*) *obj_partner.bg_image = db.Blob(images.resize(bg_image,1400,758)) // error line* and i am uploading image w