Using Non-ORM data sources with Tastypie in Django

Source: http://www.inquisitr.com/183142/state-department-to-reject-keystone-xl-pipeline-reroute/

Recently, I’ve worked with Tastypie which is my first introduction to tastypie. Tastypie itself is wonderful and very easy to work. However, my first catch was that I’ve to use it in a scenario where data source is not django’s ORM. My goal is to expose some API endpoints but the data will come from some other external API. Confusing? Let’s discuss about the implementation not about the wisdom of use cases. If you do not have introduction to the Tastypie, please have a look at their documentation.

Generally, when we create a Tastypie resource, our class inherits ModelResource. ModelResource is actually provides django’s ORM specific accesses as the resource is created on top of Django models. The fact is that, ModelResource is a thin wrapper on top of it’s Resource class and overrides few methods. If we want to use our custom data sources, we will have to override some methods of this Resource class based on our requirements. The methods we have to override are:

Continue reading →

Auto updating (svn up) working copy on commit

I am working on a project that can’t be tested locally. So, I need to upload files to server. However, committing and then uploading is rigorous job (as there are lots of files to upload as a directory while changes were made only a few files under different directory. so browsing directory and uploading specific file(s) also annoying.) ! That’s why I used ‘svn up’ command to update all changed files from svn repository.

Continue reading →

WordPress Category Widgets plugin – display different widgets for different categories

Today, I have developed another plugin for WordPress which I named ‘Category Widgets’ plugin and as usual nothing more peaceful rather than sharing with the community.

Using this plugin, you can display a text widget for any specific category and/or its sub-categories. For example, you want to show different sidebar banners based on different category. It is easy using this plugin. Just create a new widget and select the category.

I have found another plugin for almost the same purpose. That plugin lacks of capability of displaying in the subcategories. That mean it does not work for the sub-categories of the selected category. In this plugin, I have made that feature and also optionally you can disable that feature too.

Requirements:

  1. WordPress 2.8+

Download:

Continue reading →

হুররে….তৈরি করলাম নিজের রিপোজিটরি :)

মাহদী’র ফোন করল আমার ইয়ামের ক্যাশ ডাইরেক্টরীটা সে চায়। কারণ কিছু কোডেক ইনস্টল করা লাগবে। তখন মনে হল লিনাক্স রিইনস্টল করলে আমারও তো আবার ডাউনলোড করা লাগবে। আমিও ক্যাশ ফোল্ডারকে আলাদা জায়গায় সরিয়ে রাখলাম। তখন মনে হল আমি দেখি নিজের একটা রিপো বানাতে পারি কিনা। ওমা! এটা তো দেখি পান্তা ভাত

যেভাবে করলাম:
১. বিভিন্ন জায়গায় যত আরপিএম ছিল সবগুলোকে একটা ফোল্ডারে ঢুকালাম।
২. একটা টুল ইনস্টল দিতে হবে।
yum install createrepo Continue reading →

List of RPM Repos

Today I had to face much trouble while trying to install vlc player in my Fedora 9. You know, there are a lots of dependencies for installing vlc. The Yum could not resolve (using rpmforge and some other repo) a dependency and it took me more than hour to resolve it. After googling for about one hours, I came to know about RPM Fusion repository. After adding it to my Yum repo, vlc installation is damn easy. That dependency is now quickly and effectively resolved.

That’s why I planned to list a number of Repos so that I and you can use it when needed.

  1. Yes, the old friend RPM Forge.
  2. RPM Fusion
  3. Livna
  4. FreshRPMS
  5. Dribble – Somehow it is dependent to Livna

These repos provide automatic repo configuration rpm. Visit their configuration/using page and download & Install the RPM and the repo is ready to use.

For manual rpm installation, you know rpmfine.net is great always too.

Please keep adding if you know more.

Cheers!