Hi, 

I'm implementing the coltrane blog app in "Practical Django Projects"
and when I try to syncdb I get this odd error:

Error: Couldn't install apps, because there were errors in one or more
models:
coltrane: cannot import name ugettext_lazy

Anybody knows what this might mean?


Thanks in advance,
Fernando

PS: 
These are my installed apps:

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.admin',
    'django.contrib.flatpages',
    'cms.search',
    'coltrane',
)

And this is my model:


import datetime

from django.db import models
from django.contrib.auth.models import User
from tagging.fields import TagField
from markdown import markdown

import datetime


class Category(models.Model):
    """
    Categories that will be  assigned to entries
    """
    title = models.CharField(maxlength=250, help_text = "Maximum 250
chars")
    slug = models.SlugField(prepopulate_from=['title'], 
                            unique=True,
                            help_text = "Suggested value automagically
generated from title. Must be unique")
    description = models.TextField()
    
    class Meta:
        verbose_name_plural = "Categories"
        ordering = ['title']
    
    class Admin:
        pass
    
    def __unicode__(self):
        return self.title
    
    def __str__(self):
        """
        Admin uses this one to name the instance
        """
        return self.title
    
    def get_absolute_url(self):
        """
        All django models that will be used in a public facing view must
        implemente this method.
        """
        return "/categories/%s/" % (self.slug)
    
    
class Entry(models.Model):
    """
    Article
    """
    LIVE_STATUS = 1
    DRAFT_STATUS = 2
    HIDDEN_STATUS = 3

    STATUS_CHOICES = ((LIVE_STATUS, 'Live'),
                      (DRAFT_STATUS, 'Draft'),
                      (HIDDEN_STATUS, 'Hidden'),)
    
    title = models.CharField(maxlength=250)
    slug = models.SlugField(prepopulate_from=['title'],
                            unique_for_date='pub_date')
    excerpt = models.CharField(blank=True)
    body = models.TextField()
    pub_date = models.DateField(default = datetime.datetime.now)
    author = models.ForeignKey(User)
    enable_comments = models.BooleanField(default=True)
    featured = models.BooleanField(default = False)
    status = models.IntegerField(choices = STATUS_CHOICES, default =
Entry.LIVE_STATUS)
    categories = models.ManyToManyField(Category)
    tags = TagField()
    
    # html rendered fields
    # editable=False means it shouldn't be editable in the admin view
    excerpt_html = models.TextField(editable=False, blank=True)
    body_html = models.TextField(editable=False, blank=True)
    
    class Meta:
        verbose_name_plural = "Entries"
        ordering = ['-pub_date']
        
    class Admin:
        pass
    
    def __unicode__(self):
        return "%s - (%s)" % (self.title, self.pub_date.strftime("%Y/%
b/%d").lower())
    
    def __str__(self):
        return self.__unicode__()
    
    def get_absolute_url(self):
        """
        All django models that will be used in a public facing view must
        implemente this method.
        """
        return "/weblog/%s/%s" % (self.pub_date.strftime("%Y/%b/%
d").lower(), self.slug)
    
    def save(self):
        """
        Override Model's save method to save an htmlified version of the
        markdown text.
        """
        self.body_html = markdown(self.body)
        if self.excerpt:
            self.excerpt_html = markdown(self.excerpt)
        
        super(Entry, self).save()
            



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to