Does anyone have a way to inject thumbnail photos of users into AD? When I get data via cfldap, I can see the entry for thumbnailphoto, but the entry for MY record (which has a photo attached to it manually) has an empty string in that field.
Any suggestions?
Thanks!
Chris
I don't believe there's any way to do it. I've never been able to figure out how to use binary data as an attribute using CFLDAP.
I always end up using Java if I have to do this.
Related
I want to manage(such as Change the default language) the country region details of in my Django website. Does anyone have a best way to do that?
There is no built-in way in Django to achieve that. See adamcharnock/django-tz-detect. The project is maintained well, still active and has an easy-to-understand documentation.
I am trying to let my users upload multiple pictures to their blog posts. I have created a model for the blog post and a separate model for the images and used a foreign key to relate them. I was planning on using dropzone.js so that the user can drag and drop the pictures. I have looked into using formsets but can't get my head around them. Can anyone explain to a django beginner how to go about doing this? Or better yet give an example? Thanks!
I have done something similar using jquery-fileupload. Never used dropzone.js so maybe the explanation is not directly equivalent, but this is roughly what you do.
If you don't want to use formsets, upload the images via AJAX and add hidden fields to the form with the primary keys of the uploaded images, so you can attach them when saving the blogpost in Django. You will have to deal with orphaned images (those that were uploaded but the blogpost was never saved.)
If you want to use formsets, Django expects a format in the posted form data, you just need to make sure you create in your html (with dropzone js templating) the apropriate format Django is expecting, and also incrementing/decrementing the counter of the formset's management form.
Neither way is trivial, you need to pick a path and bang your head a few times before having it working.
It doesn't seem as if django-postman supports attachments so I'm trying to add attachment support. I'm thinking of doing it by creating another set of models that will refer to a postman message and then update the views/templates accordingly but it will be a fair amount of work.
Django-postman isn't exactly an SMTP based messaging system so attachments would need to implemented through a different module. I think you should check some of the django file management projects
https://www.djangopackages.com/grids/g/file-managers/
One of the simplest idea I can think of is to save files in some kind of hashed name and associate these names with the postman message .
I think this would be a good addition to postman itself.
So I ended up figuring out how to do this on my own but it could use some work. The additional constraint we had to work with was that we were already using jQuery File Upload to upload files via AJAX so we needed a way to integrate the two.
Our solution was to create an app that contained a new model and a custom reply form that made it relatively easy to link the two together.
I wrote it up at http://dangoldin.com/2013/05/17/adding-attachments-to-django-postman/ and hope it helps others.
I am using Sorl-Thumbnail to generate thumbnails within pages via template tags.
This all works perfectly fine.
However I have now added a store locator function to the site which feeds into my Google Maps JS via JSON.
In the infowindow popups I would like to put a tiny image of the storefront.
So I need to create another size of thumbnail and I need to include the URL for this within my JSON.
It seemed initially that Sorl doesnt support this due to its requirement for Tags within a page.
I have looked at the low level API version "get_thumbnail" and have tried to implement this within my Model without much luck so far.
I have no problem with my JSON and serialisation, just getting the thumbnail generated and into the model prior to this.
Has anyone had any experience with this scenario previously?
Cheers
Kev
I have searched all the docs but have still no clue how to create a node in Drupal 7 that contains a image field. I create the node(s) via REST Services and everything works except the image thing.
Do i have to post the image data with the post request that creates the node? (as multipart??) Or should i upload the image via ftp and link (and if, how?) to it?
maybe someone else has done a similar job.. thanks forward..
In Rails 2.3.x you had to define a form as multipart to make file uploads work, so I think you need to create the Node as multipart aswell. Just a guess from my side, since I don't have any experience with Drupal at all.