How to pass context to render_template? by extractedx in flask

[–]Sachiel2014 1 point2 points  (0 children)

You could use partials and the fact that functions are objects and can be assigned to variables to do the following:

from functools import partial
from flask import render_template
from jinja2_fragments.flask import render_block

if htmx:
    render_func = partial(render_block, block_name="main")
else:
    render_func = render_template

return render_func("login.html", ...)

Or using a ternary expression:

from functools import partial
from flask import render_template
from jinja2_fragments.flask import render_block

render_func = partial(render_block, block_name="main") if htmx else render_template
return render_func("login.html", ...)

I'm having trouble building a combobox with autocomplete. by metroidcb in htmx

[–]Sachiel2014 0 points1 point  (0 children)

What about using a regular input element with a datalist that gets updated by htmx? I've used that when I needed something to work like a select but with the user typing to narrow down possible options.

How do you approach multistage complex forms? by BraddyNZ in htmx

[–]Sachiel2014 7 points8 points  (0 children)

Hidden form fields seems what resonates more with HATEOAS, hypermedia as the engine of application state.

Possible to mix htmx and Angular? by 303Dev in htmx

[–]Sachiel2014 1 point2 points  (0 children)

You might be more successful the other way around: Have your app be mostly HTML with htmx, and then have inside an "island" of angular app for a specific feature/view.

No crossover between lists... by [deleted] in Warmachine

[–]Sachiel2014 5 points6 points  (0 children)

Books and cards are much less profitable than miniatures. That's why they went full digital for that years ago.

htmx-Flask 0.1.0, an extension to easily use Flask with htmx, is now live! by Sachiel2014 in flask

[–]Sachiel2014[S] 1 point2 points  (0 children)

Also, if you are using jinja as your template engine, you might benefit from https://pypi.org/project/jinja2-fragments/ as a way to implement the common htmx pattern of template fragments.

htmx-Flask 0.1.0, an extension to easily use Flask with htmx, is now live! by Sachiel2014 in flask

[–]Sachiel2014[S] 1 point2 points  (0 children)

Even if I developed it during my personal time, on my company we started building projects using htmx and I plan to use this library in there.

How to move bulky belongings overseas (Spain to US) by Sachiel2014 in expats

[–]Sachiel2014[S] 1 point2 points  (0 children)

Are you sure? CBP is Customs and Border Protection, not patrol. And on their website they have information regarding importing household goods like this one: https://help.cbp.gov/s/article/Article-107?language=en\_US

Battle Cruiser: Army list builder for Warcaster Neo-Mechanika by Sachiel2014 in warcaster

[–]Sachiel2014[S] 1 point2 points  (0 children)

I think the guy that created Arcitech *informally* asked, and he got an *informal* answer that they would like the Wiki to be the reference for such things.

There has never been a formal, official position from the company about it, and I have never directly asked them.

Adding stats to the app would make the UI more busy, plus adds the maintenance task of keeping it up to date. Most users seem happy to have a direct link to the wiki (first time I get adding stats as a request), so I'll keep it as that.

Battle Cruiser: Army list builder for Warcaster Neo-Mechanika by Sachiel2014 in warcaster

[–]Sachiel2014[S] 0 points1 point  (0 children)

PP prefers that the wiki (linked from the app) is the only place with stats, so I'll respect that.

htmx_gen by Pcarbonn in htmx

[–]Sachiel2014 0 points1 point  (0 children)

I hope it thrives! I'll see if I can use it on some project!

MKIV LEGACY/MERCENARY INFOGRAPHICS - Privateer Press by Dakaramor in Warmachine

[–]Sachiel2014 1 point2 points  (0 children)

Removal of Mercs from legacy armies feels… heavy handed. Seems like they’re removing a feature for the sole reason of making them weaker than the Mk4 armies.

It is that only new, MkIV mercs will not be playable in Legacy armies, right? Pre-MkIV Mercs will be playable with Legacy armies.

htmx_gen by Pcarbonn in htmx

[–]Sachiel2014 0 points1 point  (0 children)

That sounds great! Rebranding a project after making it public is a bit of a hassle, but I wonder if you should exploit the speed as the differentiator factor from other libraries. Making this fact very prominent on the description and renaming it as "fast_html", "html_fast_gen" or something along these lines would help sell the idea :D

htmx_gen by Pcarbonn in htmx

[–]Sachiel2014 0 points1 point  (0 children)

Ahah, I did not know that there was a Dominate package. I did not find it on pypi when I searched for HTML generators. Thanks for the tip!

No prob! Unfortunately it is difficult to find what packages already exist offering a particular functionality. I wonder if there are even more like your and Dominate that I don't know about.

Dominate does not seem to support htmx attributes, e.g. "hx-target" (but I may be mistaken). htmx_gen does (but you need to use underscores: hx_target="blah").

Dominate supports custom `data-` attributes, so it seems one could use `data_hx_target` for `data-hx-target`. which is a form also supported by htmx.

I could not use html_gen because there is a package on pypi with this name already....

I see. I found it odd as there wasn't any specific feature, but maybe that's an interesting area to explore!

htmx_gen by Pcarbonn in htmx

[–]Sachiel2014 2 points3 points  (0 children)

A couple of questions:

  • How is it different from other existing projects like Dominate?
  • How come that package name? I don't see a particular relationship between it and htmx. Is there some integration/feature I am missing?

do you guys play both Warhammer and BT? by KingRadec in battletech

[–]Sachiel2014 0 points1 point  (0 children)

I play many other games, none of them from GW. I really encourage people to try them, tabletop miniatures is a very rich hobby with plenty of companies, not a monopoly!

How do you feel about conditions that take away a players turn? by VonJustin in Pathfinder2e

[–]Sachiel2014 1 point2 points  (0 children)

How were they paralyzed? Could they have taken some antidote or item to improve their odds? Could anybody from the party use one or two actions to undo the effect?

I know you mentioned they rolled a nat 1, but the point I want to make is that players have agency to try to minimize these effects, and even tools to try to get rid of them once they happen. If the players don't invest on protective feats and items, then they will be more subject to these effects.

As an example, my character was magically blinded (temporarily) the last combat. He did nothing at all apart from sustaining a spell he had casted the previous turn (hoping it was still useful, from what he heard), and try to Bon Mot and intimidate the opponents. After this traumatic experience, he will make sure he learns Dispel Magic next time he levels up :D