create initial models and mobile test for mojtaba eshaghi
This commit is contained in:
0
apps/warehouse/__init__.py
Normal file
0
apps/warehouse/__init__.py
Normal file
3
apps/warehouse/admin.py
Normal file
3
apps/warehouse/admin.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
||||
6
apps/warehouse/apps.py
Normal file
6
apps/warehouse/apps.py
Normal file
@@ -0,0 +1,6 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class WarehouseConfig(AppConfig):
|
||||
default_auto_field = 'django.db.models.BigAutoField'
|
||||
name = 'apps.warehouse'
|
||||
0
apps/warehouse/management/__init__.py
Normal file
0
apps/warehouse/management/__init__.py
Normal file
0
apps/warehouse/management/commands/__init__.py
Normal file
0
apps/warehouse/management/commands/__init__.py
Normal file
1
apps/warehouse/management/commands/command.py
Normal file
1
apps/warehouse/management/commands/command.py
Normal file
@@ -0,0 +1 @@
|
||||
# Your custom management commands go here.
|
||||
0
apps/warehouse/migrations/__init__.py
Normal file
0
apps/warehouse/migrations/__init__.py
Normal file
0
apps/warehouse/mobile/api/__init__.py
Normal file
0
apps/warehouse/mobile/api/__init__.py
Normal file
0
apps/warehouse/mobile/api/v1/__init__.py
Normal file
0
apps/warehouse/mobile/api/v1/__init__.py
Normal file
0
apps/warehouse/mobile/api/v1/serializers.py
Normal file
0
apps/warehouse/mobile/api/v1/serializers.py
Normal file
0
apps/warehouse/mobile/api/v1/urls.py
Normal file
0
apps/warehouse/mobile/api/v1/urls.py
Normal file
0
apps/warehouse/mobile/api/v1/views.py
Normal file
0
apps/warehouse/mobile/api/v1/views.py
Normal file
0
apps/warehouse/mobile/tests/test_common_services.py
Normal file
0
apps/warehouse/mobile/tests/test_common_services.py
Normal file
0
apps/warehouse/models.py
Normal file
0
apps/warehouse/models.py
Normal file
25
apps/warehouse/pernissions.py
Normal file
25
apps/warehouse/pernissions.py
Normal file
@@ -0,0 +1,25 @@
|
||||
from rest_framework import permissions
|
||||
|
||||
|
||||
# example Code
|
||||
class AuthorAllStaffAllButEditOrReadOnly(permissions.BasePermission):
|
||||
edit_methods = ("PUT", "PATCH")
|
||||
|
||||
def has_permission(self, request, view):
|
||||
if request.user.is_authenticated:
|
||||
return True
|
||||
|
||||
def has_object_permission(self, request, view, obj):
|
||||
if request.user.is_superuser:
|
||||
return True
|
||||
|
||||
if request.method in permissions.SAFE_METHODS:
|
||||
return True
|
||||
|
||||
if obj.author == request.user:
|
||||
return True
|
||||
|
||||
if request.user.is_staff and request.method not in self.edit_methods:
|
||||
return True
|
||||
|
||||
return False
|
||||
0
apps/warehouse/pos/api/__init__.py
Normal file
0
apps/warehouse/pos/api/__init__.py
Normal file
0
apps/warehouse/pos/api/v1/__init__.py
Normal file
0
apps/warehouse/pos/api/v1/__init__.py
Normal file
0
apps/warehouse/pos/api/v1/serializers.py
Normal file
0
apps/warehouse/pos/api/v1/serializers.py
Normal file
0
apps/warehouse/pos/api/v1/urls.py
Normal file
0
apps/warehouse/pos/api/v1/urls.py
Normal file
0
apps/warehouse/pos/api/v1/views.py
Normal file
0
apps/warehouse/pos/api/v1/views.py
Normal file
0
apps/warehouse/pos/tests/test_common_services.py
Normal file
0
apps/warehouse/pos/tests/test_common_services.py
Normal file
1
apps/warehouse/services.py
Normal file
1
apps/warehouse/services.py
Normal file
@@ -0,0 +1 @@
|
||||
# Your services go here
|
||||
1
apps/warehouse/urls.py
Normal file
1
apps/warehouse/urls.py
Normal file
@@ -0,0 +1 @@
|
||||
# Your urls go here
|
||||
0
apps/warehouse/web/api/__init__.py
Normal file
0
apps/warehouse/web/api/__init__.py
Normal file
0
apps/warehouse/web/api/v1/__init__.py
Normal file
0
apps/warehouse/web/api/v1/__init__.py
Normal file
0
apps/warehouse/web/api/v1/serializers.py
Normal file
0
apps/warehouse/web/api/v1/serializers.py
Normal file
0
apps/warehouse/web/api/v1/urls.py
Normal file
0
apps/warehouse/web/api/v1/urls.py
Normal file
0
apps/warehouse/web/api/v1/views.py
Normal file
0
apps/warehouse/web/api/v1/views.py
Normal file
0
apps/warehouse/web/tests/test_common_services.py
Normal file
0
apps/warehouse/web/tests/test_common_services.py
Normal file
Reference in New Issue
Block a user