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
67d3b28d
Commit
67d3b28d
authored
Oct 20, 2014
by
Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adapting resource
parent
8e5cd7a1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
12 deletions
+4
-12
admin.py
node/admin.py
+2
-5
models.py
node/models.py
+2
-7
No files found.
node/admin.py
View file @
67d3b28d
...
@@ -4,8 +4,8 @@ from django.forms import ModelForm, ModelChoiceField
...
@@ -4,8 +4,8 @@ from django.forms import ModelForm, ModelChoiceField
from
node.models
import
NodeType
,
Language
,
Node
,
Project
,
Corpus
,
Document
from
node.models
import
NodeType
,
Language
,
Node
,
Project
,
Corpus
,
Document
class
NodeAdmin
(
admin
.
ModelAdmin
):
class
NodeAdmin
(
admin
.
ModelAdmin
):
exclude
=
(
'user'
,
'
type'
,
'
path'
,
'depth'
,
'numchild'
)
exclude
=
(
'user'
,
'path'
,
'depth'
,
'numchild'
)
list_display
=
(
'name'
,
'date'
,
'file'
)
list_display
=
(
'name'
,
'date'
)
search_fields
=
(
'name'
,)
search_fields
=
(
'name'
,)
# list_filter = ('type',)
# list_filter = ('type',)
# date_hierarchy
# date_hierarchy
...
@@ -49,7 +49,6 @@ class NodeAdmin(admin.ModelAdmin):
...
@@ -49,7 +49,6 @@ class NodeAdmin(admin.ModelAdmin):
parent
=
nodeParent
,
\
parent
=
nodeParent
,
\
user
=
request
.
user
,
\
user
=
request
.
user
,
\
name
=
obj
.
name
,
\
name
=
obj
.
name
,
\
file
=
obj
.
file
,
\
metadata
=
obj
.
metadata
)
metadata
=
obj
.
metadata
)
#nodeParent.save()
#nodeParent.save()
...
@@ -69,7 +68,6 @@ class ProjectAdmin(NodeAdmin):
...
@@ -69,7 +68,6 @@ class ProjectAdmin(NodeAdmin):
from
django.db.models.query
import
EmptyQuerySet
from
django.db.models.query
import
EmptyQuerySet
class
CorpusForm
(
ModelForm
):
class
CorpusForm
(
ModelForm
):
parent
=
ModelChoiceField
(
EmptyQuerySet
)
parent
=
ModelChoiceField
(
EmptyQuerySet
)
...
@@ -106,7 +104,6 @@ class LanguageAdmin(admin.ModelAdmin):
...
@@ -106,7 +104,6 @@ class LanguageAdmin(admin.ModelAdmin):
def
get_queryset
(
self
,
request
):
def
get_queryset
(
self
,
request
):
return
Language
.
objects
.
filter
(
implemented
=
1
)
return
Language
.
objects
.
filter
(
implemented
=
1
)
class
Meta
:
class
Meta
:
ordering
=
[
'fullname'
,]
ordering
=
[
'fullname'
,]
...
...
node/models.py
View file @
67d3b28d
...
@@ -39,6 +39,7 @@ class Ngram(models.Model):
...
@@ -39,6 +39,7 @@ class Ngram(models.Model):
class
Resource
(
models
.
Model
):
class
Resource
(
models
.
Model
):
guid
=
models
.
CharField
(
max_length
=
255
)
guid
=
models
.
CharField
(
max_length
=
255
)
bdd_type
=
models
.
ForeignKey
(
DatabaseType
,
blank
=
True
,
null
=
True
)
file
=
models
.
FileField
(
upload_to
=
upload_to
,
blank
=
True
)
file
=
models
.
FileField
(
upload_to
=
upload_to
,
blank
=
True
)
class
NodeType
(
models
.
Model
):
class
NodeType
(
models
.
Model
):
...
@@ -58,13 +59,7 @@ class Node(CTENode):
...
@@ -58,13 +59,7 @@ class Node(CTENode):
date
=
models
.
DateField
(
default
=
timezone
.
now
,
blank
=
True
)
date
=
models
.
DateField
(
default
=
timezone
.
now
,
blank
=
True
)
metadata
=
hstore
.
DictionaryField
(
blank
=
True
)
metadata
=
hstore
.
DictionaryField
(
blank
=
True
)
# the 'file' column should be deprecated soon;
resource
=
models
.
ForeignKey
(
Resource
,
blank
=
True
,
null
=
True
)
# use resources instead.
file
=
models
.
FileField
(
upload_to
=
upload_to
,
blank
=
True
)
bdd_type
=
models
.
ForeignKey
(
DatabaseType
,
blank
=
True
,
null
=
True
)
#resources = models.ManyToManyField(Resource)
#resource = models.ForeignKey(Resource, blank=True, null=True)
#ngrams = models.ManyToManyField(NGrams)
#ngrams = models.ManyToManyField(NGrams)
...
...
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