Permalink
Browse files

forgot to return port in dburl2dict

  • Loading branch information...
1 parent df9e043 commit 386189731830d67666803fe988db59023f6391ea @aaronsw aaronsw committed Aug 9, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 web/db.py
View
@@ -1136,7 +1136,7 @@ def dburl2dict(url):
Takes a URL to a database and parses it into an equivalent dictionary.
>>> dburl2dict('postgres://james:day@serverfarm.example.net:5432/mygreatdb')
- {'user': 'james', 'host': 'serverfarm.example.net', 'db': 'mygreatdb', 'pw': 'day', 'dbn': 'postgres'}
+ {'host': 'serverfarm.example.net', 'pw': 'day', 'dbn': 'postgres', 'db': 'mygreatdb', 'port': '5432', 'user': 'james'}
"""
dbn, rest = url.split('://', 1)
@@ -1145,7 +1145,7 @@ def dburl2dict(url):
host, rest = rest.split(':', 1)
port, rest = rest.split('/', 1)
db = rest
- return dict(dbn=dbn, user=user, pw=pw, db=db, host=host)
+ return dict(dbn=dbn, user=user, pw=pw, host=host, port=port, db=db)
_databases = {}
def database(dburl=None, **params):

0 comments on commit 3861897

Please sign in to comment.