Commit 9fd6534a authored by Guillaume Mella's avatar Guillaume Mella
Browse files

add rough support for star_info unknown_by_simbad

parent 458327cc
import re
from sqlalchemy import Column, Float, Index, Integer, String
from sqlalchemy import Column, Float, Index, Integer, String, Boolean
from sqlalchemy.ext.associationproxy import association_proxy
from sqlalchemy.inspection import inspect
from sqlalchemy.orm import relationship
......@@ -81,7 +81,8 @@ class StarInfo(Base):
'NOTES': { 'field': 'notes', 'must': False },
'BIBCODE': { 'field': 'bibcode', 'must': True, 'check': 'check_bibcode', 'alternate': 'REFERENCE'},
'COM': { 'field': 'com', 'must': False, 'alternate': 'REFERENCE'},
'REFERENCE': { 'must': False, 'parse': 'parse_reference' }
'REFERENCE': { 'must': False, 'parse': 'parse_reference' },
'UNKNOW_BY_SIMBAD': {'field': 'unknown_by_simbad', 'must': False},
},
'checks': [
# here we should have names of methods to call that check object coherency
......@@ -131,6 +132,7 @@ class StarInfo(Base):
notes = Column(String(255))
bibcode = Column(String(19))
com = Column(String(255))
unknown_by_simbad = Column(Boolean)
star_info_entry = relationship('StarInfoEntry', back_populates='star_info')
submission = association_proxy('star_info_entry', 'submission')
......@@ -473,7 +475,10 @@ class StarInfo(Base):
elif bc:
self.append_error('band', 'calculated band_code invalid \'%s\''%(repr(bc)))
#
def check_unknown_by_simbad(self, field_name, field_info, value):
pass
#
# header parsing function
#
......
......@@ -17,6 +17,7 @@
<th>notes</th>
<th>bibcode</th>
<th>com</th>
<th>simbad</th>
</tr>
</thead>
<tbody>
......@@ -35,6 +36,7 @@
<td>{{star.notes}}</td>
<td>{{star.bibcode}}</td>
<td>{{star.com}}</td>
<td>{{star.unknown_by_simbad}}</td>
</tr>
{% endif %}
{% endfor %}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment