<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Model on Caktus Group</title><link>https://www.caktusgroup.com/tags/model/</link><description>Recent content in Model on Caktus Group</description><generator>Hugo</generator><language>en</language><lastBuildDate>Fri, 26 Apr 2019 16:32:33 +0000</lastBuildDate><atom:link href="https://www.caktusgroup.com/tags/model/index.xml" rel="self" type="application/rss+xml"/><item><title>How to Switch to a Custom Django User Model Mid-Project</title><link>https://www.caktusgroup.com/blog/2019/04/26/how-switch-custom-django-user-model-mid-project/</link><pubDate>Fri, 26 Apr 2019 16:32:33 +0000</pubDate><guid>https://www.caktusgroup.com/blog/2019/04/26/how-switch-custom-django-user-model-mid-project/</guid><description>&lt;p>The Django documentation recommends always &lt;a href="https://docs.djangoproject.com/en/2.2/topics/auth/customizing/#using-a-custom-user-model-when-starting-a-project" target="_blank" rel="noopener noreferrer">starting your project with a
custom user
model&lt;/a>
(even if it's identical to Django's to begin with), to make it easier
to customize later if you need to. But what are you supposed to do if
you didn't see this when starting a project, or if you inherited a
project without a custom user model and you need to add one?&lt;/p></description></item><item><title>Using Unsaved Related Models for Sample Data in Django 1.8</title><link>https://www.caktusgroup.com/blog/2015/07/28/using-unsaved-related-models-sample-data-django-18/</link><pubDate>Tue, 28 Jul 2015 15:54:33 +0000</pubDate><guid>https://www.caktusgroup.com/blog/2015/07/28/using-unsaved-related-models-sample-data-django-18/</guid><description>&lt;p>&lt;strong>Note:&lt;/strong> In between the time I originally wrote this post and it
getting published, a
&lt;a href="https://code.djangoproject.com/ticket/25160" target="_blank" rel="noopener noreferrer">ticket&lt;/a> and &lt;a href="https://github.com/django/django/pull/5060" target="_blank" rel="noopener noreferrer">pull
request&lt;/a> were opened in
Django to remove &lt;code>allow_unsaved_instance_assignment&lt;/code> and move validation
to the model &lt;code>save()&lt;/code> method, which makes much more sense anyways. It's
likely this will even be backported to Django 1.8.4. So, if you're
using a version of Django that doesn't require this, hopefully you'll
never stumble across this post in the first place! If this is still an
issue for you, here's the original post:&lt;/p></description></item><item><title>Migrating to a Custom User Model in Django</title><link>https://www.caktusgroup.com/blog/2013/08/07/migrating-custom-user-model-django/</link><pubDate>Wed, 07 Aug 2013 13:10:00 +0000</pubDate><guid>https://www.caktusgroup.com/blog/2013/08/07/migrating-custom-user-model-django/</guid><description>&lt;p>&lt;strong>UPDATE: Read a&lt;/strong> &lt;a href="https://www.caktusgroup.com/blog/2019/04/26/how-switch-custom-django-user-model-mid-project/">&lt;strong>newer blog post on this
topic&lt;/strong>&lt;/a>.&lt;/p>
&lt;p>The new &lt;a href="https://docs.djangoproject.com/en/1.5/topics/auth/customizing/" target="_blank" rel="noopener noreferrer">custom user model
configuration&lt;/a>
that arrived in Django makes it relatively straightforward to swap in
your own model for the Django user model. In most cases, Django's
built-in &lt;code>User&lt;/code> model works just fine, but there are times when certain
limitations (such as the &lt;a href="https://docs.djangoproject.com/en/1.5/ref/models/fields/#emailfield" target="_blank" rel="noopener noreferrer">length of the email
field&lt;/a>)
require a custom user model to be installed. If you're starting out
with a custom user model, setup and configuration are relatively
straightforward, but if you need to migrate an existing legacy project
(e.g., one that started out in Django 1.4 or earlier), there are a few
gotchas that you might run into. We did this recently for one of our
larger, long-term client projects at Caktus, and here's an outline of
how we'd recommend tackling this issue:&lt;/p></description></item><item><title>Making your Django app more pluggable</title><link>https://www.caktusgroup.com/blog/2013/06/12/making-your-django-app-more-pluggable/</link><pubDate>Wed, 12 Jun 2013 12:08:27 +0000</pubDate><guid>https://www.caktusgroup.com/blog/2013/06/12/making-your-django-app-more-pluggable/</guid><description>&lt;p>This blog post is about ways of doing things in your Django app, and
pitfalls to avoid, so your app is easier to plug in to other sites.&lt;/p></description></item><item><title>Django Fundamentals Bootcamp Recap</title><link>https://www.caktusgroup.com/blog/2012/07/12/django-fundamentals-bootcamp-recap/</link><pubDate>Thu, 12 Jul 2012 20:34:03 +0000</pubDate><guid>https://www.caktusgroup.com/blog/2012/07/12/django-fundamentals-bootcamp-recap/</guid><description>&lt;p>On June 8th and 9th, Caktus hosted its first
&lt;a href="http://www.caktusgroup.com/events/details/django-fundamentals-bootcamp" target="_blank" rel="noopener noreferrer">&lt;/a>Django
Fundamentals Bootcamp. The Caktus team developed the idea for the
course, which was a crossword drill application, and has been developing
the structure and content of the course over the past year. The bootcamp
was designed to teach programmers who have experience in programming
with different languages and introduce them to the fundamentals of
building a web application with Django. We created an interactive
environment where the instructors and students were able to communicate
with one another which solved the issue of how to begin developing in an
unfamiliar language.&lt;/p></description></item><item><title>OpenBlock Geocoder, Part 1: Data Model and Geocoding</title><link>https://www.caktusgroup.com/blog/2011/12/12/openblock-geocoder-part-1-data-model-and-geocoding/</link><pubDate>Mon, 12 Dec 2011 16:17:20 +0000</pubDate><guid>https://www.caktusgroup.com/blog/2011/12/12/openblock-geocoder-part-1-data-model-and-geocoding/</guid><description>&lt;p>As Tobias mentioned in &lt;a href="http://www.caktusgroup.com/blog/2011/12/06/scraping-data-and-web-standards/">Scraping Data and Web Standards&lt;/a>, Caktus is collaborating with the UNC School of Journalism to help develop Open Rural (the code is on &lt;a href="https://github.com/openrural">GitHub&lt;/a>). Open Rural hopes to help rural newspapers in North Carolina leverage &lt;a href="http://openblockproject.org/">OpenBlock&lt;/a>. This blog post is the first of several covering the internals of OpenBlock and, specifically, the geocoder.&lt;/p></description></item><item><title>Simplifying the Testing of Unmanaged Database Models in Django (Updated for Django 4.2 in 2024)</title><link>https://www.caktusgroup.com/blog/2010/09/24/simplifying-the-testing-of-unmanaged-database-models-in-django/</link><pubDate>Fri, 24 Sep 2010 15:01:09 +0000</pubDate><guid>https://www.caktusgroup.com/blog/2010/09/24/simplifying-the-testing-of-unmanaged-database-models-in-django/</guid><description>&lt;p>&lt;em>Editor's note: This post was originally published in September, 2010
and was updated in December, 2024 to incorporate changes in Django and
improvements suggested by our readers. It has also been tested for
compatibility as of the Django 4.2 release.&lt;/em>&lt;/p></description></item><item><title>Creating recursive, symmetrical many-to-many relationships in Django</title><link>https://www.caktusgroup.com/blog/2009/08/14/creating-recursive-symmetrical-many-to-many-relationships-in-django/</link><pubDate>Fri, 14 Aug 2009 18:10:43 +0000</pubDate><guid>https://www.caktusgroup.com/blog/2009/08/14/creating-recursive-symmetrical-many-to-many-relationships-in-django/</guid><description>&lt;p>In Django, a recursive many-to-many relationship is a &lt;code>ManyToManyField&lt;/code>
that points to the same model in which it's defined &lt;code>('self')&lt;/code>. A
symmetrical relationship is one in where, when &lt;code>a.contacts = [b]&lt;/code>, a is
in &lt;code>b.contacts&lt;/code>.&lt;/p></description></item><item><title>Migrating from django-photologue 1.x to 2.x</title><link>https://www.caktusgroup.com/blog/2009/03/27/migrating-from-django-photologue-1x-to-2x/</link><pubDate>Fri, 27 Mar 2009 17:52:30 +0000</pubDate><guid>https://www.caktusgroup.com/blog/2009/03/27/migrating-from-django-photologue-1x-to-2x/</guid><description>&lt;p>We're in the process of updating a web app for a client that was built
last year about this time using &lt;a href="http://www.djangoproject.com" target="_blank" rel="noopener noreferrer">Django&lt;/a>
and &lt;a href="http://code.google.com/p/django-photologue/" target="_blank" rel="noopener noreferrer">Photologue&lt;/a>. Needless
to say, there have been a lot of changes to both over the past year!&lt;/p></description></item><item><title>Why Caktus Uses Django</title><link>https://www.caktusgroup.com/blog/2009/01/13/why-caktus-uses-django/</link><pubDate>Tue, 13 Jan 2009 15:45:31 +0000</pubDate><guid>https://www.caktusgroup.com/blog/2009/01/13/why-caktus-uses-django/</guid><description>&lt;p>Here at &lt;a href="http://www.caktusgroup.com/services/" target="_blank" rel="noopener noreferrer">Caktus&lt;/a>, we use the
popular &lt;a href="http://www.djangoproject.com" target="_blank" rel="noopener noreferrer">Django&lt;/a> web framework for a lot
of our custom web application development. We don't use Django simply
because it's popular, easy to learn, or happened to be the first thing
we found. We've written web apps in PHP, Java, and Ruby on Rails--all
before we discovered Django--but were never quite satisfied. Following
are just a few of the reasons that we both enjoy working with Django and
believe it gives you (the client) the best end-product.&lt;/p></description></item><item><title>Asterisk CDR &amp; Django integration with ODBC</title><link>https://www.caktusgroup.com/blog/2008/10/13/asterisk-cdr-django-odbc/</link><pubDate>Mon, 13 Oct 2008 14:58:09 +0000</pubDate><guid>https://www.caktusgroup.com/blog/2008/10/13/asterisk-cdr-django-odbc/</guid><description>&lt;p>Tobias already
&lt;a href="http://www.caktusgroup.com/blog/2007/12/15/is-asterisk-more-silent-than-youd-like/" target="_blank" rel="noopener noreferrer">mentioned&lt;/a>
how Caktus uses &lt;a href="http://www.asterisk.org/" target="_blank" rel="noopener noreferrer">Asterisk&lt;/a> as our PBX. He also
mentioned how we tested various frontends both for managing the asterisk
configuration and interacting with asterisk to, for example, check our
voicemail. We were inticed by some of the client management solutions
that we could plumb up with asterisk. Caktus has a loose administration
structure, which allows us to be flexible and not have levels of
managers between clients and coders. But, this flexiblility can leave
loose ends unchecked when the person in charge of a project is
distracted for a day or two. We saw this as an opportunity where Caktus
could add a level of group accountability and use some neat technology.
We also wanted a tool that would integrate well with our current
homegrown &lt;a href="http://www.djangoproject.com" target="_blank" rel="noopener noreferrer">Django&lt;/a>ERP/CRM as well as Trac,
our prefered tool for project management. So, we decided to write some
sweet code.&lt;/p></description></item><item><title>Database Explained for the Business Professional</title><link>https://www.caktusgroup.com/blog/2008/02/22/database-explained-for-the-business-professional/</link><pubDate>Fri, 22 Feb 2008 08:23:58 +0000</pubDate><guid>https://www.caktusgroup.com/blog/2008/02/22/database-explained-for-the-business-professional/</guid><description>&lt;p>One problem with marketing is that it introduces pseudo-false concepts,
arbitrarily divorces necessarily wed ones, and leaves out all the gory
details. We recently had a client ask us,&lt;/p></description></item></channel></rss>