I am creating a sample app to exercise with the FB Graph API using Javascript.
What I want to do is, let the user add a text entry on a diary, and attach an image. I'd store the text entry on my server, and post the image (or multiple images) on the default app photo album.
But, I don't want all my app pictures to be grouped together, I'd like to categorize them.
I.e. I want to post entries about my garden, and an album for every tree / flower I have.
Do you know if (and if so, how) can I create a sub-album inside by app album?
There is no such 'sub album' functionality, but there's no reason your app can't create different albums via the regular API and use those for the uploads
Related
I want to upload images Facebook style: select the images before submitting the form and when they are all uploaded, submit the form instantly. I know how to do it in the frontend, but the problem is in the backend. I have found some ways of managing the images in the backend but I'm not satisfied. The great deal of all this is avoiding to store the photos that won't be used, like if the user closes the browser while some photos are already uploaded. I have in mind 3 ways of doing the upload and I don't know which would be the best:
Create a "tmp" directory and place all the uploaded photos there, and when the form is submitted move all the used photos to another directory. (With this method there can be some concurrency problems)
Create a TempPhoto table in my database and do the same as the previous solution, moving the used photos from TempPhoto to the permanent table.
Add the photos directly to the permanent table and erase the ones that are not used (that are not related to other entity) at a scheduled time. (I suppose this would be the slower solution)
I think your first way with some reformations is the best way. You can create a tmp directory and attach a unique data (e.g. IP address) to each image that takes control on concurrency and then write some script in $(window).unload(...) for send a signal to the backend that remove the image(s) from tmp directory when user close window before submitting the form.
I have a set of images and I'd like to display them to a user and collect the location of mouse clicks on each image. I'd like to do this using django because ultimately I want to integrate these click event data with an existing database that's managed with django.
I know I could do this by coding up my own Python application that displays the image, collects mouse clicks, and stores them in the database. But is there an existing django extension or form that already does this? I'm having trouble getting any useful hits on google.
From what i understand you are collecting data from a front-end level. For something like this you should collect the data with Javascript running on your page and have it send an AJAX post to you Django API. That would allow you to store the data easily.
As Django forms operate off of HTTP requests I do not think that there is an extension for doing this in the current Django ecosystem.
I have a website that is using Django's admin interface to facilitate non-developers adding content to the site. The site has an Events page (and associated model), and each Event can have an associated photo gallery.
I'm thinking that photo galleries should have their own model. There is a table in the database which associates image paths with their Event.
What I need is a way to upload images. Preferably a multiple-file upload solution since there could be dozens of images per event. I want these images to be recorded correctly in their table and added to the file system in the correct location on the server.
I was originally thinking that the upload feature should be included on the Event admin page to make it easier for content contributors, but maybe it would be easier to keep a separate photo gallery admin and have them select the Event the photos are associated with from there?
I've read through a lot of similar questions and blog posts, but nothing that seems to be quite exactly what I'm looking for. I'm currently attempting to adapt some of the information I've seen, but I'd really appreciate suggestions. Thanks for any help on this!
You can create Some model with foreign key to Event, and ManyToMany to your Images, as I understand your question.
At first upload necessary images to some Image model and than add them to Some model with some Event
I want to store multiple images for an item (e.g. images of a building) and I need to create a image viewer control in the ASP.NET website as well.
What are good options to save and retrieve images from Sitecore? If there is an Image list kind of control that would be ideal in my scenario.
Is it a good option to use the "Attachment" field type? If anyone has code examples, please share.
The Sitecore Field Suite open source module contains an "Image Field" control that allows you to attach multiple images to a content item. Unlike a normal multilist, the Image List allows authors to see the images they are attaching directly in the Content Editor, which can be very helpful in choosing and arranging Carousel items.
Links:
Blog post introducting the Field Suite: http://blog.velir.com/index.php/2012/10/24/sitecore-field-suite/
FIeld Suite on Sitecore Marketplace: http://marketplace.sitecore.net/en/Modules/Field_Suite.aspx
I want to upload images to a gallery app. I want the user to be able to either load images normaly, or upload on zip file containing all the images for that gallery. Then it must be uncompressed and all images must be added to that model. This is for the admin site.
Any ideas?
You could either use the existing django-app django-photologue which enables you to do that or have a look at how it is implemented there: https://code.google.com/p/django-photologue/source/browse/trunk/photologue/models.py.
If you see that photlogue is lacking some of the functionality you need, you could also subclass and extend photologue's models in your app!