小编get*_*up8的帖子

What's the best way to put two inputs side by side in a form using Bulma CSS?

I just started using Bulma to style my site and am having a hard time figuring out whether the framework supports putting two form fields side-by-side. The best example would be first and last name of a user.

Bulma's form group looked promising but it doesn't seem to work if you want two separate fields.

I also started using the grid (columns and column classes) but it got messy with spacing.

Here's what I'm trying to do (the first …

bulma

4
推荐指数
3
解决办法
4177
查看次数

在 Django Model 数据库函数中使用 Unaccent

unaccent在 Postgres 中安装了扩展,并且简单的过滤器在我的 Django 应用程序中运行良好,例如:

q = 'hello'
queryset.filter(name__unaccent__startswith=q)
Run Code Online (Sandbox Code Playgroud)

我现在尝试使用搜索索引注释查询集结果:

queryset.annotate(search_index=StrIndex(Lower('name'), Value(q)))
Run Code Online (Sandbox Code Playgroud)

对于非重音文本来说,这本身就很好用,但我正在尝试找出一种将 UNACCENT 应用于 name 变量的方法。本质上:

SELECT
  -- This is what I want!
  STRPOS(LOWER(UNACCENT(core_ingredient.name)::text), 'hello') AS search_index_unaccented,
  STRPOS(LOWER(core_ingredient.name), 'hello') AS search_index_basic
FROM
  -- ...
Run Code Online (Sandbox Code Playgroud)

我试过了:

# This has no effect, gives same query / result as above
queryset.annotate(search_index=StrIndex(Lower('name__unaccent'), Value(q)))
Run Code Online (Sandbox Code Playgroud)

我看过这个答案: How use `unaccent` with full text search in django 1.10? 但感觉不需要那样。

python django

4
推荐指数
1
解决办法
3712
查看次数

标签 统计

bulma ×1

django ×1

python ×1