Re: Why does MySql gives warning? Incorrect string value: '\xE6\x9D\xB1\xE8\xA8\xBC...' for column 'title' at row 1
Thanks for the suggestion :) --~--~-~--~~~---~--~~ 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: Why does MySql gives warning? Incorrect string value: '\xE6\x9D\xB1\xE8\xA8\xBC...' for column 'title' at row 1
Thanks Malcolm, You solved my problem. These tables were something that I was using from a previous application so all the mess.. As suggested by you, this is what I did. mysql> show create table ac_project_messages; +- +- + | Table | Create Table | +- +- + | ac_project_messages | CREATE TABLE `ac_project_messages` ( `id` int(10) unsigned NOT NULL auto_increment, `milestone_id` int(10) unsigned default NULL, `project_id` int(10) unsigned default NULL, `category_id` int(10) unsigned NOT NULL default '0', `title` varchar(100) default NULL, `text` text, `additional_text` text, `is_important` tinyint(1) unsigned NOT NULL default '0', `is_private` tinyint(1) unsigned NOT NULL default '0', `comments_enabled` tinyint(1) unsigned NOT NULL default '0', `anonymous_comments_enabled` tinyint(1) unsigned NOT NULL default '0', `created_on` datetime NOT NULL default '-00-00 00:00:00', `created_by_id` int(10) unsigned default NULL, `updated_on` datetime NOT NULL default '-00-00 00:00:00', `updated_by_id` int(10) unsigned default NULL, PRIMARY KEY (`id`), KEY `milestone_id` (`milestone_id`), KEY `project_id` (`project_id`), KEY `created_on` (`created_on`) ) ENGINE=MyISAM AUTO_INCREMENT=360 DEFAULT CHARSET=latin1 | +- +- + 1 row in set (0.00 sec) mysql> alter table ac_project_messages DEFAULT CHARSET=utf8; Query OK, 80 rows affected (0.13 sec) Records: 80 Duplicates: 0 Warnings: 0 mysql> show create table ac_project_messages; +-
Why does MySql gives warning? Incorrect string value: '\xE6\x9D\xB1\xE8\xA8\xBC...' for column 'title' at row 1
I am using webfactional for hosting my site. I created my database from the control panel with utf8 as the encoding. I want my application to be able to use other characters than English like Japanese etc.. This is one of my models: class AcProjectMessages(models.Model): milestone_id = models.ForeignKey('AcProjectMilestones', db_column = "milestone_id", blank=True) project_id = models.ForeignKey('Project', db_column = "project_id") category_id = models.ForeignKey('AcProjectMsgCategories', db_column = "category_id", blank = True) title = models.CharField(max_length=300, blank=True) text = models.TextField(blank=True) additional_text = models.TextField(blank=True) is_important = models.BooleanField() is_private = models.BooleanField() comments_enabled = models.BooleanField() anonymous_comments_enabled = models.BooleanField() created_on = models.DateTimeField() created_by_id = models.ForeignKey(User, db_column = "created_by_id", related_name = 'message_created_by') updated_on = models.DateTimeField() updated_by_id = models.ForeignKey(User, db_column = "updated_by_id", related_name = 'message_updated_by') def get_absolute_url(self): return P2M_HOME_URL + "/projects/" + str(self.project_id.id) +"/messages/" + str(self.id) + "/" def get_rss_title(self): if self.updated_on > self.created_on: return str(self.title) + " updated by: " + str(self.updated_by_id) else: return str(self.title) + " created by: " + str(self.created_by_id) def __unicode__(self): return self.title class Admin: list_display = ('title','created_on','updated_on',) list_filter = ('created_on','updated_on',) search_fields = ('title') ordering = ('-updated_on',) class Meta: ordering = ('-updated_on',) db_table = u'ac_project_messages' verbose_name = u'Project Message' verbose_name_plural = u'Project Messages' I checked whether utf8 is supported in my database so I did something like this: [EMAIL PROTECTED] p2m]$ python manage.py dbshell; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1761118 Server version: 5.0.45 Source distribution Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> status; -- Ver 14.12 Distrib 5.0.45, for redhat-linux-gnu (i686) using readline 5.0 Connection id: 1761118 Current database: natesmith00_tam Current user: [EMAIL PROTECTED] SSL:Not in use Current pager: stdout Using outfile: '' Using delimiter:; Server version: 5.0.45 Source distribution Protocol version: 10 Connection: Localhost via UNIX socket Server characterset:latin1 Db characterset:utf8 Client characterset:latin1 Conn. characterset:latin1 UNIX socket:/var/lib/mysql/mysql.sock Uptime: 21 days 16 hours 43 min 54 sec Threads: 2 Questions: 35633901 Slow queries: 0 Opens: 1531178 Flush tables: 1 Open tables: 64 Queries per second avg: 19.008 -- mysql> desc ac_project_messages; ++-+--+- +-++ | Field | Type| Null | Key | Default | Extra | ++-+--+- +-++ | id | int(10) unsigned| NO | PRI | NULL| auto_increment | | milestone_id | int(10) unsigned| YES | MUL | NULL|| | project_id | int(10) unsigned| YES | MUL | NULL|| | category_id| int(10) unsigned| NO | | 0 || | title | varchar(100)| YES | | NULL|| | text | text| YES | | NULL|| | additional_text| text| YES | | NULL|| | is_important | tinyint(1) unsigned | NO | | 0 || | is_private | tinyint(1) unsigned | NO | | 0 || | comments_enabled | tinyint(1) unsigned | NO | | 0 || | anonymous_comments_enabled | tinyint(1) unsigned | NO | | 0 || | created_on | datetime| NO | MUL | -00-00 00:00:00 || | created_by_id | int(10) unsigned| YES | | NULL
Re: How to get the list of logged in users?
I believe this plugin is to track how many visitors are there in the site, or in the same page. I needed some way to show the usernames of the people who are currently logged in. What can be the smartest way to do that? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
How to get the list of logged in users?
I need to show the currently logged in users in my tempIate. I read somewhere that you can do it using the last_login field of the User. I suppose there must be a better way of doing this. Can someone please help! --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
How to get the list of logged in users?
-> Re: How to get the list of logged in users? django-users <-- Thread --> <-- Date --> <!-- google_ad_client = "pub-7266757337600734"; google_alternate_ad_url = "http://www.mail-archive.com/blank.png"; google_ad_width = 160; google_ad_height = 600; google_ad_format = "160x600_as"; google_ad_channel = "8427791634"; google_color_border = "FF"; google_color_bg = "FF"; google_color_link = "006792"; google_color_url = "006792"; google_color_text = "00"; //--> How to get the list of logged in users? tamonash Re: How to get the list of logged in users? Rene Jochum Reply via email to <!-- google_ad_client = "pub-7266757337600734"; google_alternate_ad_url = "http://www.mail-archive.com/blank.png"; google_ad_width = 160; google_ad_height = 600; google_ad_format = "160x600_as"; google_ad_channel = "8427791634"; google_color_border = "FF"; google_color_bg = "FF"; google_color_link = "006792"; google_color_url = "006792"; google_color_text = "00"; //--> How to get the list of logged in users? tamonash Re: How to get the list of logged in users? Rene Jochum Reply via email to <!-- google_ad_client = "pub-7266757337600734"; google_alternate_ad_url = "http://www.mail-archive.com/blank.png"; google_ad_width = 160; google_ad_height = 600; google_ad_format = "160x600_as"; google_ad_channel = "8427791634"; google_color_border = "FF"; google_color_bg = "FF"; google_color_link = "006792"; google_color_url = "006792"; google_color_text = "00"; //--> How to get the list of logged in users? tamonash Re: How to get the list of logged in users? Rene Jochum Re: How to get the list of logged in users? tamonash Reply via email to