It requires a custom function to add a week to the first date (as in practice it’s not static, but dynamic), I was trying to avoid that
It doesn’t change my worry that I may be using a name like weekEnd and one day a new function is added into the software, resulting in all my attribute queries failing suddenly
I understand. It’s just I’m not a fan of having an attributes that is directly derived from another one.
Maybe you could use the function in the query instead of creating an attribute:
page where weekStart(created) = "2024-10-28"
This would work around the issue in that case.
After your first post I didn’t fully realize the issue you were mentioning. It does seem like there should be a way to force the use of attribute instead of function.
Using live template you can access the attributes but it’s an ugly workaround, not a solution.
```template
{{#each @page in {page}}}
{{#if @page.getProjectTag = "test"}}
success
{{/if}}
{{/each}}
```
```query
page where getProjectTag = "test"
```
The error is part of my getProjectTag function which shows the function is indeed running instead of checking the attribute.
I would argue that it’s bad practice to have an attribute and function share a name. However, many function are not under the user’s control (from SB core or plugs) and could indeed conflict with existing attributes in the future.
Maybe something like a . as a prefix to force the use of attributes in case of conflict could work?
I agree that a dot would be perfect assuming no other conflicts. And it is exactly because functions are outside of the user control I was worried about this when I noticed it. I can easily avoid this problem right now, but I don’t want my notes to fail in the future.
And for what it’s worth, I was avoiding created simply because this way I could more readily switch which week a note belonged to manually, or avoiding a situation where I may end up restoring a file manually etc and screwing with the files metadata. But I have moved to a dynamic calculation using the note name instead. Still required a custom function though, as week start doesn’t accept an argument, it’s always today’s date.