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
08769216
Commit
08769216
authored
Feb 06, 2013
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add field to record plural type (issue #205)
parent
7f05244b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
0 deletions
+48
-0
weblate/lang/migrations/0003_auto__add_field_language_plural_type.py
...g/migrations/0003_auto__add_field_language_plural_type.py
+35
-0
weblate/lang/models.py
weblate/lang/models.py
+13
-0
No files found.
weblate/lang/migrations/0003_auto__add_field_language_plural_type.py
0 → 100644
View file @
08769216
# -*- coding: utf-8 -*-
import
datetime
from
south.db
import
db
from
south.v2
import
SchemaMigration
from
django.db
import
models
class
Migration
(
SchemaMigration
):
def
forwards
(
self
,
orm
):
# Adding field 'Language.plural_type'
db
.
add_column
(
'lang_language'
,
'plural_type'
,
self
.
gf
(
'django.db.models.fields.IntegerField'
)(
default
=
1
),
keep_default
=
False
)
def
backwards
(
self
,
orm
):
# Deleting field 'Language.plural_type'
db
.
delete_column
(
'lang_language'
,
'plural_type'
)
models
=
{
'lang.language'
:
{
'Meta'
:
{
'ordering'
:
"['name']"
,
'object_name'
:
'Language'
},
'code'
:
(
'django.db.models.fields.SlugField'
,
[],
{
'unique'
:
'True'
,
'max_length'
:
'50'
}),
'direction'
:
(
'django.db.models.fields.CharField'
,
[],
{
'default'
:
"'ltr'"
,
'max_length'
:
'3'
}),
'id'
:
(
'django.db.models.fields.AutoField'
,
[],
{
'primary_key'
:
'True'
}),
'name'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'100'
}),
'nplurals'
:
(
'django.db.models.fields.SmallIntegerField'
,
[],
{
'default'
:
'0'
}),
'plural_type'
:
(
'django.db.models.fields.IntegerField'
,
[],
{
'default'
:
'1'
}),
'pluralequation'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'255'
,
'blank'
:
'True'
})
}
}
complete_apps
=
[
'lang'
]
\ No newline at end of file
weblate/lang/models.py
View file @
08769216
...
@@ -341,6 +341,15 @@ post_syncdb.connect(setup_lang)
...
@@ -341,6 +341,15 @@ post_syncdb.connect(setup_lang)
class
Language
(
models
.
Model
):
class
Language
(
models
.
Model
):
PLURAL_NONE
=
0
PLURAL_CLASSIC
=
1
PLURAL_SLAVIC
=
2
PLURAL_CHOICES
=
(
(
PLURAL_NONE
,
'None'
),
(
PLURAL_CLASSIC
,
'Classic plural'
),
(
PLURAL_SLAVIC
,
'Slavic languages'
),
)
code
=
models
.
SlugField
(
unique
=
True
)
code
=
models
.
SlugField
(
unique
=
True
)
name
=
models
.
CharField
(
max_length
=
100
)
name
=
models
.
CharField
(
max_length
=
100
)
nplurals
=
models
.
SmallIntegerField
(
default
=
0
)
nplurals
=
models
.
SmallIntegerField
(
default
=
0
)
...
@@ -350,6 +359,10 @@ class Language(models.Model):
...
@@ -350,6 +359,10 @@ class Language(models.Model):
default
=
'ltr'
,
default
=
'ltr'
,
choices
=
((
'ltr'
,
'ltr'
),
(
'rtl'
,
'rtl'
)),
choices
=
((
'ltr'
,
'ltr'
),
(
'rtl'
,
'rtl'
)),
)
)
plural_type
=
models
.
IntegerField
(
choices
=
PLURAL_CHOICES
,
default
=
PLURAL_CLASSIC
)
objects
=
LanguageManager
()
objects
=
LanguageManager
()
...
...
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