diff --git a/docs/main/Auth/Customization.rst b/docs/main/Auth/Customization.rst index 7ea569c..ed701b4 100644 --- a/docs/main/Auth/Customization.rst +++ b/docs/main/Auth/Customization.rst @@ -172,9 +172,9 @@ quickstart, you should follow the instructions described in this section: users = relation('User', secondary=user_group_table, backref='groups') def __repr__(self): - return '' % self.group_name - - + return (u'' % self.group_name).encode('utf-8') + + class User(DeclarativeBase): """Reasonably basic User definition. Probably would want additional attributes. @@ -194,9 +194,9 @@ quickstart, you should follow the instructions described in this section: created = Column(DateTime, default=datetime.now) def __repr__(self): - return '' % ( - self.email_address, self.display_name) - + return (u'' % ( + self.email_address, self.display_name)).encode('utf-8') + @property def permissions(self): perms = set() diff --git a/docs/main/SQLAlchemy.rst b/docs/main/SQLAlchemy.rst index f9de291..ee5463e 100644 --- a/docs/main/SQLAlchemy.rst +++ b/docs/main/SQLAlchemy.rst @@ -161,7 +161,7 @@ oriented way of manipulating your data:: self.description = description def __repr__(self): - return "" % (self.title, self.year, self.description) + return (u"" % (self.title, self.year, self.description)).encode('utf-8') If you don't define the __init__ method. You will need to update the diff --git a/docs/main/explorequickstart.rst b/docs/main/explorequickstart.rst index 03cfca4..6f9541e 100644 --- a/docs/main/explorequickstart.rst +++ b/docs/main/explorequickstart.rst @@ -497,7 +497,7 @@ And then the Group definition:: users = relation('User', secondary=user_group_table, backref='groups') def __repr__(self): - return '' % self.group_name + return (u'' % self.group_name).encode('utf-8') def __unicode__(self): return self.group_name @@ -547,8 +547,8 @@ more easily. .. code-block:: python def __repr__(self): - return '' % ( - self.email_address, self.display_name) + return (u'' % ( + self.email_address, self.display_name)).encode('utf-8') def __unicode__(self): return self.display_name or self.user_name @@ -672,7 +672,7 @@ simple to understand. And that brings us to the end of our file:: backref='permissions') def __repr__(self): - return '' % self.permission_name + return (u'' % self.permission_name).encode('utf-8') def __unicode__(self): return self.permission_name diff --git a/docs/main/movie_tutorial.rst b/docs/main/movie_tutorial.rst index 6e20265..60ad23a 100644 --- a/docs/main/movie_tutorial.rst +++ b/docs/main/movie_tutorial.rst @@ -80,9 +80,9 @@ We'll create a new file "movie.py" in our "model" directory with this content:: genre = relation('Genre',foreign_keys=genre_id ) reviewed = Column(Boolean, nullable=False, default=False ) def __repr__(self): - return "" % ( + return (u"" % ( self.title, self.year, self.description - ) + )).encode('utf-8') class Genre(DeclarativeBase): __tablename__ = 'genre' id = Column(Integer,primary_key=True)