diff options
| author | Kenneth Reitz <me@kennethreitz.com> | 2010-10-01 17:56:31 -0400 |
|---|---|---|
| committer | Kenneth Reitz <me@kennethreitz.com> | 2010-10-01 17:56:31 -0400 |
| commit | fbfbe01b70fde0221375bb64fb2eabac7ca65221 (patch) | |
| tree | 23e117d866ffba373a840adc2cf50f521854612b /tablib | |
| parent | d85523b6a6dc5452105a887f3d5fe60534b57332 (diff) | |
| parent | 06a394ea5ccf57600a12b0deca45a2f7e89b018b (diff) | |
| download | tablib-fbfbe01b70fde0221375bb64fb2eabac7ca65221.tar.gz | |
Merge branch 'joshmerge' into develop
Diffstat (limited to 'tablib')
| -rw-r--r-- | tablib/core.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/tablib/core.py b/tablib/core.py index 730467f..a7a2963 100644 --- a/tablib/core.py +++ b/tablib/core.py @@ -173,10 +173,19 @@ class Dataset(object): def append(self, row=None, col=None): """Adds a row to the end of Dataset""" - if row: + if row is not None: self._validate(row) self._data.append(tuple(row)) - elif col: + elif col is not None: + col = list(col) + if self.headers: + header = [col.pop(0)] + else: + header = [] + if len(col) == 1 and callable(col[0]): + col = map(col[0], self._data) + col = tuple(header + col) + self._validate(col=col) if self.headers: |
