temporal push to share progress
This commit is contained in:
parent
05cad79560
commit
8f04bc16db
|
@ -0,0 +1,3 @@
|
|||
.idea
|
||||
db.sqlite3
|
||||
__pycache__/
|
|
@ -1,3 +1,28 @@
|
|||
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)
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
from django.urls import path
|
||||
|
||||
from . import views
|
||||
|
||||
urlpatterns = [
|
||||
path("", views.index, name="index"),
|
||||
path("user/", views.user, name="user")
|
||||
]
|
|
@ -1,3 +1,15 @@
|
|||
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)
|
|
@ -37,6 +37,7 @@ INSTALLED_APPS = [
|
|||
'django.contrib.sessions',
|
||||
'django.contrib.messages',
|
||||
'django.contrib.staticfiles',
|
||||
'idhub'
|
||||
]
|
||||
|
||||
MIDDLEWARE = [
|
||||
|
|
|
@ -15,8 +15,9 @@ Including another URLconf
|
|||
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
||||
"""
|
||||
from django.contrib import admin
|
||||
from django.urls import path
|
||||
from django.urls import path, include
|
||||
|
||||
urlpatterns = [
|
||||
path('admin/', admin.site.urls),
|
||||
path('django-admin/', admin.site.urls),
|
||||
path('/', include("idhub.urls"))
|
||||
]
|
||||
|
|
Loading…
Reference in New Issue