Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 956 Categories, Downloaded 50.076.860 Times

django-simple-ratings 0.2.0

Company: Charles Leifer
Date Added: September 06, 2013  |  Visits: 410

django-simple-ratings

Report Broken Link
Printer Friendly Version


Product Homepage
Download (34 downloads)



a simple, extensible rating system.<br />With a little bit more<br /><br />also, a playground for different stuff i've been reading about in programming collective intelligence, by toby segaran.<br /><br />this stuff lives in utils.py and is there if you want to experiment (or contribute!).<br />Getting started<br /><br />you'd like to add ratings to some model:<br /><br />from django.db import models<br />from rating.models import Ratings<br /><br />class Food(models.Model):<br /> name = models.CharField(max_length=50)<br /><br /> ratings = Ratings()<br /><br />now, you can:<br /><br /># add ratings to things<br />>>> apple.ratings.rate(user=john, score=1)<br /><RatedItem: apple rated 1 by john><br /><br />>>> apple.ratings.rate(user=jane, score=5)<br /><RatedItem: apple rated 5 by jane><br /><br /># get interesting aggregate data<br />>>> apple.ratings.all()<br />[<RatedItem: apple rated 1 by john>, <RatedItem: apple rated 5 by jane>]<br /><br />>>> apple.ratings.cumulative_score()<br />6<br /><br />>>> apple.ratings.average_score()<br />3.0<br /><br /># order things by their rating<br />>>> Food.ratings.order_by_rating()<br />[<Food: apple>, <Food: orange>]<br /><br />Use GFKs, FKs, whatever<br /><br />By default, whenever you add Ratings() to your model it uses the RatedItem model which has a GFK on it. Suppose you are only rating one thing, or would like to have an explicit database constraint -- that's no problem. You can provide a custom RatedItem model with a ForeignKey instead of a GFK. Here's the example from the tests:<br /><br />class BeverageRating(RatedItemBase):<br /> content_object = models.ForeignKey('Beverage')<br /><br /><br />class Beverage(models.Model):<br /> name = models.CharField(max_length=50)<br /><br /> ratings = Ratings(BeverageRating)<br /><br /> def __unicode__(self):<br /> return self.name<br /><br />The API is exactly the same.<br /><br />#md5=572cb4ce063604a4818c67d4e91f1d4b

Requirements: No special requirements
Platforms: *nix, Linux
Keyword: Apple Appleratingsaverage Score Import Model Modelscharfieldmax Length Order Rated Rateditem Rating Ratinggtgtgt Ratings Stuff Suppose Thing Things Whateverby
Users rating: 0/10

License: Freeware Size: 10.24 KB
USER REVIEWS
More Reviews or Write Review


