Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions BackEnd_PlanItNow/schema.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import graphene
import graphql_jwt
import plans.schema
import users.schema

import friendship.schema
import plans.schema
import userprofiles.schema
import users.schema


class Query(plans.schema.Query,
Expand Down
3 changes: 2 additions & 1 deletion BackEnd_PlanItNow/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
# Database
# https://docs.djangoproject.com/en/3.1/ref/settings/#databases

'''

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
Expand All @@ -101,6 +101,7 @@
default=config('DATABASE_URL')
)
}
'''


# Password validation
Expand Down
2 changes: 1 addition & 1 deletion BackEnd_PlanItNow/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
from django.contrib import admin
from django.urls import path
from django.views.decorators.csrf import csrf_exempt

from graphene_django.views import GraphQLView

from BackEnd_PlanItNow.schema import schema

urlpatterns = [
Expand Down
Binary file modified db.sqlite3
Binary file not shown.
2 changes: 1 addition & 1 deletion friendship/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Generated by Django 3.1.4 on 2021-09-03 19:23

from django.db import migrations, models
import django.db.models.deletion
from django.db import migrations, models


class Migration(migrations.Migration):
Expand Down
6 changes: 4 additions & 2 deletions friendship/models.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from userprofiles.models import UserProfile
from django.db import models
from enum import Enum

from django.db import models

from userprofiles.models import UserProfile


class FriendRequestStatus(Enum):
"""Stores the different friendship request status"""
Expand Down
7 changes: 3 additions & 4 deletions friendship/schema.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
from friendship.models import FriendRequest
from friendship.models import FriendRequestStatus
from userprofiles.models import UserProfile

import graphene
from graphene_django import DjangoObjectType

from friendship.models import FriendRequest, FriendRequestStatus
from userprofiles.models import UserProfile


class FriendRequestType(DjangoObjectType):
class Meta:
Expand Down
6 changes: 3 additions & 3 deletions manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@

def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'BackEnd_PlanItNow.settings')
os.environ.setdefault('DJANGO_SETTINGS_MODULE',
'BackEnd_PlanItNow.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from exc
"forget to activate a virtual environment?") from exc
execute_from_command_line(sys.argv)


Expand Down
3 changes: 2 additions & 1 deletion plans/admin.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from django.contrib import admin

from plans.models import Plan

# Register your models.py here.
admin.site.register(Plan)
admin.site.register(Plan)
2 changes: 1 addition & 1 deletion plans/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Generated by Django 3.1.4 on 2021-09-03 19:21

import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):
Expand Down
5 changes: 3 additions & 2 deletions plans/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from userprofiles.models import UserProfile
from django.db import models
from django.contrib.auth import get_user_model
from django.db import models

from userprofiles.models import UserProfile


# PlanModel
Expand Down
9 changes: 4 additions & 5 deletions plans/schema.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import graphene

from datetime import date

import graphene
from django.db.models import Q
from graphene_django import DjangoObjectType
from plans.models import Plan
from plans.models import PlanParticipation

from plans.models import Plan, PlanParticipation
from userprofiles.models import UserProfile
from django.db.models import Q


class PlanType(DjangoObjectType):
Expand Down
2 changes: 1 addition & 1 deletion recommendation/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Generated by Django 3.1.4 on 2021-09-03 19:21

from django.db import migrations, models
import django.db.models.deletion
from django.db import migrations, models


class Migration(migrations.Migration):
Expand Down
1 change: 1 addition & 0 deletions recommendation/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from django.db import models

from plans.models import Plan
from userprofiles.models import UserProfile

Expand Down
25 changes: 10 additions & 15 deletions recommendation/utils.py
Original file line number Diff line number Diff line change
@@ -1,29 +1,24 @@
"""De momento este utils va a ser una forma de probar scripts. Ya lo cambiaré más adelanteG"""
from datetime import date

from deep_translator import GoogleTranslator
from deep_translator.exceptions import NotValidPayload

from plans.models import Plan
from recommendation.models import Lemma
from recommendation.models import UserDistance

from userprofiles.models import UserProfile
### PLN ###

import requests
import numpy as np
import emoji
import regex
import string

import nltk
from collections import Counter

from nltk.corpus import stopwords
from deep_translator import GoogleTranslator

from nltk.corpus import words
from nltk.tokenize import word_tokenize
from nltk.stem import WordNetLemmatizer
from nltk.corpus import wordnet as wn
from nltk.tokenize import word_tokenize

from plans.models import Plan

### PLN ###
from recommendation.models import Lemma, UserDistance
from userprofiles.models import UserProfile


def translate_all_plans():
Expand Down
2 changes: 1 addition & 1 deletion userprofiles/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Generated by Django 3.1.4 on 2021-09-03 19:24

import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):
Expand Down
5 changes: 3 additions & 2 deletions userprofiles/schema.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from userprofiles.models import UserProfile
from django.contrib.auth import get_user_model
import graphene
from django.contrib.auth import get_user_model
from graphene_django import DjangoObjectType

from userprofiles.models import UserProfile


class UserProfileType(DjangoObjectType):
class Meta:
Expand Down
8 changes: 4 additions & 4 deletions users/schema.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from django.contrib.auth import get_user_model
from userprofiles.schema import UserProfileType
from userprofiles.models import UserProfile

import graphene
from django.contrib.auth import get_user_model
from graphene_django import DjangoObjectType

from userprofiles.models import UserProfile
from userprofiles.schema import UserProfileType


class UserType(DjangoObjectType):
class Meta:
Expand Down
Empty file added users/tests/__init__.py
Empty file.