Re: File Field

2011-05-16 Thread Mateusz Marzantowicz
On Fri, May 13, 2011 at 1:44 AM, pankaj sharma wrote: > Hello friends,. > i want to upload some files to my database and show it to user .. > how to add an filefield option to models.py and how to show them in > admin.py. > and how to let the users download the files... > > Do you really want to s

Re: File Field

2011-05-16 Thread Derek
On May 13, 1:44 am, pankaj sharma wrote: > Hello friends,. > i want to upload some files to my database and show it to user .. > how to add an filefield option to models.py and how to show them in > admin.py. > and how to let the users download the files... Suggest you start with the docs: http://

File Field

2011-05-12 Thread pankaj sharma
Hello friends,. i want to upload some files to my database and show it to user .. how to add an filefield option to models.py and how to show them in admin.py. and how to let the users download the files... -- You received this message because you are subscribed to the Google Groups "Django user

Re: Updating to Django 1.3 - how to preserve file field previous behaviour

2011-03-28 Thread Jacob Kaplan-Moss
On Sun, Mar 27, 2011 at 6:47 PM, Russell Keith-Magee wrote: > As was suggested when you raised this on django-dev, if you want the > old behavior, write a subclass of FileField that reintroduces the old > behavior. ... and for those who're not reading over there, here's some code you might try: h

Re: Updating to Django 1.3 - how to preserve file field previous behaviour

2011-03-27 Thread Russell Keith-Magee
On Sun, Mar 27, 2011 at 6:20 PM, -RAX- wrote: > Hi all, > > According to > http://docs.djangoproject.com/en/dev/releases/1.3/#filefield-no-longer-deletes-files > FileField fields no longer delete the related file when the instance > is deleted. > > I understand the motivations behind this decisio

Updating to Django 1.3 - how to preserve file field previous behaviour

2011-03-27 Thread -RAX-
Hi all, According to http://docs.djangoproject.com/en/dev/releases/1.3/#filefield-no-longer-deletes-files FileField fields no longer delete the related file when the instance is deleted. I understand the motivations behind this decision BUT this creates several side effects in various websites w

Re: removable file field and other features

2011-01-02 Thread Daniel Carvalho
On 12/20/2010 12:55 AM, Daniel Carvalho wrote: > Everybody knows the default django FileField doesn't allow to remove an > existing file... > > This is a good replacement. Just use RemovableFileField instead of > FileField in your models: > http://djangosnippets.org/snippets/636/ > > > I want to

removable file field and other features

2010-12-19 Thread Daniel Carvalho
Everybody knows the default django FileField doesn't allow to remove an existing file... This is a good replacement. Just use RemovableFileField instead of FileField in your models: http://djangosnippets.org/snippets/636/ I want to implement on it another feature- When there is a file being uplo

Re: File Field max size and admin interface

2009-09-15 Thread David De La Harpe Golden
Peter Bengtsson wrote: > Sadly this means that if a user tries to upload a 11Mb file you won't > be able to confront them with a user-friendly "error" message. > It's pretty straightforward to subclass django.forms.fields.FileField to apply a size limit in clean(), or perhaps just do the check

Re: File Field max size and admin interface

2009-09-13 Thread Peter Bengtsson
One way of doing it, and to be honest the only one I know, is to set a limit in the fronting web server. In Nginx for example you add: client_max_body_size 10M; Sadly this means that if a user tries to upload a 11Mb file you won't be able to confront them with a user-friendly "error" message.

File Field max size and admin interface

2009-09-13 Thread drakkan
Hi, I'm using the admin interface with some filefield, I tested with a big file (200 MB) and it was successfully uploaded, this is ok but I would like a way to limiting the uploaded size for example to a maximun of 10 MB, any hints? thanks drakkan --~--~-~--~~~---~--~

Re: removable file field?

2009-07-16 Thread Michael Stevens
I found something that's working for me now: http://code.djangoproject.com/ticket/7968 Although I had to modify the save method slightly to add commit. 2009/7/16 Michael Stevens : > Does anyone have a removable file field definition for django 1.1? > > I found http://www.djan

removable file field?

2009-07-16 Thread Michael Stevens
Does anyone have a removable file field definition for django 1.1? I found http://www.djangosnippets.org/snippets/636/ which is exactly what I want but it seems to have the key flaw of giving server errors on current django. Michael --~--~-~--~~~---~--~~ You

