website_twitter_tweet.py 766 B

1234567891011121314151617181920
  1. # -*- coding: utf-8 -*-
  2. # Part of Odoo. See LICENSE file for full copyright and licensing details.
  3. from odoo import fields, models
  4. class WebsiteTwitterTweet(models.Model):
  5. _name = 'website.twitter.tweet'
  6. _description = 'Website Twitter'
  7. website_id = fields.Many2one('website', string='Website', ondelete='cascade')
  8. screen_name = fields.Char(string='Screen Name')
  9. tweet = fields.Text(string='Tweets')
  10. # Twitter IDs are 64-bit unsigned ints, so we need to store them in
  11. # unlimited precision NUMERIC columns, which can be done with a
  12. # float field. Used digits=(0,0) to indicate unlimited.
  13. # Using VARCHAR would work too but would have sorting problems.
  14. tweet_id = fields.Float(string='Tweet ID', digits=(0, 0)) # Twitter