Browse Source

Created initial files and application directories

TonyKurts 1 year ago
parent
commit
6fe3ec7d73
15 changed files with 92 additions and 0 deletions
  1. 10 0
      README.md
  2. 0 0
      __init__.py
  3. 3 0
      admin.py
  4. 6 0
      apps.py
  5. 0 0
      forms/__init__.py
  6. 20 0
      forms/service_create.py
  7. 1 0
      models.py
  8. 15 0
      templates/base.html
  9. 8 0
      templates/home.html
  10. 5 0
      templates/service_create.html
  11. 1 0
      tests.py
  12. 11 0
      urls.py
  13. 0 0
      views/__init__.py
  14. 4 0
      views/home.py
  15. 8 0
      views/service_create.py

+ 10 - 0
README.md

@@ -5,9 +5,19 @@ User web-interface for ShariX services. It implies interaction with the list of
 # Application definition
 
 ```python
+# core/settings.py
 INSTALLED_APPS = [
     # ...
     'platformrunning.apps.PlatformrunningConfig',
     # ...
 ]
+```
+
+```python
+# core/urls.py
+urlpatterns = [
+    # ...
+    path('platformrunning/', include('platformrunning.urls', namespace='platformrunning'), name='platformrunning')
+    # ...
+]
 ```

+ 0 - 0
__init__.py


+ 3 - 0
admin.py

@@ -0,0 +1,3 @@
+from django.contrib import admin
+
+# Register your models here.

+ 6 - 0
apps.py

@@ -0,0 +1,6 @@
+from django.apps import AppConfig
+
+
+class PlatformrunningConfig(AppConfig):
+    default_auto_field = 'django.db.models.BigAutoField'
+    name = 'platformrunning'

+ 0 - 0
forms/__init__.py


+ 20 - 0
forms/service_create.py

@@ -0,0 +1,20 @@
+from django import forms
+from metaservicesynced.models.company import Company 
+
+class Service_Create__form(forms.ModelForm):
+    # def form_valid(self, form):
+    #     form.instance.user_id_who = self.request.user.pk
+    #     return super().form_valid(form)
+
+    class Meta:
+        model = Company
+        fields = "__all__"
+
+        # widgets = {
+        #     "user_id_who": forms.HiddenInput(),
+        #     "user_id_whom": forms.HiddenInput(),
+        #     "id_metaservice": forms.HiddenInput(),
+        #     "status": forms.HiddenInput(),
+        #     "requirements": forms.HiddenInput(),
+        #     "status": forms.HiddenInput(),
+        # }

+ 1 - 0
models.py

@@ -0,0 +1 @@
+from django.db import models

+ 15 - 0
templates/base.html

@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
+    <title>platformrunning</title>
+    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
+</head>
+
+<body>
+    <h1>platformrunning</h1>
+    {% block content %}
+    {% endblock %}
+</body>
+</html>

+ 8 - 0
templates/home.html

@@ -0,0 +1,8 @@
+{% extends 'base.html' %}
+
+{% block content %}
+    <ul>
+        <li><a href="{% url 'platformrunning:service_create' %}">Create a Service</a></li>
+        {% comment %} <li><a href="{% url 'platformrunning:service_connect' %}">Connect to the Service</a></li>{% endcomment %}
+    </ul>
+{% endblock %}

+ 5 - 0
templates/service_create.html

@@ -0,0 +1,5 @@
+{% extends 'base.html' %}
+
+{% block content %}
+    <h2>Create a Service</h2>
+{% endblock %}

+ 1 - 0
tests.py

@@ -0,0 +1 @@
+from django.test import TestCase

+ 11 - 0
urls.py

@@ -0,0 +1,11 @@
+from django.urls import path, include
+
+# Views
+from .views.home import home__view
+from .views.service_create import Service_Create__view
+
+app_name = 'platformrunning'
+urlpatterns = [
+    path("", home__view, name="home"),
+    path("service_create", Service_Create__view.as_view(), name="service_create"),
+]

+ 0 - 0
views/__init__.py


+ 4 - 0
views/home.py

@@ -0,0 +1,4 @@
+from django.shortcuts import render
+
+def home__view(request):
+    return render(request, "home.html")

+ 8 - 0
views/service_create.py

@@ -0,0 +1,8 @@
+from django.views.generic.edit import CreateView
+from metaservicesynced.models.company import Company
+from ..forms.service_create import Service_Create__form
+
+class Service_Create__view(CreateView):
+    model = Company
+    form_class = Service_Create__form
+    template_name = 'service_create.html'