first commit
This commit is contained in:
commit
3e4574dcdd
163 files changed
+3559
No files matched your search
@@ -0,0 +1,20 @@
|
||||
from apps.project.models import Project as ProjectModel
|
||||
from rest_framework.exceptions import ValidationError
|
||||
|
||||
|
||||
def op_list_project(status: str = 'waiting') -> ProjectModel:
|
||||
projects = ProjectModel.objects.filter(status=status)
|
||||
return projects
|
||||
|
||||
|
||||
def list_project(user) -> ProjectModel:
|
||||
projects = ProjectModel.objects.filter(cuser=user)
|
||||
return projects
|
||||
|
||||
|
||||
def get_project(project_id: int) -> ProjectModel:
|
||||
try:
|
||||
project = ProjectModel.objects.get(id=project_id)
|
||||
return project
|
||||
except Exception as e:
|
||||
raise ValidationError({'error': f'error on get project {str(e)}'})
|
||||
Reference in new issue
Block a user