Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.103 X-Spam-Level: * X-Spam-Evidence: '*H*': 0.79; '*S*': 0.00; 'nicely': 0.07; 'api': 0.09; 'cc:addr:python-list': 0.09; '22,': 0.09; 'anyway': 0.11; 'wed,': 0.15; 'former,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'other:': 0.16; 'statement.': 0.16; 'storing': 0.16; 'wrote:': 0.16; 'accepting': 0.18; 'input': 0.18; '2015': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'advocate': 0.22; 'select': 0.23; 'header:In-Reply-To:1': 0.24; "i've": 0.25; 'message-id:@mail.gmail.com': 0.27; 'tend': 0.27; 'subject: [': 0.29; 'sure,': 0.29; "i'm": 0.30; 'knows': 0.32; 'point': 0.33; 'usually': 0.33; 'curious': 0.33; 'received:google.com': 0.35; 'could': 0.35; 'text': 0.35; 'jason': 0.35; 'but': 0.36; 'too': 0.36; 'there': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'setting': 0.37; 'things': 0.38; 'easily': 0.39; 'subject:with': 0.40; 'field': 0.60; 'address': 0.61; 'no.': 0.62; 'above,': 0.63; 'times': 0.63; 'due': 0.65; 'nation': 0.66; "they're": 0.66; 'here': 0.66; 'country.': 0.67; 'apart': 0.70; 'jul': 0.72; 'actually,': 0.84; 'blob': 0.84; 'chrisa': 0.84; 'drop-down': 0.84; 'rip': 0.84; 'subject:leading': 0.84; 'whatsoever.': 0.84; 'to:none': 0.91; "country's": 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=Zp6Cj3QeqWF6e/19wcXPWMO38du56LxJcVhlQ6y58bk=; b=YbS2HsDM6b/ptKAK5p9SwMpgtYIkJAEzGWd4x5vx5midRYPX1XurKubB/b1SSKxcFG ECjRn2DpKmWz4KmwG2sOMKGetbjsZtfvmfFlbN2H7Y+6cffuQtZgoq5OIvnfqtIjFYLv syVJBrYLSG7gzk/+hRJ57L3zYUxPMXNO3vpAPQ/LfvGoJO8hhvCBfZL1ZxCoQYW++Zyz b6/ICFy2WYZaL4aoOfVkXCkSZ94W3JE3KIwtpvOJYX9BxW6oFSbR6HxsJ6sAiBtw1ci8 GPIpJB4RlQLNAttM/TGsgUz/RydRGEQe+y//XUqRX8IpfA/nKUHcmB94nO9SeXvr3PRK d4dQ== MIME-Version: 1.0 X-Received: by 10.50.60.100 with SMTP id g4mr30420760igr.41.1437541161271; Tue, 21 Jul 2015 21:59:21 -0700 (PDT) In-Reply-To: References: Date: Wed, 22 Jul 2015 14:59:21 +1000 Subject: Re: Address field [was: Integers with leading zeroes] From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 30 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1437541163 news.xs4all.nl 2888 [2001:888:2000:d::a6]:37603 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:94345 On Wed, Jul 22, 2015 at 2:31 PM, Jason Friedman wrote: >> Of course, most of the >> time, I advocate a single multi-line text field "Address", and let >> people key them in free-form. No postcode field whatsoever. > > I'm curious about that statement. > I could see accepting input as you describe above, but I'm thinking > you'd want to *store* a postcode field. Actually, no. Apart from statisticking, there's not a lot I can do with a postcode. Due to the nature of international addressing, it's usually safest to go to one extreme or the other: either full-on address validation that knows about every delivery point in every nation that you support (viable if you support only one country, and that country's postal service offers an API - happens here in Australia), or no validation whatsoever, and a simple free-form field for people to enter what they will. Most of the times I've been setting things up, they're too low-end to justify the former, so I recommend the latter. Sure, there might be typos... but there might be those anyway, with a classic multi-part form. (I do recommend having a drop-down select box for the country, incidentally. That's easily validated.) Storing postcodes works nicely once you've settled that they're all part of a single country. When you want to do statistics on postcodes, it's not usually too hard to rip them out of the blob and work with them, but they're unreliable anyway unless you've gone the full-on validation route. So I tend to just not do the stats at all :) ChrisA