Newbie question

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Newbie question

Simon C. Tremblay
Hi all,

It's really a newbie dev question here, but it's probably not suited for the general user list.  Just tell me if it's too basic.

I'm trying to tweak my own Statistics Gramplet for the Dashboard.  I was able to add lines with the total number of events and the total number of citations, but when I try to have a link to all the citation, I get a "AttributeError: invalid filter name"

The line giving me grief is this one:

self.link("%s:" % _("Number of citations") + ":", 'Filter', 'all citations')

I could not find the logic behind the name. I tried following the pattern from the other objects: 'all people', 'all families', 'unique media', 'all events' 

I've tried several alternate filter names, Proper Capitalized, creating a custom filter of that name, all without success.
Is there a reference to those default filters? is the name case sensitive?

is this a bug, or an hidden feature?

What should I use to get the info I want?

Simon





------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|

Re: Newbie question

prculley
The valid quickreport filters are listed in the gramps/plugins/quickview/filterbyname.py module.  There is no 'all citations' type of quickreport.

Paul C.

On Thu, Feb 22, 2018 at 8:31 PM, Simon C. Tremblay <[hidden email]> wrote:
Hi all,

It's really a newbie dev question here, but it's probably not suited for the general user list.  Just tell me if it's too basic.

I'm trying to tweak my own Statistics Gramplet for the Dashboard.  I was able to add lines with the total number of events and the total number of citations, but when I try to have a link to all the citation, I get a "AttributeError: invalid filter name"

The line giving me grief is this one:

self.link("%s:" % _("Number of citations") + ":", 'Filter', 'all citations')

I could not find the logic behind the name. I tried following the pattern from the other objects: 'all people', 'all families', 'unique media', 'all events' 

I've tried several alternate filter names, Proper Capitalized, creating a custom filter of that name, all without success.
Is there a reference to those default filters? is the name case sensitive?

is this a bug, or an hidden feature?

What should I use to get the info I want?

Simon





------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|

Re: Newbie question

Nick Hall
In reply to this post by Simon C. Tremblay
On 23/02/18 02:31, Simon C. Tremblay wrote:
It's really a newbie dev question here, but it's probably not suited for the general user list.  Just tell me if it's too basic.

I'm trying to tweak my own Statistics Gramplet for the Dashboard.  I was able to add lines with the total number of events and the total number of citations, but when I try to have a link to all the citation, I get a "AttributeError: invalid filter name"

The line giving me grief is this one:

self.link("%s:" % _("Number of citations") + ":", 'Filter', 'all citations')

I could not find the logic behind the name. I tried following the pattern from the other objects: 'all people', 'all families', 'unique media', 'all events' 

I've tried several alternate filter names, Proper Capitalized, creating a custom filter of that name, all without success.
Is there a reference to those default filters? is the name case sensitive?

is this a bug, or an hidden feature?

What should I use to get the info I want?

This is the correct place to post your question.

The gramplet link code can be found here:

https://github.com/gramps-project/gramps/blob/master/gramps/gui/widgets/grampletpane.py#L677

The link type of "Filter" actually calls the "filterbyname" quick report:

https://github.com/gramps-project/gramps/blob/master/gramps/gui/plug/quick/_quickreports.py#L184

A list of available filters can be found in the quick report code:

https://github.com/gramps-project/gramps/blob/master/gramps/plugins/quickview/filterbyname.py#L41

We probably need to add an "all citations" filter.  Do you want to do this and submit all pull request?  It looks like an easy enhancement.

Regards,


Nick.



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|

Re: Newbie question

Nick Hall
On 26/02/18 04:03, Simon C. Tremblay wrote:
> I created a feature request,(10469) but I don't understand what you
> mean by "submit all pull request".  If by that you mean change the
> code and submit the change myself, I'm afraid that's beyond my abilities.
>
Thanks for opening the feature request.  I meant to say "submit a
feature request", but as you feel it is beyond you at the moment I'll
make the change for you.

Nick.



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel