Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
humanities
gargantext
Commits
607b8c71
Commit
607b8c71
authored
Sep 29, 2014
by
Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adding path file
parent
c57bbc5a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
admin.py
documents/admin.py
+3
-4
models.py
documents/models.py
+3
-1
No files found.
documents/admin.py
View file @
607b8c71
...
...
@@ -3,7 +3,7 @@ from django.contrib import admin
# Register your models here.
from
nested_inlines.admin
import
NestedModelAdmin
,
NestedStackedInline
,
NestedTabularInline
from
documents.models
import
Databas
e
,
Language
,
Project
,
Corpus
,
Document
,
Ngram
,
NgramDocument
,
List
,
ListNgram
from
documents.models
import
Sourc
e
,
Language
,
Project
,
Corpus
,
Document
,
Ngram
,
NgramDocument
,
List
,
ListNgram
class
DocumentInLine
(
admin
.
StackedInline
):
model
=
Document
...
...
@@ -40,10 +40,9 @@ class ProjectAdmin(admin.ModelAdmin):
class
CorpusAdmin
(
admin
.
ModelAdmin
):
exclude
=
(
'analyst'
,)
list_display
=
(
'title'
,
'date'
,
'
database'
,
'
analyst'
)
list_display
=
(
'title'
,
'date'
,
'analyst'
)
#inlines = [DocumentInLine,]
def
has_change_permission
(
self
,
request
,
obj
=
None
):
has_class_permission
=
super
(
CorpusAdmin
,
self
)
.
has_change_permission
(
request
,
obj
)
if
not
has_class_permission
:
...
...
@@ -104,7 +103,7 @@ class ListNgramAdmin(admin.ModelAdmin):
list_per_page
=
20
admin
.
site
.
register
(
Databas
e
)
admin
.
site
.
register
(
Sourc
e
)
admin
.
site
.
register
(
Language
)
admin
.
site
.
register
(
Project
,
ProjectAdmin
)
...
...
documents/models.py
View file @
607b8c71
...
...
@@ -10,6 +10,8 @@ from django_hstore import hstore
# PROJECT / CORPUS / DOCUMENT
######################################################################
def
upload_to
(
instance
,
filename
):
return
'images/
%
s/
%
s'
%
(
instance
.
user
.
user
.
username
,
filename
)
class
Source
(
models
.
Model
):
"""
...
...
@@ -56,7 +58,7 @@ class Corpus(models.Model):
title
=
models
.
CharField
(
max_length
=
300
,
blank
=
True
)
subtitle
=
models
.
CharField
(
max_length
=
300
,
blank
=
True
)
zip_file
=
models
.
FileField
(
upload_to
=
'documents'
,
blank
=
True
)
zip_file
=
models
.
FileField
(
upload_to
=
upload_to
,
blank
=
True
)
others
=
hstore
.
DictionaryField
(
blank
=
True
,
null
=
True
)
objects
=
hstore
.
HStoreManager
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment