Created
August 15, 2012 19:43
-
-
Save angusb/3362991 to your computer and use it in GitHub Desktop.
channelstaticmeta orm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ChannelStaticMeta(models.Model): | |
cstmid = models.AutoField(primary_key=True) | |
channels_cid = models.ForeignKey(Channel, db_column="cid", unique=True) | |
regex = models.CharField(max_length=255, null=False, blank=True) | |
class Meta: | |
db_table = u"channels_static_meta" | |
verbose_name = "Channel Static Meta" | |
verbose_name_plural = "Channel Static Metas" | |
DROP TABLE IF EXISTS `channels_static_meta`; | |
/*!40101 SET @saved_cs_client = @@character_set_client */; | |
/*!40101 SET character_set_client = utf8 */; | |
CREATE TABLE `channels_static_meta` ( | |
`cstmid` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID needed for Django ORM', | |
`channels_cid` int(11) NOT NULL COMMENT 'Channel on which we are gonna apply the regex', | |
`regex` varchar(255) NOT NULL DEFAULT '' COMMENT 'Regex used to select the content where the links are', | |
PRIMARY KEY (`cstmid`), | |
UNIQUE KEY `U_csm_channels_cid` (`channels_cid`), | |
CONSTRAINT `FK_csm_channels_cid` FOREIGN KEY (`channels_cid`) REFERENCES `channels` (`cid`) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
/*!40101 SET character_set_client = @saved_cs_client */; | |
# I get error Exception: This table is not defined in the db routing table class. when doing ChannelStaticMeta.objects.all() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment