I want to get all the user details from an event using the field expansion.
In pseudo code i think it should be something like this.
GET https://graph.facebook.com//attending.user(name,id,picture)
I can't get this to work (testing this in the graph explorer) Don't know if this is even possible.
Thx!
You need to use a url like this:
https://graph.facebook.com/EVENTID/?fields=attending.fields(id,name,picture)
Related
I was trying to get a filter feature for my admin, otherwise it is tough to find the value the data-entry would need to find. Something like this:
I found that in https://demo.django-blog-zinnia.com/admin/zinnia/entry/add/ (the login info for the site is user: demo, pass: demo)
Use Bootstrap-Select Multiple
This is a simple JQuery plug-in that will enable you to select multiple values of data as you have shown in the demo link.
This also gives you the options to search the data-set
In my opinion, this is a bit better for the UI than the style you have shown.
I'm trying to make a small button in an Android app that lets the user like a wall post. I would like it to show if the user has already liked the post so the user knows that it's worked. The API here:
https://developers.facebook.com/docs/reference/api/post/
shows how to add and delete a like for a particular post but there doesn't seem to be a way to query the like state.
Calling:
https://graph.facebook.com/me/likes/19292868552_10150189643478553
seems like the obvious solution but this gives a parser error.
There IS actually a solution for this. You have to use FQL. Here, this is what will work
select user_id from like where object_id=your object_id AND user_id=me()
If the result returns an empty array, then the user never liked the post, if it returns a result, the user has liked the post. Simple :)
i think you want this: https://graph.facebook.com/19292868552_10150189643478553/likes ... or did i misunderstand?
Before I start on this project I want make sure what I am proposing is feasible. There is an unusual requirements I have to satisfy.
The model and formModel fields have to support a comment field on every field. I would like to be able to access them by object.field and object.field.comment. At first glance, this looks like I should have a separate type of comment and then somehow link it to correct field but is there a way to create a custom modelField that stores data in more then one database field from one or more form inputs? I would think there would have to be a custom widget to support this too?
If anyone has any ideas or examples of anything like this please respond.
I think this is the answer to my question. I have not tried it yet, but from the description it looks like what I need. https://docs.djangoproject.com/en/dev/ref/forms/widgets/#multiwidget
for seo related reason in my project i have to trap certain search parameters within the url for the "beautiful url" thing.
The advanced search is composed by 7 parameters, 3 of which are location-related and are the ones interesting our seo consultant.
So, now i'm a bit confused. It's been a while since i started using django professionally, but never had to face an issue like this. Basically, the final url structure must be something like this:
/Italy/Lombardy/Milan/?price=100&miles=10&last_posted=2
and my urls.py is
'/(?P<country>\w+)/(?P<zone>\w+)/(?P<city>\w+)/$', SearchView.as_view()
now, what i'm not sure about is how should i specify my request in the form method to be able to use that exact url schema? POST or GET? And how can i compose the url for the "action" attribute dynamically while the user types? Is this even the correct solution? I'm really confused about it, any help would be really appreciated! Thanks!
you will have to change the action field of the form using script, yes. and set the method to GET, and include in the form only the fields appearing in the query string.
I want to combine pagination with filtering. Since I have a lot of filters I do not want to send them per GET request, since the URLs get really ugly.
Since django pagination uses GET request to pass the page parameters, I do not know how I can combine these two approaches.
Any idea?
Great add-on would be: How can I combine this approach with table sort? :-)
Edit:
Actually it should work like the pagination of stackoverflow - user questions. If a user clicks on a page number one is shown the correct page, without showing the get parameters in the url.
This is the url called.
https://stackoverflow.com/api/userquestions.html?page=2&pagesize=10&userId=237690&sort=Recent
But the url shown in the browser is neat and short.
Seems to be ajax. Anybody an idea how to implement this? :)
If the URL is not shown in the browser`s address bar, I do not care about whether it is beautiful or not.
Edit: The solution:
Make an ajax update with all filter parameters passed to the view. This should help you get started with implementing ajax for your site: link
Thus the GET parameters never show up in the address bar.
have you checked the paginate application for django?
it may help you a lot, use it all the time :D
http://code.google.com/p/django-pagination/
Have you considered django-tables2? It gives you django-admin style tables without you having to write the logic yourself.
maybe you can use the urs, something like:
http://oursite.com/something/filter1/filter2/3/
the doc -> http://docs.djangoproject.com/en/1.1/topics/http/urls/
I figured out two solutions:
Instead of using just hyperlinks use it inside a POST form, i dont have any example now but i remember have used that for REST functions in Ruby on rails
Save the query info in a session.
Hope this help.