Wagtail filtering on fields in subclasses of Page - wagtail

I've been searching the documentation trying to understand if I can filter on page subclass fields the same way I can search on them.
From my experiments search filters must contain only the fields that are defined on the filtered type.
Is this the case? If so, is there any plans on implementing such a thing?

Related

Search/Filter Dropdown in Django Admin Panel for standard CharField

I am using Django to build data models including a model Company. Some of the fields belonging to this model are limited to set choices using the choices='' argument. Some of these fields have a large number of choices, for example a country CharField which lists all countries. Finding the right value among the long list can be tedious so I want to be able to search across the given choice values. This is easy to do for ForeignKey/ManytoMany fields using autocomplete_fields = [] as seen in the attached screenshot (from a different model) but can't seem to find a method for implementing this with a normal CharField with lots of choices. This seems like something that should be built into the Django for the admin panel but I can't find anything within the docs. Please how can I implement a search/filter dropdown for any given (non FK/m2m) fields? Thanks in advance. If there's anymore information I can provide let me know and I will.
country = models.CharField(max_length=128, choices=COUNTRY_CHOICES, null=True)
Model code added. This COUNTRY_CHOICES array is what I would like to be able to select from in a searchable dropdown list.

Cross fromula fields from Opportunity to Quote with custom fields

I'm trying to access some custom fields in the Quote object from Opportunity Object.
I tried to use cross formula fields to access the fields via SyncedQuote, but for some reason not all my custom fields from the Quote Object appear in the dropdown menue.
Is there any reason why only some some custom fields can be linked and others can't?
In general I want to build a VisufalForce PDF formula set up on the Opportunity Objects, for which I need data from the Quote custom fields. Is there any other possibilty to archieve that?
It is important to notice that my company doesnt have the enterprise licence, so no apex code is available. Can this be archived without?
Many Thanks!

How can I use RelationshipFilter in 2sxc Visual Query with text field instead of entity field?

I'm trying to do the same as this example does under title "Attribute-On-Relationship to Query other Fields".
I'm editing Blog application visual query.
So I have RelationshipFilter, which takes entities of type Category via Default in point. And I want to filter them by field Name. Here I can get list of names either from params or from list of posts and their categories. That's not a problem as far as I understand.
So looks like Name has to be of entity type. I'm struggling right now with this filter, since I want to filter Category by field Name of simple text type. Which means that I have nothing to specify in Relationship Attribute. EntityTitle or just empty Relationship Attribute field don't work and cause Bad Request error. So is there a way to make it work?
P.S. ValueFilter is not an option, since it doesn't support returning nothing if there are no items, that satisfy condition and also it supports only filter by item's Attribute, that contains Value and no option that Value can contain any in Attribute with separator.
The RelationshipFilter is only meant for relationships (item with item) - and you seem to want to do a string-compare.
I'm not really sure what you should do because I don't have context, but if things get really special, best use LINQ instead. Check out the tutorials for LINQ here: https://2sxc.org/dnn-tutorials/en/razor/linq/home

Display results of unknown SOQL query

I have a requirement that I'd like to know if it is possible. I have visualforce page which will display the results of a SOQL query, however the SOQL query is dynamic and could be a query on Custom Objects or Standard Obejcts. I'm currently hard coding a SOQL query into the controller class whilst trying to figure out how it will work. I intend to display the results of the SOQL query in a pageBlockTable or dataTable in the Apex.
Is this possible in Salesforce, if so could anyone give me an example of how it would work both in Visualforce and Apex?
You should read about "dynamic references" (also called "dynamic bindings"). A good starting point: http://www.salesforce.com/us/developer/docs/pages/Content/pages_dynamic_vf_sample_standard.htm
Basically if you have String fieldName = 'AccountNumber';, later in Visualforce you can refer to it directly:
<apex:outputField value="{!a.AccountNumber}"> or dynamically:
<apex:outputField value="{!a[fieldName]}">.
This is similar to having a.AccountNumber or a.get('AccountNumber') in Apex. Check out for example getting Value of a field by its Name in apex salesforce if you've never seen it.
You'll have to be careful around them because if your base object won't be account it will fail (for example there's no Contact.AccountNumber field). The example above deals with Accounts only but it'd be a good intro anyway.
Once you familiarize yourself with the basic idea you can explore world of fieldsets - predefined groups of fields that should come together - you can use them both for displaying and querying data, basically they're more powerful than hardcoded list of strings with the field names (like in first link) but still same idea.
At least you'll know now what keywords to look for ;)

Drupal 7 views filter by node's taxonomy term

I have a similar question to my previous one (Drupal 7 views filter by dynamic taxonomy term), it's only the other way round.
I have a "partner" content type, each with it's own taxonomy term. The other content type is a regular page with multiple terms from the "partner" vocabulary. In my regular nodes, I want to include a few of the "partners" in a view block.
The view should filter only those relevant partner nodes (those tagged with one of the regular node's tags).
Could it be done this way? The problem is that I can't get the term names from URL via contextual filters...
After googling the whole afternoon (and posting it there), I eventually found the answer.
It's based on a tutorial on scito.ch (thanks), with only a few modifications. On the Content: Has taxonomy term ID (with depth) filter, be sure to check the Allow multiple values checkbox. Also (there's a lot of wrong tuts for that), don't specify anything in the WHEN THE FILTER VALUE IS AVAILABLE OR A DEFAULT IS PROVIDED. It's important you specify all those 3 contextual filters.
Hope this helps someone and saves him a sunny afternoon :)

Resources