Merge pull request 'temporal push to share progress' (#53) from scratch into main

Reviewed-on: https://gitea.pangea.org/trustchain-oc1-orchestral/IdHub/pulls/53
This commit is contained in:
daniel 2023-09-28 10:00:35 +00:00
commit ba3f6a9385
6 changed files with 54 additions and 4 deletions

3
.gitignore vendored Normal file
View file

@ -0,0 +1,3 @@
.idea
db.sqlite3
__pycache__/

View file

@ -1,3 +1,28 @@
from django.db import models from django.db import models
from django.contrib.auth.models import User as DjangoUser
# Create your models here.
class User(DjangoUser):
# Ya incluye "first_name", "last_name", "email", y "date_joined" heredando de la clase User de django.
# Falta ver que más información hay que añadir a nuestros usuarios, como los roles etc.
pass
class Event(models.Model):
# Para los "audit logs" que se requieren en las pantallas.
timestamp = models.DateTimeField()
kind = "PLACEHOLDER"
class DID(models.Model):
did_string = models.CharField(max_length=250)
# kind = "KEY|JWK|WEB|EBSI|CHEQD|IOTA"
class VerifiableCredential(models.Model):
id_string = models.CharField(max_length=250)
data = models.TextField()
verified = models.BooleanField()
created_on = models.DateTimeField()
did_issuer = models.ForeignKey(DID, on_delete=models.PROTECT)
did_subject = models.ForeignKey(DID, on_delete=models.PROTECT)

8
idhub/urls.py Normal file
View file

@ -0,0 +1,8 @@
from django.urls import path
from . import views
urlpatterns = [
path("", views.index, name="index"),
path("user/", views.user, name="user")
]

View file

@ -1,3 +1,15 @@
from django.shortcuts import render from django.shortcuts import render
from .models import User
# Create your views here.
from django.shortcuts import redirect, render
def index(request):
return redirect("/user")
def user(request):
uid = request.user
user = User.get(uid)
context = { userdata: user }
return render(request, "polls/user.html", context)

View file

@ -37,6 +37,7 @@ INSTALLED_APPS = [
'django.contrib.sessions', 'django.contrib.sessions',
'django.contrib.messages', 'django.contrib.messages',
'django.contrib.staticfiles', 'django.contrib.staticfiles',
'idhub'
] ]
MIDDLEWARE = [ MIDDLEWARE = [

View file

@ -15,8 +15,9 @@ Including another URLconf
2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) 2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
""" """
from django.contrib import admin from django.contrib import admin
from django.urls import path from django.urls import path, include
urlpatterns = [ urlpatterns = [
path('admin/', admin.site.urls), path('django-admin/', admin.site.urls),
path('/', include("idhub.urls"))
] ]