From 804153b108904eb5a4ed7d9513b69a9f2cdf52bc Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 23 Aug 2023 03:57:40 +0000 Subject: [PATCH] fix test --- doc/development.md | 2 ++ takahe/migrations/0001_initial.py | 53 ++++++++++++++++++++++++++++--- 2 files changed, 51 insertions(+), 4 deletions(-) diff --git a/doc/development.md b/doc/development.md index ae40e71a..faa06714 100644 --- a/doc/development.md +++ b/doc/development.md @@ -54,6 +54,8 @@ To debug source code with `docker compose`, add `NEODB_DEBUG=True` in `.env`, an - use `dev-shell` and `dev-root` to invoke shells, instead of `shell` and `root` - there's no automatic `migration` container, but it can be triggered manually via `docker compose run dev-shell neodb-init` +Also note: debugging in this way requires `${NEODB_SRC}/.venv` and `${TAKAHE_SRC}/.venv` both ready with all the requirements installed, and python binary pointing to `/usr/local/bin/python` (because that's where python is in the docker base image). + Applications ------------ Main django apps for NeoDB: diff --git a/takahe/migrations/0001_initial.py b/takahe/migrations/0001_initial.py index 7b51373e..b7c8e206 100644 --- a/takahe/migrations/0001_initial.py +++ b/takahe/migrations/0001_initial.py @@ -1,5 +1,7 @@ # Generated by Django 4.2.4 on 2023-08-12 16:48 +import functools + import django.db.models.deletion import django.utils.timezone from django.db import migrations, models @@ -126,13 +128,21 @@ class Migration(migrations.Migration): ("state_changed", models.DateTimeField(auto_now_add=True)), ("local", models.BooleanField(db_index=True)), ("username", models.CharField(blank=True, max_length=500, null=True)), - ("name", models.CharField(blank=True, max_length=500, null=True)), - ("summary", models.TextField(blank=True, null=True)), + ( + "name", + models.CharField( + blank=True, max_length=500, null=True, verbose_name="昵称" + ), + ), + ("summary", models.TextField(blank=True, null=True, verbose_name="简介")), ( "manually_approves_followers", - models.BooleanField(blank=True, null=True), + models.BooleanField(default=False, verbose_name="手工审核关注者"), + ), + ( + "discoverable", + models.BooleanField(default=True, verbose_name="允许被发现或推荐"), ), - ("discoverable", models.BooleanField(default=True)), ( "profile_uri", models.CharField(blank=True, max_length=500, null=True), @@ -193,6 +203,41 @@ class Migration(migrations.Migration): "db_table": "users_identity", }, ), + migrations.AddField( + model_name="identity", + name="icon", + field=models.ImageField( + blank=True, + null=True, + storage=takahe.models.upload_store, + upload_to=functools.partial( + takahe.models.upload_namer, *("profile_images",), **{} + ), + verbose_name="头像", + ), + ), + migrations.AddField( + model_name="identity", + name="image", + field=models.ImageField( + blank=True, + null=True, + storage=takahe.models.upload_store, + upload_to=functools.partial( + takahe.models.upload_namer, *("background_images",), **{} + ), + ), + ), + migrations.AddField( + model_name="identity", + name="state_locked_until", + field=models.DateTimeField(blank=True, db_index=True, null=True), + ), + migrations.AddField( + model_name="identity", + name="state_next_attempt", + field=models.DateTimeField(blank=True, null=True), + ), migrations.CreateModel( name="Post", fields=[