Commit graph

15 commits

Author SHA1 Message Date
Petr Viktorin
85d779ba83 Move Markdown handling to the translation classes
- the Session has a `pokedex_link_maker` property, whose `object_url`
  method is used to make URLs in Markdown
- pokemon.names_table.name is now an ordinary Unicode column
- pokemon.name is a MarkdownString that is aware of the session and the
  language the string is in
- pokemon.name_map is a dict-like association_proxy of the above
- move.effect works similarly, with transparent $effect_chance substitution
  as before
2011-04-28 23:42:56 +03:00
Petr Viktorin
10d9bc83b3 Mark MoveEffect.effect as a Markdown column.
Also relax the appropriate test
2011-04-12 09:51:51 +03:00
Petr Viktorin
5d18ae7ab6 Make the schema tests pass 2011-04-12 09:06:02 +03:00
Eevee
08bfd753e0 Fix default language assignment once and for all.
Stop trying to be clever and magical and just make the caller pass in a
damn primary key.
2011-04-10 00:54:14 -07:00
Petr Viktorin
4291c33c00 Make MultilangSession's language class configurable 2011-04-04 21:51:35 +03:00
Petr Viktorin
a06498cb39 Make a bunch of text columns nullable to support missing translations 2011-04-03 20:08:05 +03:00
Eevee
d90db39d43 Fix the i18n test; now uses multilang's session subclasses. 2011-04-03 01:26:31 -07:00
Petr Viktorin
7b93c11f7e Reorder the classes in tables.py alphabetically. Also, test the order. 2011-04-01 16:08:56 -07:00
Petr Viktorin
97bf4cfe45 Update test_schema to the new API. Add some missing column metadata. 2011-04-01 15:59:53 -07:00
Eevee
68e14e663e Started switching to create_translation_table.
- Moved the function to its own file.
- Implemented the session-based default language switching.
- Migrated a couple tables.
2011-03-21 22:32:52 -07:00
Eevee
6a9172151a Sigh! Remove support for strings as keys; use Language objects. 2011-03-21 17:54:28 -07:00
Eevee
1da816af4b New i18n schema thing impl, and fixed the new tests to match. 2011-03-20 01:06:45 -07:00
Eevee
542aa670ae Added a test for the i18n dynamic table generation.
It fails spectacularly, but hopefully documents what I'm ultimately
going for.
2011-03-18 18:22:18 -07:00
Petr Viktorin
b3c7689d41 Replace all_tables by table_classes; get rid of globals() 2011-03-13 15:43:00 -07:00
Petr Viktorin
d813e24b25 I18n for the database schema
- Helper base class: Named
  Subclasses: OfficiallyNamed, UnofficiallyNamed
  for these, a 'name' column is created in the appropriate text table
  also, they get automatic __str__/__repr__/__unicode__
- Faux columns: ProseColumn, TextColumn
  these become columns in the appropriate text tables
  these text tables (*_text, *_prose) are auto-generated at the end
  the main table gets one property (singular name) that gets the English text
   and one (plural name) with dict of texts keyed by language
- Every named table gets 'identifier'
- Languages compare & hash equal to their identifiers
- Existing foreign-name tables replaced by the autogenerated ones
- order_by: names replaced by identifiers
- New function: all_tables(), yields all tables
- Markdown move properties removed for now
- Schema test suite
2011-03-13 15:10:10 -07:00