Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
wither
Jun 23, 2004

I have a turn both for observation and for deduction.
That's a beautiful tutorial, ATL. I look forward to this thread. If anyone's using a version past .96 however, max_length has replaced maxlength.

Adbot
ADBOT LOVES YOU

wither
Jun 23, 2004

I have a turn both for observation and for deduction.
I'm so sodding angry. I setup a new server and installed django from the trunk. Everything on my old servers were 0.97-pre and this happened to be 1.0-ALPHA or something. They entirely changed the way files.REQUEST and uploads in general are handled. Broke every god drat thing. I just tarred up my old django-trunk and symlinked it.
If anyone has any idea how to fix this, I'd appreciate it
code:
if 'file' in request.FILES:
                        file = request.FILES['file']
                try:
                        img = Image.open(StringIO(request.FILES['photo']['content']))
                        request.FILES['file']['dimensions'] = img.size
                except:
                        request.FILES['file']['error'] = True
                content_type = file.get('content-type')
                if len(file['content']) > 1024 * 750:
                        raise forms.ValidationError('nein kiddo')
                if content_type:
                        main, sub = content_type.split('/')
                        if not (main == 'image' and sub in ['jpeg','gif','png']):
                                raise forms.ValidationError('wrong file type')
                filename = file['filename']

wither
Jun 23, 2004

I have a turn both for observation and for deduction.
Does that mean the trunk is frozen?

Edit: Ahh thank god.

wither fucked around with this message at 11:16 on Aug 17, 2008

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply