diff --git a/README.md b/README.md index b3d004a..aade22d 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,11 @@ python manage.py shell_plus --use-pythonrc ``` ---------------------------------------- +Generate data via: + +``` +python manage.py generate_* commands +``` Data generation order: @@ -39,4 +44,20 @@ Data generation order: 11. Portfolios 12. Reviews +or here is right commands in one str: +``` +python manage.py generate_superuser && +python manage.py generate_specializations && +python manage.py generate_locations && +python manage.py generate_perm_groups && +python manage.py generate_build_classifs && +python manage.py generate_constr_types && +python manage.py generate_users && +python manage.py generate_teams && +python manage.py generate_realties && +python manage.py generate_projects && +python manage.py generate_portfolios && +python manage.py generate_reviews +``` + ---------------------------------------- diff --git a/api/views.py b/api/views.py index 69ed315..a2dd477 100755 --- a/api/views.py +++ b/api/views.py @@ -66,11 +66,13 @@ class RealtyViewSet(ModelViewSet): class SpecializationViewSet(ModelViewSet): - queryset = Specialization.objects.root_nodes()[0].get_descendants() - # queryset = Specialization.objects # Migrate with this enabled + try: # TODO: dirty + queryset = Specialization.objects.root_nodes()[0].get_descendants() + except: + queryset = Specialization.objects serializer_class = SpecializationSerializer filter_class = SpecializationFilterSet - + class UserViewSet(ModelViewSet): queryset = User.objects.all() @@ -79,7 +81,9 @@ class UserViewSet(ModelViewSet): class LocationViewSet(ModelViewSet): - queryset = Location.objects.root_nodes()[0].get_descendants() - # queryset = Location.objects # Migrate with this enabled + try: # TODO: dirty + queryset = Location.objects.root_nodes()[0].get_descendants() + except: + queryset = Location.objects serializer_class = LocationSerializer filter_class = LocationFilterSet diff --git a/projects/forms.py b/projects/forms.py index a94c7cd..2e7a293 100644 --- a/projects/forms.py +++ b/projects/forms.py @@ -168,18 +168,40 @@ class ContractorProjectAnswerForm(forms.ModelForm): class Meta: model = Answer + # ('author', 'Relation? True', 'Null? None', 'Blank? None'), + # ('content_type', 'Relation? True', 'Null? False', 'Blank? False'), + # ('portfolios', 'Relation? True', 'Null? False', 'Blank? True'), + # ('project', 'Relation? True', 'Null? False', 'Blank? False'), + # + # ('candidates', 'Relation? True', 'Null? True', 'Blank? None'), + # ('files', 'Relation? True', 'Null? True', 'Blank? None'), + # + # + # ('budget', 'Relation? False', 'Null? False', 'Blank? False'), + # ('created', 'Relation? False', 'Null? False', 'Blank? False'), + # ('currency', 'Relation? False', 'Null? False', 'Blank? False'), + # ('object_id', 'Relation? False', 'Null? False', 'Blank? False'), + # ('term', 'Relation? False', 'Null? False', 'Blank? False'), + # ('term_type', 'Relation? False', 'Null? False', 'Blank? False'), + # ('text', 'Relation? False', 'Null? False', 'Blank? False'), + # ('secure_deal_only', 'Relation? False', 'Null? False', 'Blank? True'), + fields = ( 'budget', 'currency', 'term', 'term_type', 'text', + 'secure_deal_only', + + # 'portfolios', + # 'files', ) - widgets = { - 'currency': forms.Select(attrs={'class': 'selectpicker'}), - 'term_type': forms.Select(attrs={'class': 'selectpicker'}), - } + # widgets = { + # 'currency': forms.Select(attrs={'class': 'selectpicker'}), + # 'term_type': forms.Select(attrs={'class': 'selectpicker'}), + # } class StageForm(forms.ModelForm): diff --git a/projects/templates/project_detail.html b/projects/templates/project_detail.html index ffa3556..f54f489 100644 --- a/projects/templates/project_detail.html +++ b/projects/templates/project_detail.html @@ -144,200 +144,502 @@ {% endif %} + + + + + + + + + + + + + + + + + + + + {% if request.user.is_contractor and True %} +
+ {% elif request.user.is_contractor and False %} - {% if request.user.is_contractor %} -