RE: Filefield upload_tol
Hi Mike, Thanks for your attention on this. Kg solved this a few moments back. As suspected, a bit of basic muppetry on my part. Solution was only to change: Upload_to = '/tmp' TO: Upload_to = 'tmp' Nice. -Original Message- From: django-users@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Mike H Sent: 05 May 2008 15:21 To: django-users@googlegroups.com Subject: Re: Filefield upload_tol I can replicate this by putting in a file path that does not exist in the HIP form. The validation fails for the file field but the error is not rendered. edit_inline is known to be buggy - some validation faliures on models that are being edited inline aren't rendered, but the user is told there is an error. I think there are a number of tickets logged, but the official word is to wait until newforms-admin is complete. (I think, anyone know better?) Cheers, Mike On 5 May 2008, at 14:52, Ben Eliott wrote: > > Hi kg, > > Class HIP has a 1-to-many with Property (many HIPs / 1 Property) . The > offending field is HIP.hip > > #CODE > class Property(models.Model): >"""Model of a property""" > > >reference = models.CharField(max_length=20) >Archive = models.BooleanField() >SSTC = models.BooleanField() >price_prefix = > models.IntegerField(max_length=1,choices=PRICE_PREFIX,default=2) > #temp >price = models.DecimalField(max_digits=10,decimal_places=2) >address_1 = models.CharField(max_length=50) >address_2 = models.CharField(max_length=50) >address_3 = models.CharField(max_length=50,blank=True) >address_4 = models.CharField(max_length=50,blank=True) >postcode = models.CharField(max_length=10) >property_type = > models.CharField(max_length=30,choices=TYPES,default='House') >bedrooms = models.IntegerField() >reception_rooms = models.IntegerField(null=True,blank=True) >summary = models.CharField(max_length=200) >description = models.TextField(blank=True) >lease_years = models.IntegerField(null=True,blank=True) >ground_rent = > models > .DecimalField(null=True,max_digits=10,decimal_places=2,blank=True) >service_charge = > models > .DecimalField(null=True,max_digits=10,decimal_places=2,blank=True) >created_at = models.DateTimeField(auto_now_add=True) >modified_at = models.DateTimeField(auto_now=True) > > class HIP(models.Model): >hip = models.FileField(upload_to='/tmp',core=True) >property = > models > .ForeignKey(Property,edit_inline=models.TABULAR,num_in_admin=10,ma > x_num_in_admin=10,min_num_in_admin=10) > > #END > > If I change the upload_to to ='/full/path/to/tmp', (so long as > MEDIA_ROOT = '') it works fine! As soon as I switch to MEDIA_ROOT = > '/full/path/to/' and upload_to = '/tmp' (all slash permutation tried!) > it's 'Please correct the error below'. > > Maybe this will be of help: the MEDIA_URL is: 'http://example.com/tmp/ > (there is a further tmp subdir within that) and when the files save > correctly the admin form shows the link as the absolute path that was > written in upload_to clicking to http//example.com +appended with the > same absolute path 'http://www.example.com/absolute/path/to/file.txt'. > > > -Original Message- > From: django-users@googlegroups.com > [mailto:[EMAIL PROTECTED] On Behalf Of Kenneth Gonsalves > Sent: 05 May 2008 14:29 > To: django-users@googlegroups.com > Subject: Re: Filefield upload_tol > > > > > On 05-May-08, at 6:46 PM, Ben Eliott wrote: > >> Thanks for for your swift attention. >> It reloads the same form with the message at the top: 'Please correct >> the error below.' (although it doesn't actually show any error >> below). > > please paste your model here > > -- > > regards > kg > http://lawgon.livejournal.com > http://nrcfosshelpline.in/code/ > > > > > > > > -- > No virus found in this incoming message. > Checked by AVG. > Version: 7.5.524 / Virus Database: 269.23.8/1415 - Release Date: > 05/05/2008 06:01 > > > > -- No virus found in this incoming message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.8/1415 - Release Date: 05/05/2008 06:01 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
RE: Filefield upload_tol
Hi Kg, You're beautiful, you know that don't you? It worked a treat. And just in time moments before the Chelsea game starts too. When I said all slash permutations tried, I did of course mean, all but that one Thanks a million. Ben -Original Message- From: django-users@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Kenneth Gonsalves Sent: 05 May 2008 15:14 To: django-users@googlegroups.com Subject: Re: Filefield upload_tol On 05-May-08, at 7:22 PM, Ben Eliott wrote: > hip = models.FileField(upload_to='/tmp',core=True) try upload_to='tmp' <--- no '/' -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/code/ -- No virus found in this incoming message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.8/1415 - Release Date: 05/05/2008 06:01 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Filefield upload_tol
I can replicate this by putting in a file path that does not exist in the HIP form. The validation fails for the file field but the error is not rendered. edit_inline is known to be buggy - some validation faliures on models that are being edited inline aren't rendered, but the user is told there is an error. I think there are a number of tickets logged, but the official word is to wait until newforms-admin is complete. (I think, anyone know better?) Cheers, Mike On 5 May 2008, at 14:52, Ben Eliott wrote: > > Hi kg, > > Class HIP has a 1-to-many with Property (many HIPs / 1 Property) . The > offending field is HIP.hip > > #CODE > class Property(models.Model): >"""Model of a property""" > > >reference = models.CharField(max_length=20) >Archive = models.BooleanField() >SSTC = models.BooleanField() >price_prefix = > models.IntegerField(max_length=1,choices=PRICE_PREFIX,default=2) > #temp >price = models.DecimalField(max_digits=10,decimal_places=2) >address_1 = models.CharField(max_length=50) >address_2 = models.CharField(max_length=50) >address_3 = models.CharField(max_length=50,blank=True) >address_4 = models.CharField(max_length=50,blank=True) >postcode = models.CharField(max_length=10) >property_type = > models.CharField(max_length=30,choices=TYPES,default='House') >bedrooms = models.IntegerField() >reception_rooms = models.IntegerField(null=True,blank=True) >summary = models.CharField(max_length=200) >description = models.TextField(blank=True) >lease_years = models.IntegerField(null=True,blank=True) >ground_rent = > models > .DecimalField(null=True,max_digits=10,decimal_places=2,blank=True) >service_charge = > models > .DecimalField(null=True,max_digits=10,decimal_places=2,blank=True) >created_at = models.DateTimeField(auto_now_add=True) >modified_at = models.DateTimeField(auto_now=True) > > class HIP(models.Model): >hip = models.FileField(upload_to='/tmp',core=True) >property = > models > .ForeignKey(Property,edit_inline=models.TABULAR,num_in_admin=10,ma > x_num_in_admin=10,min_num_in_admin=10) > > #END > > If I change the upload_to to ='/full/path/to/tmp', (so long as > MEDIA_ROOT = '') it works fine! > As soon as I switch to MEDIA_ROOT = '/full/path/to/' and upload_to = > '/tmp' (all slash permutation tried!) it's 'Please correct the error > below'. > > Maybe this will be of help: the MEDIA_URL is: 'http://example.com/tmp/ > (there is a further tmp subdir within that) and when the files save > correctly the admin form shows the link as the absolute path that was > written in upload_to clicking to http//example.com +appended with the > same absolute path 'http://www.example.com/absolute/path/to/file.txt'. > > > -Original Message- > From: django-users@googlegroups.com > [mailto:[EMAIL PROTECTED] On Behalf Of Kenneth Gonsalves > Sent: 05 May 2008 14:29 > To: django-users@googlegroups.com > Subject: Re: Filefield upload_tol > > > > > On 05-May-08, at 6:46 PM, Ben Eliott wrote: > >> Thanks for for your swift attention. >> It reloads the same form with the message at the top: 'Please correct >> the error below.' (although it doesn't actually show any error >> below). > > please paste your model here > > -- > > regards > kg > http://lawgon.livejournal.com > http://nrcfosshelpline.in/code/ > > > > > > > > -- > No virus found in this incoming message. > Checked by AVG. > Version: 7.5.524 / Virus Database: 269.23.8/1415 - Release Date: > 05/05/2008 06:01 > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Filefield upload_tol
On 05-May-08, at 7:22 PM, Ben Eliott wrote: > hip = models.FileField(upload_to='/tmp',core=True) try upload_to='tmp' <--- no '/' -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/code/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
RE: Filefield upload_tol
Hi kg, Class HIP has a 1-to-many with Property (many HIPs / 1 Property) . The offending field is HIP.hip #CODE class Property(models.Model): """Model of a property""" reference = models.CharField(max_length=20) Archive = models.BooleanField() SSTC = models.BooleanField() price_prefix = models.IntegerField(max_length=1,choices=PRICE_PREFIX,default=2) #temp price = models.DecimalField(max_digits=10,decimal_places=2) address_1 = models.CharField(max_length=50) address_2 = models.CharField(max_length=50) address_3 = models.CharField(max_length=50,blank=True) address_4 = models.CharField(max_length=50,blank=True) postcode = models.CharField(max_length=10) property_type = models.CharField(max_length=30,choices=TYPES,default='House') bedrooms = models.IntegerField() reception_rooms = models.IntegerField(null=True,blank=True) summary = models.CharField(max_length=200) description = models.TextField(blank=True) lease_years = models.IntegerField(null=True,blank=True) ground_rent = models.DecimalField(null=True,max_digits=10,decimal_places=2,blank=True) service_charge = models.DecimalField(null=True,max_digits=10,decimal_places=2,blank=True) created_at = models.DateTimeField(auto_now_add=True) modified_at = models.DateTimeField(auto_now=True) class HIP(models.Model): hip = models.FileField(upload_to='/tmp',core=True) property = models.ForeignKey(Property,edit_inline=models.TABULAR,num_in_admin=10,ma x_num_in_admin=10,min_num_in_admin=10) #END If I change the upload_to to ='/full/path/to/tmp', (so long as MEDIA_ROOT = '') it works fine! As soon as I switch to MEDIA_ROOT = '/full/path/to/' and upload_to = '/tmp' (all slash permutation tried!) it's 'Please correct the error below'. Maybe this will be of help: the MEDIA_URL is: 'http://example.com/tmp/ (there is a further tmp subdir within that) and when the files save correctly the admin form shows the link as the absolute path that was written in upload_to clicking to http//example.com +appended with the same absolute path 'http://www.example.com/absolute/path/to/file.txt'. -Original Message- From: django-users@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Kenneth Gonsalves Sent: 05 May 2008 14:29 To: django-users@googlegroups.com Subject: Re: Filefield upload_tol On 05-May-08, at 6:46 PM, Ben Eliott wrote: > Thanks for for your swift attention. > It reloads the same form with the message at the top: 'Please correct > the error below.' (although it doesn't actually show any error below). please paste your model here -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/code/ -- No virus found in this incoming message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.8/1415 - Release Date: 05/05/2008 06:01 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Filefield upload_tol
On 05-May-08, at 6:46 PM, Ben Eliott wrote: > Thanks for for your swift attention. > It reloads the same form with the message at the top: 'Please correct > the error below.' (although it doesn't actually show any error below). please paste your model here -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/code/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
RE: Filefield upload_tol
Hi kg, Thanks for for your swift attention. It reloads the same form with the message at the top: 'Please correct the error below.' (although it doesn't actually show any error below). Best, Ben -Original Message- From: django-users@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Kenneth Gonsalves Sent: 05 May 2008 13:39 To: django-users@googlegroups.com Subject: Re: Filefield upload_tol On 05-May-08, at 5:33 PM, Ben Eliott wrote: > Hi, I'm getting started in the (highly enjoyable!) admin models - > FileField upload works when I give upload_to the full absolute > filepath. > However, as soon as I try and use MEDIA_ROOT in settings.py it baulks. what do you mean by 'baulks' - what is the error message? -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/code/ -- No virus found in this incoming message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.8/1415 - Release Date: 05/05/2008 06:01 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Filefield upload_tol
On 05-May-08, at 5:33 PM, Ben Eliott wrote: > Hi, I'm getting started in the (highly enjoyable!) admin models - > FileField upload works when I give upload_to the full absolute > filepath. > However, as soon as I try and use MEDIA_ROOT in settings.py it baulks. what do you mean by 'baulks' - what is the error message? -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/code/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Filefield upload_tol
Hi, I'm getting started in the (highly enjoyable!) admin models - FileField upload works when I give upload_to the full absolute filepath. However, as soon as I try and use MEDIA_ROOT in settings.py it baulks. Permissions are wide open, I've tried every combination of slashes & paths -- but it only likes it when upload_to gets given the absolute path. Any suggestions or even hints of ideas will be most welcome - it's bound to be some small, simple thing! Thank you. Ben --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---