Flat-file Field

2009-01-03 Thread Randy
I am trying to figure out how to create a model field that doesn't pull from the database but instead pulls from the file system, shows it in the forms as a Textarea, then just saves it back to file system when the model is saved. In my mind it seems pretty simple. I have read the custom models p

Re: admin can't update: AttributeError 'parse_file_upload' for a model with no file field

2008-11-25 Thread Malcolm Tredinnick
On Tue, 2008-11-25 at 06:50 -0800, omat wrote: > Hi, > > I am trying to update a object via admin interface. Nothing fancy, and > it all goes well on my local environment, as it does many times > before. > > But in the production site, I get an AttributeError: > > 'module' object has no attrib

admin can't update: AttributeError 'parse_file_upload' for a model with no file field

2008-11-25 Thread omat
Hi, I am trying to update a object via admin interface. Nothing fancy, and it all goes well on my local environment, as it does many times before. But in the production site, I get an AttributeError: 'module' object has no attribute 'parse_file_upload' The traceback (which dpaste refused to s

Re: File field problem

2008-11-20 Thread laspal
Got it fixed. I was making mistake -) On Nov 20, 12:22 pm, laspal <[EMAIL PROTECTED]> wrote: > OK I got the point but still having some problem dealing with excel > file. > > code: > abspath = '/home/laspal/work/test/tmp/' > * view*** > if not os.path.isdir(abspath + str(_user

Re: File field problem

2008-11-19 Thread laspal
OK I got the point but still having some problem dealing with excel file. code: abspath = '/home/laspal/work/test/tmp/' * view*** if not os.path.isdir(abspath + str(_user.username)): os.mkdir(abspath + str(_user.username) ) filepathwithname = os.path.jo

Re: File field problem

2008-11-18 Thread Rajesh Dhawan
laspal wrote: > Hi, > I am trying to save file using file field but ran into problem. > Here is my code: > > ***model > > class CronEmail(models.Model): > subject = models.CharField( max_length = 200) > message = models.CharField( max

File field problem

2008-11-18 Thread laspal
Hi, I am trying to save file using file field but ran into problem. Here is my code: ***model class CronEmail(models.Model): subject = models.CharField( max_length = 200) message = models.CharField( max_length = 200) sender = models.CharField( max_length = 200

Re: Image and File Field hard coded sizes

2007-03-13 Thread Brendon
On Mar 12, 3:23 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > A change to fix this (make the length longer) will be committed after > 0.96. I'm intentionally not committing it beforehand because it is a > backwards incompatible change in the sense that every database using > such a field wil

Re: Image and File Field hard coded sizes

2007-03-12 Thread Malcolm Tredinnick
On Mon, 2007-03-12 at 09:29 -0700, Brendon wrote: > Hello folks, > > I'm curious if there is a better way of changing File and Image Fields > from "varchar(100)" to "varchar(%(maxlength)s)" than editing "django/ > db/backends/mysql/creation.py". Is there any particular reason why > these are hard

Image and File Field hard coded sizes

2007-03-12 Thread Brendon
Hello folks, I'm curious if there is a better way of changing File and Image Fields from "varchar(100)" to "varchar(%(maxlength)s)" than editing "django/ db/backends/mysql/creation.py". Is there any particular reason why these are hard set? My relative paths seem to have exceeded the 100 char lim

Validation of Text Field + File Field

2007-02-12 Thread johnny
Case 1: When you have Validation for TextField and FileField on the same form, you enter the info and upload a file. When you hit submit, text form validation fails, that means the File is still sent to the server and server would have it in the memory. Now, I have to fix the TextField info with

Re: _post_save() problem with an empty file field

2006-05-04 Thread Adrian Holovaty
On 5/4/06, sam <[EMAIL PROTECTED]> wrote: > Django version 0.91. I was trying to generate a thumbnail for an image > upload. The image is a FileField. I want to generate thumbnail in > _post_save() of the model object. The code is something like the > following: > > class Item(meta.Model): > .

_post_save() problem with an empty file field

2006-05-04 Thread sam
Django version 0.91. I was trying to generate a thumbnail for an image upload. The image is a FileField. I want to generate thumbnail in _post_save() of the model object. The code is something like the following: class Item(meta.Model): ... file = meta.FileField(upload_to="files",blank=Tr