DJANGO-SIMPLE-RATINGS RELATED
Network & Internet  -  django-sortedm2m 0.3.0
django-sortedm2m is a drop in replacement for Django's own ManyToManyField. The provided SortedManyToManyField behaves like the original one but remembers the order of added relations. sortedm2m requires at least django 1.2. Django 1.1...
20.48 KB  
Programming  -  redisco 0.1.0
Redisco is a Python module that allows you to store objects in _Redis: http://code.google.com/p/redis/. It is inspired by Ruby library _Ohm: http://github.com/soveran/ohm/ and its design and code are loosely based on Ohm and the Django ORM. It is...
20.48 KB  
Network & Internet  -  django-compound-field 0.1
django-compound-field is a Django add-on that allows you to define compound fields, e.g. {{{ class AddressField(CompoundField): phone = models.CharField(max_length=30) mobile = models.CharField(max_length=30) fax...
20.48 KB  
Multimedia & Graphics  -  JPhotoTagger 0.15.2
JPhotoTagger is a platform independent Photo Manager. You can manage and find fast your photos through keywords, descriptions and other so called metadata ("tags"). It speeds up adding or editing tags through automatic keyboard input completion...
8 MB  
Multimedia & Graphics  -  Portable JPhotoTagger 0.15.2
JPhotoTagger is a platform independent Photo Manager. You can manage and find fast your photos through keywords, descriptions and other so called metadata ("tags"). It speeds up adding or editing tags through automatic keyboard input completion...
8 MB  
MP3 Tools  -  Final Selection 1.2.0
With Final Selection you can make the selection of your photos as you have always wanted! - Create your selection of photos using the colors, give them a score using the stars and order them by dragging them to the position you want - Save...
11.67 MB  
MP3 Tools  -  FlipPageMaker Free Flip Page Creator 1.0.0
It's not easy to draw people's attention with simply plain Text file, but presenting it in flash way can be totally different. Now our flipbook creator - Free Flip Page Creator, can definitely help you with this. This freeware will enable you to...
8.92 MB  
Development Tools  -  0-1 Knapsack 1.0
Please let others rate your work. Rating your own stuff highly says nothing about the code, but perhaps drops you closer to the level of a spammer on the FEX like Marco. So let the rating system do its job. I know that you think your stuff is...
10 KB  
Development Tools  -  MatData 1.02
MatData 1.02usage:call read(filename,varname,var)call write(filename,varname,var,action)where "filename" is the string of .mat file's name, "varname" is the string of variable's name stored in .mat file, "var" is the variable's name in Fortran...
10 KB  
Modules  -  Metascore Button 1.00
This button was created for users who use the Metascore Plugin on their Joomla based website that was developed by Mr. Ayan Debnath. Users must install the Metascore Plugin extension in order for this button to have any functional use. You can...
10 KB  
NEW DOWNLOADS IN LINUX SOFTWARE, NETWORK & INTERNET
Linux Software  -  EasyEDA PCB Designer for Linux 2.0.0
EasyEDA, a great web based EDA(Electronics Design Automation) tool, online PCB tool, online PCB software for electronics engineers, educators, students, makers and enthusiasts. Theres no need to install any software. Just open EasyEDA in any...
34.4 MB  
Linux Software  -  wpCache® WordPress HTTP Cache 1.9
wpCache® is a high-performance, distributed object, caching system application, generic in nature, but intended for use in speeding up dynamic web applications, by decreasing database load time. wpCache® decreases dramatically the page...
3.51 MB  
Linux Software  -  Polling Autodialer Software 3.4
ICTBroadcast Auto Dialer software has a survey campaign for telephone surveys and polls. This auto dialer software automatically dials a list of numbers and asks them a set of questions that they can respond to, by using their telephone keypad....
488 B  
Linux Software  -  Total Video Converter Mac Free 3.5.5
Total Video Converter Mac Free developed by EffectMatrix Ltd is the official legal version of Total Video Converter which was a globally recognized brand since 2006. Total Video Converter Mac Free is a free but powerful all-in-one video...
17.7 MB  
Linux Software  -  Skeith mod_log_sql Analyzer 2.10beta2
Skeith is a php based front end for analyzing logs for Apache using mod_log_sql.
47.5 KB  
Network & Internet  -  Free WiFi Hotspot 3.3.1
Free WiFi Hotspot is a super easy solution to turn your laptop or notebook into a portable Wi-Fi hotspot, wirelessly sharing your internet connections like DSL, Cable, Bluetooth, Mobile Broadband Card, Dial-Up, etc. through the built-in wireless...
1.04 MB  
Network & Internet  -  Easy Uploads 1.8
Easy uploads is a file storage media streaming application designed by Filestreamers that allows you to upload, store, and stream your files from their virtually unlimited file storage server. Easy Uploads can backup,share, and stream your files...
615.97 KB  
Network & Internet  -  PacketFence ZEN 3.1.0
PacketFence is a fully supported, trusted, Free and Open Source network access control (NAC) system. Boosting an impressive feature set including a captive-portal for registration and remediation, centralized wired and wireless management, 802.1X...
1024 MB  
Network & Internet  -  django-dbstorage 1.3
A Django file storage backend for files in the database.
10.24 KB  
Network & Internet  -  SQL Inject Me 0.4.5
SQL Inject Me is a Firefox extension used to test for SQL Injection vulnerabilities. The tool works by submitting your HTML forms and substituting the form value with strings that are representative of an SQL Injection attack.
133.12 KB