I have form templates but the order or the Key is unique to each form. For eg: Name in some form has "Name" while in some it has "Applicant's name" or "First Name". Can i use these different templates in one training dataset while training custom model. Post training, will the model be able to recognize the correct "key" (as in Name/Applicant name/First name) relevant to the form and extract the relevant "pair" for the same?
You can but expect the accuracy to drop if there are more than 3-4 different form types (it really depends on how complicated the forms are).
Related
I have two models, Country and City and a one-to-many relationship between them. One country can have many cities and a city can only have one country. App Maker generates a Country_fk field in the City model.
Now when I create a Create form and drop a form bound to the City model and include the related Country field App Maker creates a dropdown with the following:
options: #datasources.Country.items
value: #datasource.item.Country
Which, if I compare it with some example apps looks absolutely fine. However, I only get the Id of the related Country field not the country name field.
This has happened so many times with different models. I did once manage to create a relationship that worked, and it used the same datasource options and value values, but I can't for the life of me see why something so simple as this is so hard to do. it is so basic newbie stuff I'm beginning to give up on App maker.
You can use a little bit of help from the official documentation.
When you create a model, you can select the default display field. App Maker uses the default display field when it refers to a record in the model. A display field is commonly used for widgets that select a record, such as dropdowns.
Go to your model and make sure you select the proper display field. Something similar like in the image below.
You need to make the required field the 'Display Name' in the relevant model. Once you do this it will display as you want 👍
I'm displaying the query from an QSqlModel in a table view. e.G.
SELECT id, name FROM person;
I don't want to display id in the view, however I need the id when the user clicks on a row in that view.
Is there a model in Qt, which allows me to display only specified columns in views but also providing access to invisible ones?
I used to do it by hiding the columns e.g.:
ui->myview->setColumnHidden( 0, true );
But probably there is a better solution.
Since the OP amended the question to exclude using QTableView the only alternative that would seem to work is the creation of a new class derived from QSortFilterProxyModel. One can override the filterAcceptsColumn method
Documentation on the class QSortFilterProxyModel can be found here
QSortFilterProxyModel can be used for sorting items, filtering out items, or both. The model transforms the structure of a source model by mapping the model indexes it supplies to new indexes, corresponding to different locations, for views to use. This approach allows a given source model to be restructured as far as views are concerned without requiring any transformations on the underlying data, and without duplicating the data in memory.
You'd also have to override MapToSource and SourceToMap . There is a good example of usage in this StackOverflow's answer
Scenario
I have a form type that I use both for creation or edit of mine entities. These entities have some kind of relationship with other entities in a x-to-many fashion. That means that - relatively to save action -my dropdown list will be populated with list of constrained entities.
Suppose that - in form - whe have something like this:
Principal Entity: MiniCooper
List of Accessories
Product 1: [list of input properties that user can insert and save directly with this form]
Product 2: [list of input properties that user can insert and save directly with this form]
.....
Product n: [list of input properties that user can insert and save directly with this form]
Where Product[1,2,....,n] are the "many" side of relationship (consider "principal entity" the "x" side of relationship; it doesn't matter for our example if, actually, this should be an n-to-m relationship) and suppose that these related entities are "automatically" assigned to my principal entity on creation of "principal entity" itself.
When I render my form - through an entity type - I'll obtain that Product 1 , Product 2 , .... , Product N will be render as dropdown lists with the corrisponding element selected.
But..... I don't want this behaviour. I'll prefer that they could be some kind of "label" or something like that (So no one can change the selection and produce multi-assignment of the same "Product"). How can I write my entity type - now these fields are "entity" typed - to obtain this?
Moreover, have I to use mandatorily the Data Transformer ??
Screenshot
As you can see from screenshot, all dropdownlist (apart "price type") shouldn't be dropdown (i know that I can make one-value dropdown but i don't want them).
Hope this image will help you to understand better my issue.
I'll prefer that they could be some kind of "label" or something like that (So no one can change the selection and produce multi-assignment of the same "Product")
From what you describe it sounds as though you want to display the data, rather than provide a form to edit it (that is, you want to list the entity and its accessories on the page).
The way to tackle this is to avoid forms altogether, and just make the entities available in the view and render the information directly.
Alternatively if you are attempting to represent in a form 'multiple choice' amongst related items in a (for simplicity's sake) 1-to-many relationship, the 'expanded' and 'multiple' options for the 'entity' form field type should do what you want.
If neither of these is the answer, then it'll be because I'm struggling to grasp the question :).
I have made the MVC Music Store through the tutorials and I'm now currently changing and adding things to the site to my liking. What I'd like to be able to do is open the Artist page and have the letters A-Z and All written across the screen in a bar at the top to allow users to browse Artists by the first letter of the bands name. What method would I use for this? Would a parameter help me?
You can use a parameter to filter data. When you populated model in controller action use default filter parameter as either 'All' or 'A' (first letter). Then filter model data and then return it with view. For 'All' obviously skip filtering logic.
On view you can have ActionLink for every letter linked to same action and passing letter as parameter. This way you can use same action to display data and all you will need action links passing parameter to that action and displaying data will be same (either use webgrid or any other way to display data).
Briefly: I'm making a custom view, I want a field listing the two taxonomy terms associated with an NID to output as two distinct links which return arguments for the view (term1 to view/term1, term2 to view/term2. Rather, it outputs as one aggregated link (both term1 and term2 output view/term1%0Aterm2.
Am I doing something wrong or is this not possible?
Exhaustively:
I am constructing a view of products (with the page output at http://example.com/products) in an drupal ubercart site because the built-in ubercart catalog psuedo-view isn't doing it for me. Some of these products belong to more than one taxonomy term (within the same vocabulary) - for instance, product_example1 belongs to terms blue and glowinthedark, product_example2 red and glowinthedark, product-example3 just blue.
I've created an argument which limits the view based on terms like so: products/red, products/glowinthedark etc returns this nice view I made but only with products which are associated with taxonomy terms red, glowinthedark, etc - so works as it should. Views is awesome!
Now, I want each product shown in this view to link to the generated product/[term] page(s). Outputting the field "taxonomy:all terms" as a link with replacement argument products/[tid] works for one term (product_example3's field works for its one term: /products/blue (views is awesome!) , but, AND HERE'S THE PROBLEM, it DOESN'T FOR TWO TERMS (or I assume more than two terms). This is true whether the field is output as a list or using a simple seperator. So, for product_example one, the field lists both terms blue and glowinthedark (correctly separated as list items or with the chosen "," simple separator), but both terms output the relative link products/blue%0Aglowinthedark.
Is that clear? I haven't been able to google anyone with a similar situation, strangely, although I can't imagine I'm the first to run into this. I may just give up since it's not all that important and I can think of several less-satisfactory but still doable workarounds, but I thought you all might have some insight. The only thing that gives me hope is that when the "Link this field to its term page" check box is selected, views successfully outputs two separate line items with links to the two separate terms' pages.
I'm also posting this question on Drupal.org. Thanks for your time!
Hmmm... strange. I read your question carefully. However I am getting the results that you desire!
I have a taxonomy vocabulary that is multiple select (lets call it "Sector")
I have a taxonomy vocabulary that is single select (lets call it "Location")
In my fields section, I add Taxonomy: All Terms
In the settings for Taxonomy: All Terms I select "Output this field as a link". In there, I set the "Link Path" to product/[tid]
I make sure "Link this field to its term page" is NOT checked
I use a simple comma separator
"Limit terms to a specific vocabulary" checkbox does not matter. It would depend on your business requirements.
As required by you I get products/abc, products/xyz etc. one after another on a single line. This works even if a particular node has multiple terms from the same taxonomy vocabulary. I don't get any %0A stuff.
This works out of the box for me. I tried with both views 2.11 and views 3.0-alpha3
Try upgrading to the latest version of views and see if you have better luck?