Tastypie with ForeignKey

By : Akshar Raaj

Tastypie with ForeignKeys

This is a followup post on Getting started with tastypie. We will use the same project setup as used in the last post.

This post will cover:

  • Fetch ForeignKey data in GET calls
  • Create an object with ForeignKeys using POST calls

Setup the application

Let's add the capability to categorise the expenses

Add a model called ExpenseCategory

class ExpenseCategory(models.Model):
    name = models.CharField(max_length=100)
    description = models.TextField()

Add a FK from Expense to ExpenseCategory

class Expense(models.Model):
    description = models.CharField(max_length=100)
    amount = models.IntegerField()
    user = models.ForeignKey(User, null=True)
    category = models ...

more info..

Getting started with redis-py

By : Akshar Raaj

This post explains how to interface with Redis from Python and how to use different Redis commands from Python using redis-py.

What this post is not about

  • Comparing relational and non-relational database
  • Comparing MySQL and Redis
  • Introduction to Redis

I assume you know the following

  • Basics of Redis
  • Basic redis commands for working with Strings, Lists and Maps as described at Redis docs.

I did not find enough examples of using redis-py provided methods and so wrote this blog post.

Getting started

Assuming you have Redis installed and your redis server is running.

We will follow the same sequence as ...

more info..
Topics : python redis

Getting started with Django tastypie

By : Akshar Raaj

Django tastypie is a library to write RESTful apis in Django.

Why use REST

You have a database backed web application. This application tracks expenses. The application allows the capability to enter your expenses, view all your expenses, delete an expense etc. Essentially this application provides CRUD functionality. Django application has access to database credentials, but they are never seen by the users of the web application. Django application decides what to show to which user. Django application ensures that a particular user only sees the expenses entered by him and not somebody else's expenses.

Now you want to ...

more info..

Building Chrome Extensions

By : Karambir Singh

In this blog post, we will look at how to build a chrome extension that can work with multiple online services. Specifically we will see how to update Trello web pages with relevant content from Google Drive. For a particular Trello board, we will update trello cards with data from Google Drive document.

Google Chrome extensions are nothing but some html, js files linked together that are running behind the scenes. Before starting out, we need to make sure that Developer mode is checked in chrome://extensions/.

Chrome extensions work by telling chrome about our html, js files using a ...

more info..
© Agiliq, 2009-2012