Skip to content

Commit

Permalink
Foreign key of package with molecule relation table
Browse files Browse the repository at this point in the history
  • Loading branch information
bhavin2897 committed Dec 22, 2023
1 parent c1874dd commit 12056a6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 17 deletions.
14 changes: 11 additions & 3 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 2 additions & 14 deletions ckanext/rdkit_visuals/models/molecule_rel.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ class MolecularRelationData(Base):
molecules_id = Column(u'molecules_id', _types.Integer, ForeignKey(u'molecules.id'), nullable=False)
package_id = Column(u'package_id', _types.UnicodeText, ForeignKey(_package.Package.id), nullable=False)


@classmethod
def create(cls, molecules_id, package_id):
"""
Expand Down Expand Up @@ -134,16 +133,5 @@ def get_molecule_data_by_package_id(cls, package_id):
return molecule_data


package = relationship(_package.Package, secondary= MolecularRelationData, backref="molecular_relation_data")

#meta.registry.map_imperatively(MolecularRelationData, MolecularRelationData.__table__)

#meta.mapper(#
# MolecularRelationData,
# 'molecule_rel_data',
# properties={
# u"package": orm.relation(
# Package, backref=orm.backref(u"molecule_rel_data", cascade=u"all, delete, delete-orphan")
# )
# },
#)
# relationship to build between molecules and packages
package = relationship(_package.Package, secondary= MolecularRelationData, back_populates="molecular_relation_data", cascade="all, delete")

0 comments on commit 12056a6

Please sign in to comment.