Re: cannot import name ugettext_lazy

2008-08-28 Thread Wayne Dyck

> No, it wasn't. I'm really not making this up: ugettext_lazy() has been
> in trunk since July 4 last year!

Bizarre. Okay. I will take your word for it. I am fairly new to Django
so I am not excusing the fact that it might simply be ignorance on my
part how everything works and the location of the functions.

I will download the latest from SVN, try again, and let you know how I
make out.

Thanks again for your information.

Wayne

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: cannot import name ugettext_lazy

2008-08-28 Thread Malcolm Tredinnick


On Thu, 2008-08-28 at 19:20 -0700, Wayne Dyck wrote:
> > Well, it's int django/utils/translation/__init__.py. Specifically:
> >
> > http://code.djangoproject.com/browser/django/trunk/django/utils/trans...
> 
> It looks like it was just checked in a little while ago. I will
> download the latest from SVN and try that.

No, it wasn't. I'm really not making this up: ugettext_lazy() has been
in trunk since July 4 last year!

It was added to __all__ a few hours ago, but that is irrelevant to the
question you asked, as I indicated in my reply to Karen. If you're
actually doing "from django.utils.translation import *" and then trying
to use ugettext_lazy, that would be a different story, but that wasn't
what you said you were doing.

Regards,
Malcolm



--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: cannot import name ugettext_lazy

2008-08-28 Thread Wayne Dyck

> Well, it's int django/utils/translation/__init__.py. Specifically:
>
> http://code.djangoproject.com/browser/django/trunk/django/utils/trans...

It looks like it was just checked in a little while ago. I will
download the latest from SVN and try that.

Thanks. I appreciate it.

Wayne

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: cannot import name ugettext_lazy

2008-08-28 Thread Malcolm Tredinnick


On Thu, 2008-08-28 at 18:37 -0700, Wayne Dyck wrote:
> > I think the original poster's tarball of Django is broken. At least the
> > 1.0-alpha version is. The 0.96 releases never had ugettext_lazy().
> 
> So I should be seeing it at this location django.utils.translation in
> the latest SVN beta? I browsed the code today on the website and
> didn't see it in there.

Well, it's int django/utils/translation/__init__.py. Specifically:

http://code.djangoproject.com/browser/django/trunk/django/utils/translation/__init__.py#L70

Regards,
Malcolm


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: cannot import name ugettext_lazy

2008-08-28 Thread Wayne Dyck

> I think the original poster's tarball of Django is broken. At least the
> 1.0-alpha version is. The 0.96 releases never had ugettext_lazy().

So I should be seeing it at this location django.utils.translation in
the latest SVN beta? I browsed the code today on the website and
didn't see it in there.

Is this something simple that I am missing?

Wayne

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: cannot import name ugettext_lazy

2008-08-28 Thread Malcolm Tredinnick


On Thu, 2008-08-28 at 21:18 -0400, Karen Tracey wrote:
[...]
> 
> Make sure you have an SVN checkout at revision 8680 or higher.  This:
> 
> http://code.djangoproject.com/ticket/8654
> 
> looks like it could be responsible for what you are reporting, and the
> fix was only checked in about five hours ago.

No, that's unrelated. The __all__ variable is only relevant for the
"from foo import *" style of imports. When importing by name, it looks
directly in the module.

I think the original poster's tarball of Django is broken. At least the
1.0-alpha version is. The 0.96 releases never had ugettext_lazy().

The function has been in trunk since July 4, 2007 (when the unicode
branch was merged in [5609]). If ugettext_lazy() was made unavailable,
it would take about 15 seconds for the bugs to be reported. It's used
all over the place, even inside Django.

Regards,
Malcolm

> 


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: cannot import name ugettext_lazy

2008-08-28 Thread Karen Tracey
On Thu, Aug 28, 2008 at 9:10 PM, Wayne Dyck <[EMAIL PROTECTED]> wrote:

>
> A couple of applications I have tried to install fail trying to import
> ugettext_lazy. Specifically the import line is:
>
> django.utils.translation import ugettext_lazy as _
>
> I have seen a number of posts that suggest getting the latest source
> from SVN. I have Django version 96.2 and I have downloaded the latest
> 1.0 alpha (or something close to that) from SVN. The ugettext_lazy is
> missing from both.
>
> Any help or suggestions on what I have missed would be appreciated.
>
>
Make sure you have an SVN checkout at revision 8680 or higher.  This:

http://code.djangoproject.com/ticket/8654

looks like it could be responsible for what you are reporting, and the fix
was only checked in about five hours ago.

Karen

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



cannot import name ugettext_lazy

2008-08-28 Thread Wayne Dyck

A couple of applications I have tried to install fail trying to import
ugettext_lazy. Specifically the import line is:

django.utils.translation import ugettext_lazy as _

I have seen a number of posts that suggest getting the latest source
from SVN. I have Django version 96.2 and I have downloaded the latest
1.0 alpha (or something close to that) from SVN. The ugettext_lazy is
missing from both.

Any help or suggestions on what I have missed would be appreciated.

Thanks.

Wayne

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Error: cannot import name ugettext_lazy

2008-07-21 Thread Fernando Rodríguez

El lun, 21-07-2008 a las 12:10 -0500, James Bennett escribió:

> You will not be able to follow along with the book using the Django
> 0.96 release (as stated in the opening chapters). You will need to
> instal a dev version from SVN.
> 

Thanks, I just got version 0.97 from svn.



--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Error: cannot import name ugettext_lazy

2008-07-21 Thread Fernando Rodríguez

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
-~--~~~~--~~--~--~---