You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently discovered your library which seems the perfect tool to automate some regular actions on Redmine. I read the documentation and tried several things but I still can't find how to do some specific things which are possible in the web UI.
First, Redmine is version 4.0.5.stable and I initialize the library use with
I try to retrieve all (open and closed) issues from a specific version (which is from a specific project)
# OK: filter issues by project_id
redmine.issue.filter(project_id=PROJECT)
# OK: filter issues by project_id and status_id
redmine.issue.filter(project_id=PROJECT,status_id='*')
# KO: filter issues by project_id, status_id and **fixed_version__name**
redmine.issue.filter(project_id=PROJECT,status_id='*',fixed_version__name=VERSION)
# OK: filter issues by project_id, status_id and **fixed_version_id**
redmine.issue.filter(project_id=PROJECT,status_id='*',fixed_version_id=<id>)
Using fixed_version__name does not work but using fixed_version_id does. But I can't find the correct way to retrieve this ID from the VERSION name: there is no option in redmine.version.filter().
Also in other requests I can successfully use the fixed_version__name keyword
So I wonder how I can make this specific request using the library: do I need to loop over each issue to verify its fixed_version?
I have difficulties to understand what is and what is not possible to do with the ORM (I know a little the Django ORM but can't find my way in this one).
For example with the status_id parameter which works in some queries but not others.
# OK
redmine.issue.filter(project_id=PROJECT)
# OK with '*' or 'open' or 'closed'
redmine.issue.filter(project_id=PROJECT,status_id='*')
# KO -> returns nothing
project.issues.filter(status='*')
project.issues.filter(status='closed')
I thought that the Issue RessourceSet was been used for both redmine.issue and project.issues so I can use the same filter() method. I may misunderstand how it should be used.
Any help would be appreciated.
The text was updated successfully, but these errors were encountered:
There are 2 entities you're working with in your examples:
ResourceManager - this is what you get when you're doing things like redmine.issue.filter() or redmine.project.all() and so on, i.e. redmine.RESOURCE.OPERATION. So again, redmine.issue returns you a ResourceManager which has different operations i.e. get(), filter(), all() etc. and when you're working with a resource manager - you're working with redmine API directly, so an operation on the ResourceManager supports everything that Redmine API supports, this is why this redmine.issue.filter(project_id=PROJECT,status_id='*',fixed_version_id=<id>) worked for you, because this is a filter operation with filters that Redmine API supports and this filters are partly documented in the Python-Redmine docs. Not all filters are documented in the Python-Redmine docs (there are several issues about it, for example What are all filter operations for issues #57 and Filter on multiple roadmaps / target versions / fixed_version_id #205, but I hope to fix it soon and document everything that is possible to do with redmine filters.
ResourceSet - this is what you get from
project=redmine.project.get(PROJECT)
project.issues# <- this is a ResourceSet
a ResourceSet also has operations like filter() and others which are documented here and this filter() method on a ResourceSet supports resource relationships and a thingy called lookups which all together give you an ability to filter your resourceset, but in Python, and this is a main difference compared to a ResourceManager, i.e. when you're doing filtering on a ResourceManager - you're sending a request to Redmine API and you get those filtered results directly from Redmine and when you're doing filtering on a ResourceSet, all the filtering is done in Python with the help of Python-Redmine magic under the hood and you can only work with filters (filter fields) that already exist in the ResourceSet i.e. was retrieved from Redmine.
I hope this helped a bit, though it might still be a bit confusing, but I am happy to answer more questions if you have any.
Hello,
I recently discovered your library which seems the perfect tool to automate some regular actions on Redmine. I read the documentation and tried several things but I still can't find how to do some specific things which are possible in the web UI.
First, Redmine is version 4.0.5.stable and I initialize the library use with
I try to retrieve all (open and closed) issues from a specific version (which is from a specific project)
Using
fixed_version__name
does not work but usingfixed_version_id
does. But I can't find the correct way to retrieve this ID from the VERSION name: there is no option inredmine.version.filter()
.Also in other requests I can successfully use the
fixed_version__name
keywordSo I wonder how I can make this specific request using the library: do I need to loop over each issue to verify its
fixed_version
?I have difficulties to understand what is and what is not possible to do with the ORM (I know a little the Django ORM but can't find my way in this one).
For example with the
status_id
parameter which works in some queries but not others.I thought that the Issue RessourceSet was been used for both
redmine.issue
andproject.issues
so I can use the samefilter()
method. I may misunderstand how it should be used.Any help would be appreciated.
The text was updated successfully, but these errors were encountered: