5
我想向我的用戶模型中添加一個屬性,該屬性返回Project表中具有該用戶的用戶標識的行數。如何在Lift中計算行(Scala的Web框架)
因此,像這樣......
def numProjects = {
/* somehow get count from Project table
The straight sql would be:
SELECT COUNT(*) FROM projects WHERE userId = <the current user>
*/
}
謝謝!今天晚些時候會試用。 – joe 2008-09-23 14:19:30