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 49.598.815 Times

django-model-utils 1.1.0

Company: Carl Meyer
Date Added: September 07, 2013  |  Visits: 343

django-model-utils

Report Broken Link
Printer Friendly Version


Product Homepage
Download (35 downloads)



The django-model-utils package contains Django model mixins and utilities.<br /><br />InheritanceCastModel<br /><br />This abstract base class can be inherited by the root (parent) model in a model-inheritance tree. It allows each model in the tree to "know" what type it is (via an automatically-set foreign key to ContentType), allowing for automatic casting of a parent instance to its proper leaf (child) type.<br /><br />For instance, if you have a Place model with subclasses Restaurant and Bar, you may want to query all Places:<br /><br />nearby_places = Place.objects.filter(location='here')<br /><br />But when you iterate over nearby_places, you'll get only Place instances back, even for objects that are "really" Restaurant or Bar. If you have Place inherit from InheritanceCastModel, you can just call the cast() method on each Place and it will return an instance of the proper subtype, Restaurant or Bar:<br /><br />from model_utils.models import InheritanceCastModel<br /><br />class Place(InheritanceCastModel):<br /> ...<br /><br />class Restaurant(Place):<br /> ...<br /><br />nearby_places = Place.objects.filter(location='here')<br />for place in nearby_places:<br /> restaurant_or_bar = place.cast()<br /> ...<br /><br />Note<br /><br />This is inefficient for large querysets, as it results in n queries to the subtype tables. It would be possible to write a QuerySet subclass that could reduce this to k queries, where there are k subtypes in the inheritance tree.<br /><br />TimeStampedModel<br /><br />This abstract base class just provides self-updating created and modified fields on any model that inherits it.<br /><br />Please report bugs to the official home page: http://launchpad.net/django-model-utils<br /><br />#md5=267fd742a24d847bd75beba068e6c5df

Requirements: No special requirements
Platforms: *nix, Linux
Keyword: Abstract Class Inefficient Instance Model Nearby Places Parent Place Placeobjectsfilterlocation Proper Queries Queryset Restaurant Restaurantplace Subtype Tables Write
Users rating: 0/10

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


DJANGO-MODEL-UTILS RELATED
Libraries  -  SOAP::Data::ComplexType 0.041
SOAP::Data::ComplexType is an abstract class for creating and handling complex SOAP::Data objects. SYNOPSIS package My::SOAP::Data::ComplexType::Foo; use strict; use warnings; use SOAP::Data::ComplexType; use vars qw(@ISA); @ISA =...
13.31 KB  
Programming  -  Date::Holidays::Abstract 0.05
This module is an abstract class intended for Date::Holidays::* The goal is to have all the existing and future modules implement the same methods, so they will have a uniform usage and can be used in polymorphic context or can be...
10.24 KB  
Libraries  -  Persistent::Base 0.52
Persistent::Base is an Abstract Persistent Base Class. SYNOPSIS ### we are a subclass of ... ### use Persistent::Base; @ISA = qw(Persistent::Base); ABSTRACT This is an abstract class used by the Persistent framework of classes to...
38.91 KB  
Libraries  -  Apache::Wyrd 0.94
Apache::Wyrd is a Perl module for HTML embeddable perl objects under mod_perl. Apache::Wyrd is the core module in a collection of interoperating modules that allow the rapid object-oriented development of web sites in Apaches mod_perl...
174.08 KB  
Database Tools  -  Database utility class 1.0
Database utility class can execute SELECT, INSERT, UPDATE and DELETE queries from parameters that define tables, fields, values and conditions.Results from SELECT queries are returned in arrays.
10 KB  
Database Tools  -  Persist Class 1.0
Persist Class contains DBConnection class that provides access to relational databases, establishing connections, executing queries and retrieving results.The Persist Class handles storing objects into relational database tables.
10 KB  
Database Tools  -  True MySQL class 1.2
True MySQL class can connect to a specified MySQL host, execute SQL queries and retrieve the results into arrays or objects.Key Features of True MySQL class:- Seek SQL query result sets- Get the number of affected rows and the identifier of the...
10 KB  
Database Tools  -  sql_Generator class 1.0
sql_Generator class is meant to make it easier to generate SQL queries for inserting or updating records in a database table.Just specify the required fields, and then call the class functions to retrieve the SQL statement to perform an insert or...
10 KB  
Libraries  -  Maypole::FormBuilder 0.44
Maypole::FormBuilder is a Perl module with CGI::FormBuilder support in Maypole. SYNOPSIS use Maypole::Application qw( FormBuilder QuickTable ); BeerFB->config->model( Maypole::FormBuilder::Model ); Maypole provides a great framework for...
37.89 KB  
Development Tools  -  PHP Installation System 0.2b 1.0
PHP Installation System is an abstract class which can be used to create a web-based installation script. It provides all the basic interface tools of gathering configuration information from the user while allowing the author to perform all PHP...
 
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