File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -1261,10 +1261,21 @@ def _get_connection(cls):
12611261 """
12621262 Returns a (cached) connection
12631263 """
1264- if not hasattr (cls , "Meta" ) or cls . Meta . table_name is None :
1264+ if not hasattr (cls , "Meta" ):
12651265 raise AttributeError (
1266- """As of v1.0 PynamoDB Models require a `Meta` class.
1267- See https://pynamodb.readthedocs.io/en/latest/release_notes.html"""
1266+ 'As of v1.0 PynamoDB Models require a `Meta` class.\n '
1267+ 'Model: {0}.{1}\n '
1268+ 'See https://pynamodb.readthedocs.io/en/latest/release_notes.html\n ' .format (
1269+ cls .__module__ , cls .__name__ ,
1270+ ),
1271+ )
1272+ elif not hasattr (cls .Meta , "table_name" ) or cls .Meta .table_name is None :
1273+ raise AttributeError (
1274+ 'As of v1.0 PyanmoDB Models must have a table_name\n '
1275+ 'Model: {0}.{1}\n '
1276+ 'See https://pynamodb.readthedocs.io/en/latest/release_notes.html' .format (
1277+ cls .__module__ , cls .__name__ ,
1278+ ),
12681279 )
12691280 if cls ._connection is None :
12701281 cls ._connection = TableConnection (cls .Meta .table_name ,
You can’t perform that action at this time.
0 commit comments