Metadata-Version: 2.1
Name: django-opengraph-meta
Version: 0.1.2b1
Summary: Django models for OpenGraph based metadata; Server-side metadata generation
Home-page: https://dev.lirent.ru/python/django-opengraph-meta
Author: Gregory Lirent
Author-email: opensource@lirent.ru
Project-URL: homepage, https://dev.lirent.ru/python/django-opengraph-meta
Project-URL: repository, https://dev.lirent.ru/python/django-opengraph-meta/src/branch/master
Project-URL: documentation, https://dev.lirent.ru/python/django-opengraph-meta/src/branch/master/README.md
Keywords: Django Server OpenGraph TwitterCards SocialMedia MetaData
Classifier: Programming Language :: Python :: 3.11
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Framework :: Django :: 5.0
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: Django >=5.0.1

# [django-opengraph-meta](https://dev.lirent.ru/python/django-opengraph-meta)

> This package contains [models](https://docs.djangoproject.com/en/5.0/topics/db/models/), which implements containing and generating extra part of the page's meta information. It is introduced by the OpenGraph and TwitterCard entities

---

## Package includes
#### [Basic models](#basic-models-1):
- [OpenGraph: Webpage](#ogwebpage)
- [OpenGraph: Article](#ogarticlepage)
- [OpenGraph: Book](#ogbookpage)
- [OpenGraph: Profile](#ogprofilepage)
- [OpenGraph: Music.Song](#ogmusicsongpage)
- [OpenGraph: Music.Album](#ogmusicalbumpage)
- [OpenGraph: Music.Playlist](#ogmusicplaylistpage)
- [OpenGraph: Music.Radio Station](#ogmusicradiostationpage)
- [OpenGraph: Video.Movie](#ogvideomoviepage)
- [OpenGraph: Video.Episode](#ogvideoepisodepage)
- [OpenGraph: Video.TV Show](#ogvideotvshowpage)
- [OpenGraph: Video.Other](#ogvideootherpage)
#### [Extra models](#extra-models-1):
- [OpenGraph: Business](#ogbusinesspage)
- [OpenGraph: Product](#ogproductpage)
#### [TwitterCard models](#twittercard-models-1):
- [TwitterCard: Summary](#twittercardsummary)
- [TwitterCard: Summary large image](#twittercardsummarylargeimage)
- [TwitterCard: Player](#twittercardplayer)
- [TwitterCard: App](#twittercardapp)

---

## Package struct

- #### models
  - [OGWebPage](#ogwebpage)
  - [OGArticlePage](#ogarticlepage)
  - [OGBookPage](#ogbookpage)
  - [OGProfilePage](#ogprofilepage)
  - [OGMusicSongPage](#ogmusicsongpage)
  - [OGMusicAlbumPage](#ogmusicalbumpage)
  - [OGMusicPlaylistPage](#ogmusicplaylistpage)
  - [OGMusicRadioStationPage](#ogmusicradiostationpage)
  - [OGVideoMoviePage](#ogvideomoviepage)
  - [OGVideoEpisodePage](#ogvideoepisodepage)
  - [OGVideoTVShowPage](#ogvideotvshowpage)
  - [OGVideoOtherPage](#ogvideootherpage)
  - #### properties
    - OGMedia ([source](django_opengraph_meta/models/properties/media.py#L16))
    - OGImage ([source](django_opengraph_meta/models/properties/media.py#L69))
    - OGVideoStatic ([source](django_opengraph_meta/models/properties/media.py#L75))
    - OGAudioStatic ([source](django_opengraph_meta/models/properties/media.py#L82))
    - OGActor ([source](django_opengraph_meta/models/properties/actor.py#L19))
    - OGTag ([source](django_opengraph_meta/models/properties/tag.py#L13))
  - #### other
    - [OGBusinessPage](#ogbusinesspage)
    - [OGProductPage](#ogproductpage)
    - #### properties
      - OGContactData ([source](django_opengraph_meta/models/other/properties/contact_data.py#L15))
      - OGPlace ([source](django_opengraph_meta/models/other/properties/place.py#L12))
      - OGPrice ([source](django_opengraph_meta/models/other/properties/price.py#L13))
  - #### social_media
    - TwitterCard  ([source](django_opengraph_meta/models/social_media/twitter_card.py#L14))
    - [TwitterCardApp](#twittercardapp)
    - [TwitterCardSummary](#twittercardsummary)
    - [TwitterCardSummaryLargeImage](#twittercardsummarylargeimage)
    - [TwitterCardPlayer](#twittercardplayer)
    - #### properties
      - TwitterCardAppInfo ([source](django_opengraph_meta/models/social_media/properties/app.py#L12))
      - TwitterCardSite ([source][31])
      - TwitterCardCreator ([source](django_opengraph_meta/models/social_media/properties/profile.py#L42))
      - TwitterCardPlayer ([source](django_opengraph_meta/models/social_media/properties/player.py#L12))

---

## Concepts

### Database app_label
> If `OPENGRAPH_META_APP_LABEL` would be found in [django.conf.settings](https://docs.djangoproject.com/en/5.0/topics/settings/) it will be used as prefix each db model name, exclude TwitterCards models, which use `TWITTER_CARD_META_APP_LABEL`

### Universal page attributes:

##### Class methods:
- `og_name`(`cls`)
  - Returns the OpenGraph scope name, which was set at the class initialization
- `og_properties`(`cls`)
  - Returns the OpenGraph scope properties, which was set at the class initialization

##### Methods:
- `og_metadata`(`self`)
  - Returns the `Generator[Tuple[str, str]]` with collected meta information. Empty fields will not be included to that selection.
- `og_name`(`self`)
  - Return `Generator[str]` (wrapped metadata), which present as `Iterable` HTML DOM based meta tags

### Universal subpage attributes
> Class **OGSubpage** ([source](django_opengraph_meta/models/page.py#L110)) is a parent of each page class, excluding the [OGWebPage](#ogwebpage). It determines [ForeignKey][8] field `page`, which links to [OGWebPage](#ogwebpage) object associated for present data. It proxied two properties of the `page`

- `url`
- `title`

, to the main **OGSubpage** scope

### Universal music attributes
> Arguments `*args` and `**kwargs` will be transfer to selected object instance constructor without any modification.

##### Class methods:

- `create_song`(`cls`, `*args`, `**kwargs`): Returns new [OGMusicSongPage](#ogmusicsongpage) instance
- `create_album`(`cls`, `*args`, `**kwargs`): Returns new [OGMusicAlbumPage](#ogmusicalbumpage) instance
- `create_playlist`(`cls`, `*args`, `**kwargs`): Returns new [OGMusicPlaylistPage](#ogmusicplaylistpage) instance
- `create_radio_station`(`cls`, `*args`, `**kwargs`): Returns new [OGMusicRadioStationPage](#ogmusicradiostationpage) instance

##### Database fields:

- [ForeignKey][8] `audio`: The audio file ([source](django_opengraph_meta/models/properties/media.py#L83)) associated with the page
  - [URLField][5] `url`: Contains video's url. (`og:audio`)
  - [CharField][2] `type`: Contains MIME type of the video. (`og:audio:type`)
  - [URLField][5] `secure_url`: Contains video's alternate url to use if the webpage requires HTTPS. (`og:audio:secure_url`)

### Universal video attributes
> Arguments `*args` and `**kwargs` will be transfer to selected object instance constructor without any modification.

##### Class methods:

- `create_movie`(`cls`, `*args`, `**kwargs`): Returns new [OGVideoMoviePage](#ogmusicsongpage) instance
- `create_episode`(`cls`, `*args`, `**kwargs`): Returns new [OGVideoEpisodePage](#ogmusicalbumpage) instance
- `create_tv_show`(`cls`, `*args`, `**kwargs`): Returns new [OGVideoTVShowPage](#ogmusicplaylistpage) instance
- `create_other`(`cls`, `*args`, `**kwargs`): Returns new [OGVideoOtherPage](#ogmusicradiostationpage) instance

##### Database fields:

- [ForeignKey][8] `video`: The video file ([source](django_opengraph_meta/models/properties/media.py#L76)) associated with the page
  - [URLField][5] `url`: Contains video's url. (`og:video`)
  - [CharField][2] `type`: Contains MIME type of the video. (`og:video:type`)
  - [URLField][5] `secure_url`: Contains video's alternate url to use if the webpage requires HTTPS. (`og:video:secure_url`)
  - [PositiveSmallIntegerField][3] `width`: Contains width of the video. (`og:video:width`)
  - [PositiveSmallIntegerField][3] `height`: Contains height of the video. (`og:video:height`)
- [PositiveSmallIntegerField][3] `duration`: Duration of the video in seconds (`video:duration`)
- [DateField][9] `release_date`: Contains date of video release. Metadata represented as `YYYY-MM-DD` ([ISO 8601][20]) string (`video:release_date`)
- [ManyToManyField][7] `actors`: Array of the actor's [extended profiles](#ogactor), metadata represent as URL of attached profile and `:role` parameter, if it is existed (`video:actor`)
- [ManyToManyField][7] `directors`: Array of the director's [profiles](#ogprofilepage), metadata represent as URL of attached profile (`video:director`)
- [ManyToManyField][7] `writers`: Array of the writer's [profiles](#ogprofilepage), metadata represent as URL of attached profile (`video:writer`)
- [ForeignKey][8] `series`: Contains link to [OGVideoTVShowPage](#ogvideotvshowpage), metadata represent as URL of attached video. It uses only in [OGVideoEpisodePage](#ogvideoepisodepage) (`video:series`)

### Universal TwitterCard attributes

##### Class methods:

- `create_player`(`cls`, `*args`, `**kwargs`): Returns new [TwitterCardPlayer](#twittercardplayer) instance
- `create_summary`(`cls`, `*args`, `**kwargs`): Returns new [TwitterCardSummary](#twittercardsummary) instance
- `create_summary_large_image`(`cls`, `*args`, `**kwargs`): Returns new [TwitterCardSummaryLargeImage](#twittercardsummarylargeimage) instance
- `create_app`(`cls`, `*args`, `**kwargs`): Returns new [TwitterCardApp](#twittercardapp) instance

##### Database fields:
- [PositiveSmallIntegerField][3] `card`: [Value of the card's type](django_opengraph_meta/models/social_media/twitter_card.py#L34), it will be converted to string in the process of metadata generation (`twitter:card`)
- [ForeignKey][8] `site`: **TwitterCardSite** ([source][31]) profile info associated with the page
  - [CharField][2] `username`: @username (`twitter:site`)
  - [CharField][2] `id`: user's Twitter ID (`twitter:site:id`)

### Product classification

> Model [OGProductPage](#ogproductpage) uses predefined values of the [Google's taxonomy classification](https://www.google.com/basepages/producttype/taxonomy-with-ids.en-US.txt). It is a big document (~5.5k lines) with the deep enclosing and inheritance of the categories. So, that module support each element of the taxonomy, but not used all of them by default. Project setting's variable `OPENGRAPH_PRODUCT_TAXONOMY_DEPTH` defines level of the enclosing, which will be presented by root class `Categories` ([source](django_opengraph_meta/models/other/properties/taxonomy.py#L138)) (2 by default). It means, that second enclosing of the category (for example: `OGProductPage.Categories.AnimalsAndPetSupplies.LiveAnimals`) cannot contain any subcategory and would be final. If `OPENGRAPH_PRODUCT_TAXONOMY_DEPTH` is equal `0`, it is means, that there is no any enclosing limits.
> 
> **Note**: List of the categories, which are contained into the current `Taxonomy` instance ([source](django_opengraph_meta/models/other/properties/taxonomy.py#L67)) can be got by the method of that instance `categories(self)`
>
> You can use the setting's variable `OPENGRAPH_PRODUCT_TAXONOMY_BASE` for the defining the root category of your current project. For example, if your project is used for the cloth sale, it can be sensible to set the `OPENGRAPH_PRODUCT_TAXONOMY_BASE = 'ApparelAndAccessories.Clothing'`. It excludes the non-contextual values from the choices of [OGProductPage.category](#ogproductpage). 
> 
> Setting's variable `OPENGRAPH_PRODUCT_TAXONOMY_FILEPATH` can be used for the linking of custom taxonomy file, instead of builtin [taxonomy.json](django_opengraph_meta/data/taxonomy.json), for the categories tree build
> 
> Boolean setting's variable `OPENGRAPH_PRODUCT_TAXONOMY_FULLNAME` (`False` by default) determines the name of category entity, which would be present at the `choices` property. `fullname` reflects the tree, in contrast of the `name`
> 

### Currency code
> Model `OGPrice` ([source](django_opengraph_meta/models/other/properties/price.py#L13)) uses a part of logic the [Product classification](#product-classification) in the currency defines. It has support two variables: `OPENGRAPH_PRODUCT_CURRENCY_FULLNAME` and `OPENGRAPH_PRODUCT_CURRENCY_FILEPATH` with same logic. So if you want to limit list of currencies in your project, creation project-specific `currency.json` is a simple way to do it
> 
> See:
> - [currencies.json](django_opengraph_meta/data/currencies.json)
> - [currencies.py](django_opengraph_meta/models/other/properties/currencies.py#L45)
>


### See also:
- [OpenGraph basic metadata](https://ogp.me/#metadata)
- [OpenGraph optional metadata](https://ogp.me/#optional)
- [OpenGraph arrays](https://ogp.me/#array)
- [OpenGraph business reference](https://developers.facebook.com/blog/post/2013/06/05/platform-updates--new-open-graph-business-object-type/)
- [OpenGraph Facebook specific product](https://developers.facebook.com/docs/marketing-api/catalog/reference#required-fields)
- [TwitterCard description](https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/markup)

---

## Basic models

### OGWebPage
- [OpenGraph documentation](https://ogp.me/#metadata)
- [Source file](django_opengraph_meta/models/page.py#L16)
- [Universal page attributes](#universal-page-attributes)
- [Universal subpage attributes](#universal-subpage-attributes)

##### Database fields:
- [URLField][5] `url`: Contains page's url. (`og:url`)
- [PositiveSmallIntegerField][3] `type`: Contains page's opengraph type ([see](django_opengraph_meta/models/page.py#L38)) (`og:type`)
- [CharField][2] `title`: Contains page's title (`og:type`)
- [CharField][2] `description`: Contains page's description (`og:description`)
- [ManyToManyField][7] `images`: Array of the images ([source](django_opengraph_meta/models/properties/media.py#L69)) associated with the page (`og:image`)
  - [URLField][5] `url`: Contains image's url. (`og:image`)
  - [CharField][2] `type`: Contains MIME type of the image. (`og:image:type`)
  - [URLField][5] `secure_url`: Contains image's alternate url to use if the webpage requires HTTPS. (`og:image:secure_url`)
  - [PositiveSmallIntegerField][3] `width`: Contains width of the image. (`og:image:width`)
  - [PositiveSmallIntegerField][3] `height`: Contains height of the image. (`og:image:height`)
  - [CharField][2] `alt`: Contains description of what is in the image. (`og:image:alt`)

##### Properties
- `locale`: Returns result of [to_locale(get_language())](https://docs.djangoproject.com/en/5.0/topics/i18n/translation/) (`og:locale`)
- `locales_alt`: Returns nothing, but set the interface to returning `Iterable` object. User may redefine this property on inheritance (`og:locale:alternate`)
- `determiner`: Returns nothing, but set the interface to returning `str`. (`og:determiner`)
- `site_name`: Returns value of `OPENGRAPH_SITE_NAME` (`None` if not present) which can be set in main project settings file

---

### OGArticlePage
- [OpenGraph documentation](https://ogp.me/#type_article)
- [Source file](django_opengraph_meta/models/article.py#L14)
- [Universal page attributes](#universal-page-attributes)
- [Universal subpage attributes](#universal-subpage-attributes)

##### Database fields:
- [CharField][2] `section`: Contains the global category value of the article (`article:section`)
- [DateTimeField][10] `published_time`: Contains date and time of article's publication. Metadata represented as `YYYY-MM-DDThh:mm` ([ISO 8601][20]) string (`article:published_time`)
- [DateTimeField][10] `modified_time`: Contains date and time of last article's modification. Metadata represented as `YYYY-MM-DDThh:mm` ([ISO 8601][20]) string (`article:modified_time`)
- [DateTimeField][10] `expiration_time`: Contains date and time of article's expiration. Metadata represented as `YYYY-MM-DDThh:mm` ([ISO 8601][20]) string (`article:expiration_time`)
- [ManyToManyField][7] `authors`: Contains an array of the author's [profiles](#ogprofilepage)
  - [URLField][5] `url`: Contains author's page url. (`article:author`)
- [ManyToManyField][7] `tags`: Contains an array of the tags associated with this object (`article:tag`)

---

### OGBookPage
- [OpenGraph documentation](https://ogp.me/#type_book)
- [Source file](django_opengraph_meta/models/book.py#L14)
- [Universal page attributes](#universal-page-attributes)
- [Universal subpage attributes](#universal-subpage-attributes)

##### Database fields:
- [CharField][2] `isbn`: Contains 13-Digit [ISBN][22] (`book:isbn`)
- [DateField][9] `release_date`: Contains date of book release. Metadata represented as `YYYY-MM-DD` ([ISO 8601][20]) string (`book:release_date`)
- [ManyToManyField][7] `authors`: Array of the author's [profiles](#ogprofilepage)
  - [URLField][5] `url`: Contains author's page url. (`book:author`)
- [ManyToManyField][7] `tags`: Array of the tags associated with this object (`book:tag`)

---

### OGProfilePage
- [OpenGraph documentation](https://ogp.me/#type_profile)
- [Source file](django_opengraph_meta/models/profile.py#L13)
- [Universal page attributes](#universal-page-attributes)
- [Universal subpage attributes](#universal-subpage-attributes)

##### Database fields:
- [BooleanField][1] `is_male`: Is used for handling by `gender` property
- [CharField][2] `first_name`: First name of described person (`profile:first_name`)
- [CharField][2] `last_name`: Last name of described person (`profile:last_name`)
- [CharField][2] `username`: Username of described person (`profile:username`)

##### Properties
- `gender`: Returns `None` if field `is_male` is null. Returns `'male'` if `is_male` is true, `'female'` in else (`profile:gender`)

---

### OGMusicSongPage
- [OpenGraph documentation](https://ogp.me/#type_music.song)
- [Source file](django_opengraph_meta/models/music.py#L87)
- [Universal page attributes](#universal-page-attributes)
- [Universal subpage attributes](#universal-subpage-attributes)
- [Universal music attributes](#universal-music-attributes)

##### Database fields:
- [PositiveSmallIntegerField][3] `disc`: Album disc number (`music:album:disc`)
- [PositiveSmallIntegerField][3] `track`: Track number at the album (`music:album:track`)
- [ForeignKey][8] `album`: Contains link to the [OGMusicAlbumPage](#ogmusicalbumpage)
  - [URLField][5] `url`: Contains album's page url. (`music:album`)
- [ManyToManyField][7] `musicians`: Array of the musician's [profiles](#ogprofilepage)
  - [URLField][5] `url`: Contains musician's page url. (`music:musician`)
- [PositiveSmallIntegerField][3] `duration`: Duration of the song in seconds (`music:duration`)

---

### OGMusicAlbumPage
- [OpenGraph documentation](https://ogp.me/#type_music.album)
- [Source file](django_opengraph_meta/models/music.py#L127)
- [Universal page attributes](#universal-page-attributes)
- [Universal subpage attributes](#universal-subpage-attributes)
- [Universal music attributes](#universal-music-attributes)

##### Database fields:
- [DateField][9] `release_date`: Contains date of object release Metadata represented as `YYYY-MM-DD` ([ISO 8601][20]) string (`music:release_date`)
- [ManyToManyField][7] `creators`: Array of the musician's [profiles](#ogprofilepage), metadata represent as URL of attached profile (`music:musician`)
  - [URLField][5] `url`: Contains musician's page url. (`music:musician`)
- [ManyToManyField][7] `songs`: Array of the [songs](#ogmusicsongpage)
  - [URLField][5] `url`: Contains page url of the song. (`music:song`)
  - [PositiveSmallIntegerField][3] `disc`: Contains disc number of the song's album. (`music:song:disc`)
  - [PositiveSmallIntegerField][3] `track`: Contains track number of the song in album. (`music:song:track`)

---

### OGMusicPlaylistPage
- [OpenGraph documentation](https://ogp.me#type_music.playlist)
- [Source file](django_opengraph_meta/models/music.py#L144)
- [Universal page attributes](#universal-page-attributes)
- [Universal subpage attributes](#universal-subpage-attributes)
- [Universal music attributes](#universal-music-attributes)

##### Database fields:
- [ManyToManyField][7] `creators`: Array of the creator's [profiles](#ogprofilepage)
  - [URLField][5] `url`: Contains creator's page url. (`music:creator`)
- [ManyToManyField][7] `songs`: Array of the [songs](#ogmusicsongpage)
  - [URLField][5] `url`: Contains page url of the song. (`music:song`)
  - [PositiveSmallIntegerField][3] `disc`: Contains disc number of the song's album. (`music:song:disc`)
  - [PositiveSmallIntegerField][3] `track`: Contains track number of the song in album. (`music:song:track`)

---

### OGMusicRadioStationPage
- [OpenGraph documentation](https://ogp.me/#type_music.radio_station)
- [Source file](django_opengraph_meta/models/music.py#L155)
- [Universal page attributes](#universal-page-attributes)
- [Universal subpage attributes](#universal-subpage-attributes)
- [Universal music attributes](#universal-music-attributes)

##### Database fields:
- [ManyToManyField][7] `creators`: Array of the creator's [profiles](#ogprofilepage)
  - [URLField][5] `url`: Contains creator's page url. (`music:creator`)

---

### OGVideoMoviePage
- [OpenGraph documentation](https://ogp.me/#type_video.movie)
- [Source file](django_opengraph_meta/models/video.py#84)
- [Universal page attributes](#universal-page-attributes)
- [Universal subpage attributes](#universal-subpage-attributes)
- [Universal video attributes](#universal-video-attributes)

---

### OGVideoEpisodePage
- [OpenGraph documentation](https://ogp.me/#type_video.episode)
- [Source file](django_opengraph_meta/models/video.py#L116)
- [Universal page attributes](#universal-page-attributes)
- [Universal subpage attributes](#universal-subpage-attributes)
- [Universal video attributes](#universal-video-attributes)

---

### OGVideoTVShowPage
- [OpenGraph documentation](https://ogp.me/#type_video.tv_show)
- [Source file](django_opengraph_meta/models/video.py#95)
- [Universal page attributes](#universal-page-attributes)
- [Universal subpage attributes](#universal-subpage-attributes)
- [Universal video attributes](#universal-video-attributes)

---

### OGVideoOtherPage
- [OpenGraph documentation](https://ogp.me/#type_video.other)
- [Source file](django_opengraph_meta/models/video.py#106)
- [Universal page attributes](#universal-page-attributes)
- [Universal subpage attributes](#universal-subpage-attributes)
- [Universal video attributes](#universal-video-attributes)

---

## Extra models

### OGBusinessPage
- [Source file](django_opengraph_meta/models/other/business.py#L14)
- [Universal page attributes](#universal-page-attributes)
- [Universal subpage attributes](#universal-subpage-attributes)

##### Database fields:
- [ForeignKey][8] `contact_data`: Contains link to the OGContactData property ([source](django_opengraph_meta/models/other/properties/contact_data.py#L15)), which can contain:
  - [CharField][2] `street_addres`: Contains physical address of the object (`business:contact_data:stree_addres`)
  - [CharField][2] `locality`: Contains locality of the object (`business:contact_data:locality`)
  - [CharField][2] `region`: Contains region of the object (`business:contact_data:region`)
  - [CharField][2] `postal_code`: Contains postal_code of the object (`business:contact_data:postal_code`)
  - [CharField][2] `country_name`: Contains county name of the object (`business:contact_data:country_name`)
  - [EmailField][6] `email`: Contains email of the object (`business:contact_data:email`)
  - [CharField][2] `phone_number`: Contains phone number of the object (`business:contact_data:phone_number`)
  - [CharField][2] `fax_number`: Contains fax number of the object (`business:contact_data:fax_number`)
  - [URLField][5] `website`: Contains url to website of the object (`business:contact_data:website`)
- [ForeignKey][8] `place`: Contains link to the OGContactData property ([source](django_opengraph_meta/models/other/properties/place.py#L12)), which can contain:
  - [DecimalField][4] `latitude`: Geographic [latitude][23] (`business:place:latitude`)
  - [DecimalField][4] `longitude`: Geographic [longitude][24] (`business:place:longitude`)

---

### OGProductPage
- [Source file](django_opengraph_meta/models/other/product.py#L22)
- [Universal page attributes](#universal-page-attributes)
- [Universal subpage attributes](#universal-subpage-attributes)

##### Database fields:
- [ForeignKey][8] `price`: Contains link to the OGGlobalPrice property ([source](django_opengraph_meta/models/other/product.py#L14)), which can contain:
  - [DecimalField][4] `amount`: Price of the product (`og:price:amount`)
  - [PositiveSmallIntegerField][2] `currency`: Contains [code of the currency](#currency-code) (`og:price:currency`)
- [PositiveSmallIntegerField][3] `availability`: [Value of the product's availability](django_opengraph_meta/models/other/product.py#L74). (`product:availability`)
- [PositiveSmallIntegerField][3] `condition`: [Value of the product's condition](django_opengraph_meta/models/other/product.py#L69). (`product:condition`)
- [PositiveSmallIntegerField][3] `material`: [Value of the product's material](django_opengraph_meta/models/other/product.py#L64). (`material`)
- [CharField][2] `brand`: Brand name of the product (`product:brand`)
- [PositiveIntegerField][11] `category`: [Category id](#product-classification) from the Google's [taxonomy classification](https://www.google.com/basepages/producttype/taxonomy-with-ids.en-US.txt) (`product:category`)
- [CharField][2] `gtin`: [GTIN][21] of the product (`product:gtin`)
- [BooleanField][1] `is_male`: Is used for handling by `gender` property

##### Properties
- `gender`: Returns `unisex` if field `is_male` is null. Returns `'male'` if `is_male` is true, `'female'` in else (`product:gender`)

---

## TwitterCard models

### TwitterCardApp
- [Source file](django_opengraph_meta/models/social_media/twitter_card.py#L132)
- [Universal page attributes](#universal-page-attributes)
- [Universal subpage attributes](#universal-subpage-attributes)
- [Universal TwitterCard attributes](#universal-twittercard-attributes)

##### Database fields:
- [ManyToManyField][7] `apps`: Array of **TwitterCardAppInfo** ([source](django_opengraph_meta/models/social_media/properties/app.py#L12)). User responsible that any of the `app.type` would be contained once in that field
  - [PositiveSmallIntegerField][3] `type`: [Value of the app's device](django_opengraph_meta/models/social_media/properties/app.py#L26), it would be used for `[postfix]` of that metamodel
  - [CharField][2] `type`: Application name (`twitter:app:name:[postfix]`)
  - [CharField][2] `id`: Application marketplace id (`twitter:app:id:[postfix]`)
  - [CharField][5] `url`: Application marketplace id (`twitter:app:url:[postfix]`)

---

### TwitterCardSummary
- [Source file](django_opengraph_meta/models/social_media/twitter_card.py#L107)
- [Universal page attributes](#universal-page-attributes)
- [Universal subpage attributes](#universal-subpage-attributes)
- [Universal TwitterCard attributes](#universal-twittercard-attributes)

##### Database fields:
- [ForeignKey][8] `image`: **TwitterCardImage** ([source][30]) image associated with the page
  - [URLField][5] `url`: Contains image's url. (`twitter:image`)
  - [CharField][2] `alt`: Contains description of what is in the image. (`twitter:image:alt`)
- [ForeignKey][8] `creator`: **TwitterCardCreator** ([source][32]) profile info associated with the page
  - [CharField][2] `username`: @username of the creator (`twitter:site`)
  - [CharField][2] `id`: creator's Twitter ID (`twitter:site:id`)

---

### TwitterCardSummaryLargeImage
- [Source file](django_opengraph_meta/models/social_media/twitter_card.py#L121)
- [Universal page attributes](#universal-page-attributes)
- [Universal subpage attributes](#universal-subpage-attributes)
- [Universal TwitterCard attributes](#universal-twittercard-attributes)

##### Database fields:
- [ForeignKey][8] `image`: **TwitterCardImage** ([source][30]) image associated with the page
  - [URLField][5] `url`: Contains image's url. (`twitter:image`)
  - [CharField][2] `alt`: Contains description of what is in the image. (`twitter:image:alt`)
- [ForeignKey][8] `creator`: **TwitterCardCreator** ([source][32]) profile info associated with the page
  - [CharField][2] `username`: @username of the creator (`twitter:site`)
  - [CharField][2] `id`: creator's Twitter ID (`twitter:site:id`)

---

### TwitterCardPlayer
- [Source file](django_opengraph_meta/models/social_media/twitter_card.py#L94)
- [Universal page attributes](#universal-page-attributes)
- [Universal subpage attributes](#universal-subpage-attributes)
- [Universal TwitterCard attributes](#universal-twittercard-attributes)

##### Database fields:
- [ForeignKey][8] `image`: **TwitterCardImage** ([source][30]) image associated with the page
  - [URLField][5] `url`: Contains image's url. (`twitter:image`)
  - [CharField][2] `alt`: Contains description of what is in the image. (`twitter:image:alt`)
- [ForeignKey][8] `player`: **TwitterCardPlayer** ([source][32]) iframe associated with the page
  - [URLField][5] `url`: Contains iframe url. (`twitter:player`)
  - [URLField][5] `stream`: Contains raw video url. (`twitter:player:stream`)
  - [PositiveSmallIntegerField][3] `width`: Width of the video iframe. (`twitter:player:width`)
  - [PositiveSmallIntegerField][3] `height`: Height of the video iframe. (`twitter:player:height`)

[1]: <https://docs.djangoproject.com/en/5.0/ref/models/fields#booleanfield> "django.db.models.BooleanField"
[2]: <https://docs.djangoproject.com/en/5.0/ref/models/fields#charfield> "django.db.models.CharField"
[3]: <https://docs.djangoproject.com/en/5.0/ref/models/fields#positivesmallintegerfield> "django.db.models.PositiveSmallIntegerField"
[4]: <https://docs.djangoproject.com/en/5.0/ref/models/fields#decimalfield> "django.db.models.DecimalField"
[5]: <https://docs.djangoproject.com/en/5.0/ref/models/fields#urlfield> "django.db.models.URLField"
[6]: <https://docs.djangoproject.com/en/5.0/ref/models/fields#emailfield> "django.db.models.EmailField"
[7]: <https://docs.djangoproject.com/en/5.0/ref/models/fields#manytomanyfield> "django.db.models.ManyToManyField"
[8]: <https://docs.djangoproject.com/en/5.0/ref/models/fields#foreignkey> "django.db.models.ForeignKey"
[9]: <https://docs.djangoproject.com/en/5.0/ref/models/fields#datefield> "django.db.models.DateField"
[10]: <https://docs.djangoproject.com/en/5.0/ref/models/fields#datetimefield> "django.db.models.DateTimeField"
[11]: <https://docs.djangoproject.com/en/5.0/ref/models/fields#positiveintegerfield> "django.db.models.PositiveIntegerField"
[20]: <https://en.wikipedia.org/wiki/ISO_8601> "ISO 8601"
[21]: <https://en.wikipedia.org/wiki/Global_Trade_Item_Number> "GTIN"
[22]: <https://en.wikipedia.org/wiki/ISBN> "ISBN"
[23]: <https://en.wikipedia.org/wiki/Latitude> "Latitude"
[24]: <https://en.wikipedia.org/wiki/Longitude> "Longitude"
[30]: <django_opengraph_meta/models/social_media/twitter_card.py#L79> "TwitterCardImage"
[31]: <django_opengraph_meta/models/social_media/properties/profile.py#L12> "TwitterCardSite"
[32]: <django_opengraph_meta/models/social_media/properties/profile.py#L42> "TwitterCardCreator"
