@@ -69,14 +69,14 @@ class ContentDB(Base):
69
69
created_datetime_utc : Mapped [datetime ] = mapped_column (
70
70
DateTime (timezone = True ), nullable = False
71
71
)
72
+ display_number : Mapped [int ] = mapped_column (Integer , nullable = False , default = 0 )
72
73
is_archived : Mapped [bool ] = mapped_column (Boolean , nullable = False , default = False )
73
74
positive_votes : Mapped [int ] = mapped_column (Integer , nullable = False , default = 0 )
74
75
negative_votes : Mapped [int ] = mapped_column (Integer , nullable = False , default = 0 )
75
76
query_count : Mapped [int ] = mapped_column (Integer , nullable = False , default = 0 )
76
77
updated_datetime_utc : Mapped [datetime ] = mapped_column (
77
78
DateTime (timezone = True ), nullable = False
78
79
)
79
- display_number : Mapped [int ] = mapped_column (Integer , nullable = False , default = 0 )
80
80
workspace_id : Mapped [int ] = mapped_column (
81
81
Integer ,
82
82
ForeignKey ("workspace.workspace_id" , ondelete = "CASCADE" ),
@@ -100,6 +100,7 @@ def __repr__(self) -> str:
100
100
f"content_metadata={ self .content_metadata } , "
101
101
f"content_tags={ self .content_tags } , "
102
102
f"created_datetime_utc={ self .created_datetime_utc } , "
103
+ f"display_number={ self .display_number } , "
103
104
f"is_archived={ self .is_archived } ), "
104
105
f"updated_datetime_utc={ self .updated_datetime_utc } ), "
105
106
f"workspace_id={ self .workspace_id } "
@@ -352,7 +353,7 @@ async def get_list_of_content_from_db(
352
353
select (ContentDB )
353
354
.options (selectinload (ContentDB .content_tags ))
354
355
.where (ContentDB .workspace_id == workspace_id )
355
- .order_by (ContentDB .content_id )
356
+ .order_by (ContentDB .display_number )
356
357
)
357
358
if exclude_archived :
358
359
stmt = stmt .where (ContentDB .is_archived == false ())
@@ -361,7 +362,7 @@ async def get_list_of_content_from_db(
361
362
if isinstance (limit , int ) and limit > 0 :
362
363
stmt = stmt .limit (limit )
363
364
content_rows = (await asession .execute (stmt )).all ()
364
-
365
+ print ([ c [ 0 ] for c in content_rows ])
365
366
return [c [0 ] for c in content_rows ] if content_rows else []
366
367
367
368
0 commit comments