Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
93504538
Commit
93504538
authored
Feb 05, 2016
by
Jitka Novotna
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
models with slug
parent
f31272fc
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
5 deletions
+48
-5
weblate/html/index.html
weblate/html/index.html
+1
-1
weblate/trans/admin.py
weblate/trans/admin.py
+1
-1
weblate/trans/migrations/0059_auto_20160205_1349.py
weblate/trans/migrations/0059_auto_20160205_1349.py
+30
-0
weblate/trans/models/componentlist.py
weblate/trans/models/componentlist.py
+16
-3
No files found.
weblate/html/index.html
View file @
93504538
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
<li><a
href=
"#your-languages"
data-toggle=
"tab"
>
{% trans "Your languages" %}
</a></li>
<li><a
href=
"#your-languages"
data-toggle=
"tab"
>
{% trans "Your languages" %}
</a></li>
<li><a
href=
"#your-subscriptions"
data-toggle=
"tab"
>
{% trans "Your subscriptions" %}
</a></li>
<li><a
href=
"#your-subscriptions"
data-toggle=
"tab"
>
{% trans "Your subscriptions" %}
</a></li>
{% for componentlist in componentlists %}
{% for componentlist in componentlists %}
<li><a
href=
"#todo"
data-toggle=
"tab"
>
{{ componentlist.
titl
e }}
</a></li>
<li><a
href=
"#todo"
data-toggle=
"tab"
>
{{ componentlist.
nam
e }}
</a></li>
{% endfor %}
{% endfor %}
</ul>
</ul>
</li>
</li>
...
...
weblate/trans/admin.py
View file @
93504538
...
@@ -229,7 +229,7 @@ class WhiteboardAdmin(admin.ModelAdmin):
...
@@ -229,7 +229,7 @@ class WhiteboardAdmin(admin.ModelAdmin):
class
ComponentListAdmin
(
admin
.
ModelAdmin
):
class
ComponentListAdmin
(
admin
.
ModelAdmin
):
list_display
=
[
'
titl
e'
]
list_display
=
[
'
nam
e'
]
class
AdvertisementAdmin
(
admin
.
ModelAdmin
):
class
AdvertisementAdmin
(
admin
.
ModelAdmin
):
...
...
weblate/trans/migrations/0059_auto_20160205_1349.py
0 → 100644
View file @
93504538
# -*- coding: utf-8 -*-
from
__future__
import
unicode_literals
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'trans'
,
'0058_componentlist'
),
]
operations
=
[
migrations
.
RemoveField
(
model_name
=
'componentlist'
,
name
=
'title'
,
),
migrations
.
AddField
(
model_name
=
'componentlist'
,
name
=
'name'
,
field
=
models
.
CharField
(
default
=
'uhno'
,
help_text
=
'Name to display'
,
unique
=
True
,
max_length
=
100
,
verbose_name
=
'Component list name'
),
preserve_default
=
False
,
),
migrations
.
AddField
(
model_name
=
'componentlist'
,
name
=
'slug'
,
field
=
models
.
SlugField
(
default
=
'uteho'
,
max_length
=
100
,
help_text
=
'Name used in URLs and file names.'
,
unique
=
True
,
verbose_name
=
'URL slug'
),
preserve_default
=
False
,
),
]
weblate/trans/models/componentlist.py
View file @
93504538
...
@@ -29,15 +29,28 @@ from django.utils.translation import ugettext_lazy as _
...
@@ -29,15 +29,28 @@ from django.utils.translation import ugettext_lazy as _
@
python_2_unicode_compatible
@
python_2_unicode_compatible
class
ComponentList
(
models
.
Model
):
class
ComponentList
(
models
.
Model
):
title
=
models
.
CharField
(
max_length
=
100
)
name
=
models
.
CharField
(
verbose_name
=
_
(
'Component list name'
),
max_length
=
100
,
unique
=
True
,
help_text
=
_
(
'Name to display'
)
)
slug
=
models
.
SlugField
(
verbose_name
=
_
(
'URL slug'
),
db_index
=
True
,
unique
=
True
,
max_length
=
100
,
help_text
=
_
(
'Name used in URLs and file names.'
)
)
components
=
models
.
ManyToManyField
(
'SubProject'
)
components
=
models
.
ManyToManyField
(
'SubProject'
)
def
clean
(
self
):
def
clean
(
self
):
if
not
self
.
titl
e
:
if
not
self
.
nam
e
:
raise
ValidationError
(
_
(
'Name must be specified'
))
raise
ValidationError
(
_
(
'Name must be specified'
))
def
__str__
(
self
):
def
__str__
(
self
):
return
self
.
titl
e
return
self
.
nam
e
class
Meta
(
object
):
class
Meta
(
object
):
verbose_name
=
_
(
'Component list'
)
verbose_name
=
_
(
'Component list'
)
...
...
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