mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Default to raw value, use Row.display(key) for display, refs #521
This commit is contained in:
parent
454c4dc770
commit
7d3783fda1
1 changed files with 3 additions and 3 deletions
|
|
@ -43,13 +43,13 @@ class Row:
|
||||||
def __getitem__(self, key):
|
def __getitem__(self, key):
|
||||||
for cell in self.cells:
|
for cell in self.cells:
|
||||||
if cell["column"] == key:
|
if cell["column"] == key:
|
||||||
return cell["value"]
|
return cell["raw"]
|
||||||
raise KeyError
|
raise KeyError
|
||||||
|
|
||||||
def raw(self, key):
|
def display(self, key):
|
||||||
for cell in self.cells:
|
for cell in self.cells:
|
||||||
if cell["column"] == key:
|
if cell["column"] == key:
|
||||||
return cell["raw"]
|
return cell["value"]
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue