Building on this question, now I have another problem. Given this,
shipments = Shipment.objects.filter(filter).exclude(**exclude).order_by(order) \
.annotate(num_bids=Count('bids'), min_bid=Min('bids__amount'), max_bid=Max('bids__amount')) \
.select_related('pickup_address','dropoff_address','billing_address')
return HttpRespon...
Hi, I am planning yo use jquery UI Autosuggest for a search form.so I need a json output which can be used by Jquery UI Auto suggest.
heres the database
table name recent_tags
I have tried this
first connected to db
$do = mysql_query("SELECT * FROM recent_tags where query like '%" . $_GET['qery'] . "%'");
while ($row = mysql_fetch...
I have bunch of screens (asp.net C#) capturing data and transferring it back to a web service using json.
How can i encrypt content like passwords and decrypt it back in the C# code?
...
I am trying to decode JSON in php I sended using an ajax call in javascript (jquery).
The javascript code:
var editSchedule_data = {
'action' : 'editSchedule',
'eventid' : $('#eventid').val(),
'pixels_per_minute' :$('#pixels_per_minute').val(),
artists: {
artist: []
...
Hi everyone I am trying to read some json and do 2 things.
Insert some of the json data into a UL. Second thing is create a function that can be called from a anchor tag and displays the other data.Let me try explain with my code.
My json looks like this
[{lakeName:"Lake 1",lakeCode:"111",Readings[["24-Oct-10",12.5],["24-Oct-10",10.5],...
Hello all
Short version: I'm looking for the JavaScript equivalent of Perl's
for my $key ( sort { $hash{$a}{foo} cmp $hash{$b}{foo} } keys %hash ) {
# do something with $key
}
More detail:
I have a JSON object which consists of a bunch of other JSON objects which have identical properties to each other, like a hash of hashes in ...
On my site I have simple form (by the way I'm using razor view engine):
<form method="post" action="Mail/SendMailMessage" id="mailForm">
@Html.LabelFor(m => m.UserFirstAndSecondName)<br />
@Html.TextBoxFor(m => m.UserFirstAndSecondName)<br />
@Html.LabelFor(m => m.Email)<br />
@Html.TextBoxFor(m => m.Email)<br />
@Html.La...
Here is my code. You have to kindly look does it suffer from 'same origin policy' in this shape. The domain for HTML is (http://127.0.0.1/jqload.html) & php file (http://127.0.0.1/conn_sql.php). This is json format : [{"options":"smart_exp"},{"options":"user_int"},{"options":"blahblah"}]
I actually want to append json data that I rece...
Hi,
Find below the json response...
{"Object":
{"PET ANIMALS":[{"id":1,"name":"Dog"},
{"id":2,"name":"Cat"}],
"Wild Animals":[{"id":1,"name":"Tiger"},
{"id":2,"name":"Lion"}]
}
}
In the above mentioned response, what is the way to find the length of ...
When a json result is returned by the controller the object name seems to be missing, I normally wouldn't mind but the flexbox jquery plugin requires the json result in a particular format.
Flexcombobox expected format
{"results":[
{"id":"1","name":"Ant"},
{"id":"2","name":"Bear"},
{"id":"3","name":"Cat"},
{...
I'm trying to access JSON data with jQuery and grab a specific set of values based on a variable. I've done this before using [] but for some reason I can't figure out what is going wrong this time.
My JSON file (being read in by getJSON, and named jsonmaker.php) looks like this:
{"0107001":{"label":"Canada","x":"0","y":"0.34"},"01070...
Can we do something like this or something similar?
var staffs = {
"Staff":
[
{ "ID" : 1, "Name" : "John" },
{ "ID" : 2, "Name" : "Mark"}
]
};
foreach (var staff in staffs)
{
Console.WriteLine("ID: {0}", staff.ID);
Console.WriteLine("Name:...
Hello All,
I am using Apache CXF RS to produce a REST service which accepts both XML and JSON as input. I use the default JSON provider i.e. Jettison.
My trouble starts when my input json has an array in it. For example,
{
person:{
telephone:[
{
type: "mobile",
number: "123"
...
I am using XSLTJSON to convert my XML to JSON. My raw XML is not in the format that I want, so I first pass it through an XSL stylesheet to clean it up and then pass the output of that stylesheet into XSLTJSON.
Right now I'm doing this by calling transformers serially. I'd like to streamline it and have only one call to the transfor...
Assuming this JSON object:
var obj = {
"set1": [1, 2, 3],
"set2": [4, 5, 6, 7, 8],
"set3": [9, 10, 11, 12]
};
The "set2" property may be retrieved like so:
obj["set2"]
Is there a way to retrieve the "set2" property by index? It is the second property of the JSON object. This does not work (of course):
obj[1]
So...
I am serializing a complex object with lot of properties of other Types and Lists to JSON form but the issue is with DateTime properties. I get the epoch time with JavascriptSerializer (rather than mm/dd/YYYY).
Is there any way I can get the datetime in mm/dd/YYYY : HH.MM.SS form without modifying the class defination of the object i a...
I am trying to use a JSON feed to render events in fullCalendar. Here is the code.
$('#calendar').fullCalendar({
editable : true,
selectable : true,
select : selectionMade,
eventResize : eventsChanged,
eventDrop : eventsChanged,
selectable : tru...
Hello!
So, I am using the HtmlAgility pack (http://htmlagilitypack.codeplex.com/) to parse a script node and then I use regular expressions to parse out an object definition.
The string I end up with is plain javascript that defines an object.
Here is the sample Javascript I am trying to parse:
<!--Module 328 Buying Options Table-->
<...
Hello guys.
I have been trying to implement an AJAX call on a database returning a JSON file with PHP and eventually met the encoding problem.
My database has some char fields with customers' names and, since it is in portuguese, european characters are pretty common. Hence the some results with those characters are returning null via ...
From Scottgu's post i got the code to Serialize a collection to JSON object.(i)How to convert the JSON object back to List? (ii) I did not find JavaScriptserializer in System.Runtime.Serialization will the only code work for VS 2010?
ScottGu's snippet
namespace ScottGuHelper.JSON
{
public static class JSONHelper
{
public sta...