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
-~----------~----~----~----~------~----~------~--~---

Reply via email to