Example
db.Preload("Orders.Orders.Orders").Preload(clause.Associations).Find(&users)
So can i put dynamically Nth level preloading in golang?
Actually what I want
If I write only Orders in preaload so I want to get n level preloading data
db.Preload("Orders").Preload(clause.Associations).Find(&users)
For an example we can take post has many comment and comment has many comments
db.Preload("comments.comments.comments").Preload(clause.Associations).Find(&users)
So instead of multiple time write comments.comments.comments
is the possible can I write with single comment ?
SO I WANT DYNAMICALLY NESTED PRELOADING IN GOLANG
THANK YOU IN ADVANCE
Related
is it possible to change the resultset structure when retrieving data from elastic search?
the problem ist, the timeseries data are sometimes from 3000-8000 records which are a json array with json objects in it ... parsing it in this case not really efficient or necessary so i thought - could a resultset be transformed to just lets say a simple json object with an array of time and array of values? nothing more?
i could do this in java or php but since we want to have an efficent way of dealing with large datasets we are currently evaluating our options.
You can control what elasticsearch returns using source filtering:
https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-source-filtering.html
It can let you pick which part of the indexed document it will return, which, depending on your index structure could be an array of times and values, or at least, very easily mapped to it using the language of your choice.
Another possibility is to use scripting to control the results. If you map the result in this way, you should be able to get the hits object to be a JSON array of key: value.
I have created a BC WebApp using the BC Open Platform API's for the back end and everything appears to work fine including rendering the list of items in a sort order of one of my custom fields.
Here is an example of what works on the back end.
var items = new BCAPI.Models.WebApp.ItemCollection(WEBAPP_NAME);
items.fetch({
order: "MyCustomField",
skip: 0,
limit: 1000,
success: onWebpAppListFetch,
error: onAPIError
});
How do I render this list on the front end sorted by one of my custom fields? Here is an example of what I am trying to use on the front end, but it does not order or sort this way.
{module_webapps order="MyCustomField" render="collection" template="/_System/apps/cms-sports-club-manager/club-rooms/layouts/club_rooms_collection.tpl" id="cms-club-roomsx" filter="all"}
Is there something that I am overlooking, or do I need to approach this in my own manual way? Perhaps I could render the list into an array, sort the array and then iterate through that to render the front end listing? The template file uses Liquid to iterate through the collection and render the HTML. Can I define an array variable, fill the array, sort the array and iterate through the array again in that same template file?
Another possibility perhaps is to output all webapp items into a JSON file each time a user creates/edits an item (from the back end), and then use the {module_json} feature on the front end to read that JSON file which "should" allow me to sort it.
Any advice on what to do (as well as what NOT to do) would be appreciated.
I have found one possible answer, but I am not sure it is the best way to do this.
I have implemented a script which performs the following steps:
Create an array holding all items (unsorted at this point)
Sort the array using any custom field
Iterate through the sorted array and document.write() each one
I have tested this a fair bit and it seems to do exactly what I want, however I have not marked this as the correct answer just yet as I would still like to find a "better" way than needing to resort to the above manual work.
Suppose you want to display posts as in Disqus.
(It seems you can comment on any post in any depth)
How do I pass a such data to django template and let it draw the data as Disqus?
e.g. You want to display all posts which belong to a thread in a way which reveals the parent-child relationship.
How can you do that in django? (python/json/..)
Have you looked into using django-mptt? I have found that it works quite well for this type of tree structure.
I know that you can pass data to a view using:
navigator.pushView(views.LoadoutView, list.selectedItem)
But what if I pass that data, and then want to pass another piece of data to the same view using a similar method?
Can I get/set a new property or can I write the current data to an xml file as soon as it is received?
Here is a little diagram I made of what I'm trying to achieve (I spent hours on it :P).
From what I've understood, you need to push multiple objects to a view at once, correct?
The data object can only be a single object or object reference, which means that if you want to push more than just your list.selectedItem, create a new Object (a generic one will do) that contains both your properties and push it, much like the following;
var myDataObject:Object = {firstPieceOfData:list.selectedItem, secondPieceOfData:yourSecondObjectHere};
navigator.pushView(views.LoadoutView, myDataObject);
I try to parse H265 seq_parameter_data from an RBSP data... I use the reference from http://www-ee.uta.edu/Dip/Courses/EE5359/H.264%20Standard2007.pdf .
It shows how to parse at page 40.
But the pseudo-algorithms use data structures such as ScalingList4x4[ ], ScalingMatrix4x4Flag[ ] etc... What are they? Are they constant tables or we fill them? Anybody has knowlegde about it?
If you are trying to parse parameter sets (I assume this from your previous questions), you don't need these structures. You just need to skip certain amount of bits in order to skip the tables in full and move on to the values of your interest.