Some updates regarding contributions

This commit is contained in:
Patrick Jentsch 2022-11-18 11:51:41 +01:00
parent 3004334d05
commit 821571e97f
4 changed files with 19 additions and 15 deletions

View File

@ -42,7 +42,6 @@
version: '3.2.0'
compatible_service_versions:
- '0.1.0'
- 'test'
- title: 'Spanish'
description: 'Spanish pipeline optimized for CPU. Components: tok2vec, morphologizer, parser, senter, ner, attribute_ruler, lemmatizer.'
url: 'https://github.com/explosion/spacy-models/releases/download/es_core_news_md-3.2.0/es_core_news_md-3.2.0.tar.gz'

View File

@ -1,6 +1,5 @@
from datetime import datetime, timedelta
from enum import Enum, IntEnum
import re
from flask import current_app, url_for
from flask_hashids import HashidMixin
from flask_login import UserMixin
@ -550,6 +549,10 @@ class TesseractOCRPipelineModel(FileMixin, HashidMixin, db.Model):
str(self.id)
)
@property
def jsonpatch_path(self):
return f'{self.user.jsonpatch_path}/tesseract_ocr_pipeline_models/{self.hashid}'
@property
def url(self):
return url_for(
@ -557,6 +560,10 @@ class TesseractOCRPipelineModel(FileMixin, HashidMixin, db.Model):
tesseract_ocr_pipeline_model_id=self.id
)
@property
def user_hashid(self):
return self.user.hashid
@staticmethod
def insert_defaults():
nopaque_user = User.query.filter_by(username='nopaque').first()
@ -665,6 +672,10 @@ class SpaCyNLPPipelineModel(FileMixin, HashidMixin, db.Model):
str(self.id)
)
@property
def jsonpatch_path(self):
return f'{self.user.jsonpatch_path}/spacy_nlp_pipeline_models/{self.hashid}'
@property
def url(self):
return url_for(
@ -672,6 +683,10 @@ class SpaCyNLPPipelineModel(FileMixin, HashidMixin, db.Model):
spacy_nlp_pipeline_model_id=self.id
)
@property
def user_hashid(self):
return self.user.hashid
@staticmethod
def insert_defaults():
nopaque_user = User.query.filter_by(username='nopaque').first()

View File

@ -123,12 +123,7 @@ class SpaCyNLPPipelineModelList extends RessourceList {
let spaCyNLPPipelineModelId = spaCyNLPPipelineModelElement.dataset.id;
switch (action) {
case 'share-request': {
let shared;
if (actionSwitchElement.querySelector('input').checked) {
shared = true;
} else {
shared = false;
}
let shared = actionSwitchElement.querySelector('input').checked;
Utils.shareSpaCyNLPPipelineModelRequest(this.userId, spaCyNLPPipelineModelId, shared);
break;
}

View File

@ -123,12 +123,7 @@ class TesseractOCRPipelineModelList extends RessourceList {
let tesseractOCRPipelineModelId = tesseractOCRPipelineModelElement.dataset.id;
switch (action) {
case 'share-request': {
let shared;
if (actionSwitchElement.querySelector('input').checked) {
shared = true;
} else {
shared = false;
}
let shared = actionSwitchElement.querySelector('input').checked;
Utils.shareTesseractOCRPipelineModelRequest(this.userId, tesseractOCRPipelineModelId, shared);
break;
}