है, मैं जानना चाहता हूं कि ऑब्जेक्ट दिया गया है, अगर यह एक SQLlchemy मैप किए गए मॉडल का उदाहरण है।जांचें कि ऑब्जेक्ट एक sqlalchemy मॉडल उदाहरण
आम तौर पर, मैं isinstance (obj, घोषणात्मक आधार) का उपयोग करता हूं। हालांकि, इस परिदृश्य में, मेरे पास उपलब्ध घोषणात्मक आधार वर्ग नहीं है (क्योंकि यह एक निर्भरता परियोजना में है)।
मैं जानना चाहता हूं कि इस मामले में सबसे अच्छा अभ्यास क्या है।
class Person(DeclarativeBase):
__tablename__ = "Persons"
p = Person()
print isinstance(p, DeclarativeBase)
#prints True
#However in my scenario, I do not have the DeclarativeBase available
#since the DeclarativeBase will be constructed in the depending web app
#while my code will act as a library that will be imported into the web app
#what are my alternatives?
कुछ और जानकारी प्रदान करें! – shahjapan