Skip to content

Commit

Permalink
Add model FKs from SpecObj to PhotoObj_Primary
Browse files Browse the repository at this point in the history
  • Loading branch information
albireox committed Jun 16, 2020
1 parent 814ab78 commit 1d2dd9a
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions python/sdssdb/peewee/sdss5db/catalogdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,19 +240,6 @@ class Meta:
table_name = 'sdss_dr14_specobj'


class SDSS_DR16_SpecObj(SDSS_DR14_SpecObj):

specobjid = BigIntegerField(primary_key=True)

photoobj = ForeignKeyField(SDSS_DR13_PhotoObj,
column_name='bestobjid',
object_id_name='bestobjid',
backref='specobj_dr16')

class Meta:
table_name = 'sdss_dr16_specobj'


class SDSS_DR14_QSO(CatalogdbModel):

pk = BigIntegerField(primary_key=True)
Expand Down Expand Up @@ -984,6 +971,24 @@ class Meta:
table_name = 'sdss_dr13_photoobj_primary'


class SDSS_DR16_SpecObj(SDSS_DR14_SpecObj):

specobjid = BigIntegerField(primary_key=True)

photoobj = ForeignKeyField(SDSS_DR13_PhotoObj,
column_name='bestobjid',
object_id_name='bestobjid',
backref='specobj_dr16')

photoobj_primary = ForeignKeyField(SDSS_DR13_PhotoObj_Primary,
column_name='bestobjid',
object_id_name='bestobjid',
backref='+')

class Meta:
table_name = 'sdss_dr16_specobj'


class Gaia_DR2_TwoMass_Best_Neighbour(CatalogdbModel):

source_id = BigIntegerField(primary_key=True)
Expand Down

0 comments on commit 1d2dd9a

Please sign in to comment.