VErsion 1.3.2
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# Database Models Reference
|
||||
|
||||
**Last Verified:** December 27, 2025
|
||||
**Last Verified:** January 3, 2026
|
||||
|
||||
---
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
|-------|--------|------------|-----------|
|
||||
| **Global** | `GlobalIntegrationSettings`, `GlobalAIPrompt`, `GlobalAuthorProfile`, `GlobalStrategy`, `GlobalModuleSettings`, `Industry`, `SeedKeyword` | `models.Model` | None (platform-wide) |
|
||||
| **Account** | `Account`, `User`, `Plan`, `IntegrationSettings`, `ModuleEnableSettings`, `AISettings`, `AIPrompt`, `AuthorProfile`, `CreditBalance` | `AccountBaseModel` | `account` |
|
||||
| **Site+Sector** | `Keywords`, `Clusters`, `ContentIdeas`, `Tasks`, `Content`, `Images`, `AutomationConfig` | `SiteSectorBaseModel` | `site`, `sector` |
|
||||
| **Site** | `Site`, `PublishingSettings`, `AutomationConfig`, `SiteIntegration` | `AccountBaseModel` | `account`, `site` |
|
||||
| **Site+Sector** | `Keywords`, `Clusters`, `ContentIdeas`, `Tasks`, `Content`, `Images` | `SiteSectorBaseModel` | `site`, `sector` |
|
||||
|
||||
---
|
||||
|
||||
@@ -270,8 +271,18 @@ class Content(models.Model):
|
||||
meta_title = CharField(max_length=255, blank=True)
|
||||
meta_description = TextField(blank=True)
|
||||
|
||||
# Workflow status
|
||||
status = CharField(choices=CONTENT_STATUS) # draft, review, approved, published
|
||||
|
||||
# Publishing status (v1.3.2)
|
||||
site_status = CharField(choices=SITE_STATUS) # not_published, scheduled, publishing, published, failed
|
||||
scheduled_publish_at = DateTimeField(null=True)
|
||||
site_status_updated_at = DateTimeField(null=True)
|
||||
|
||||
# External site reference
|
||||
external_id = CharField(max_length=255, blank=True) # WordPress post ID
|
||||
external_url = URLField(blank=True) # Published URL
|
||||
|
||||
word_count = IntegerField(default=0)
|
||||
|
||||
created_by = ForeignKey(User)
|
||||
@@ -279,12 +290,19 @@ class Content(models.Model):
|
||||
updated_at = DateTimeField(auto_now=True)
|
||||
```
|
||||
|
||||
**Status Values:**
|
||||
**Workflow Status Values (status):**
|
||||
- `draft` - Initial state after generation
|
||||
- `review` - Pending human review
|
||||
- `approved` - Ready for publishing
|
||||
- `approved` - Ready for publishing (v1.3.2: NEW status)
|
||||
- `published` - Published to WordPress
|
||||
|
||||
**Publishing Status Values (site_status) - v1.3.2:**
|
||||
- `not_published` - Not yet scheduled for external site
|
||||
- `scheduled` - Scheduled for future publishing
|
||||
- `publishing` - Currently being published
|
||||
- `published` - Successfully published to external site
|
||||
- `failed` - Publishing failed
|
||||
|
||||
---
|
||||
|
||||
### ContentImage
|
||||
@@ -311,7 +329,7 @@ class ContentImage(models.Model):
|
||||
|
||||
---
|
||||
|
||||
## Integration Models (`igny8_core/modules/integration/models.py`)
|
||||
## Integration Models (`igny8_core/business/integration/models.py`)
|
||||
|
||||
### SiteIntegration
|
||||
|
||||
@@ -321,7 +339,7 @@ class SiteIntegration(models.Model):
|
||||
name = CharField(max_length=255)
|
||||
|
||||
site = ForeignKey(Site, related_name='integrations')
|
||||
integration_type = CharField(max_length=50) # wordpress
|
||||
platform = CharField(max_length=50) # wordpress
|
||||
|
||||
# Credentials (encrypted)
|
||||
url = URLField()
|
||||
@@ -344,7 +362,51 @@ class SiteIntegration(models.Model):
|
||||
|
||||
---
|
||||
|
||||
## Billing Models (`igny8_core/modules/billing/models.py`)
|
||||
### PublishingSettings (NEW v1.3.2)
|
||||
|
||||
```python
|
||||
class PublishingSettings(AccountBaseModel):
|
||||
"""Site-level publishing configuration. Controls auto-approval, publishing limits, and scheduling."""
|
||||
|
||||
site = OneToOneField(Site, related_name='publishing_settings')
|
||||
|
||||
# Auto-approval settings
|
||||
auto_approval_enabled = BooleanField(default=True)
|
||||
|
||||
# Auto-publish settings
|
||||
auto_publish_enabled = BooleanField(default=True)
|
||||
|
||||
# Publishing limits
|
||||
daily_publish_limit = PositiveIntegerField(default=3)
|
||||
weekly_publish_limit = PositiveIntegerField(default=15)
|
||||
monthly_publish_limit = PositiveIntegerField(default=50)
|
||||
|
||||
# Publishing schedule
|
||||
publish_days = JSONField(default=['mon', 'tue', 'wed', 'thu', 'fri'])
|
||||
publish_time_slots = JSONField(default=['09:00', '14:00', '18:00'])
|
||||
|
||||
created_at = DateTimeField(auto_now_add=True)
|
||||
updated_at = DateTimeField(auto_now=True)
|
||||
```
|
||||
|
||||
**Default Values:**
|
||||
- `auto_approval_enabled`: True (auto-approve after review)
|
||||
- `auto_publish_enabled`: True (auto-publish approved content)
|
||||
- `daily_publish_limit`: 3 articles per day
|
||||
- `weekly_publish_limit`: 15 articles per week
|
||||
- `monthly_publish_limit`: 50 articles per month
|
||||
- `publish_days`: Monday through Friday
|
||||
- `publish_time_slots`: 9:00 AM, 2:00 PM, 6:00 PM
|
||||
|
||||
**Usage:**
|
||||
```python
|
||||
# Get or create with defaults
|
||||
settings, created = PublishingSettings.get_or_create_for_site(site)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Billing Models (`igny8_core/business/billing/models.py`)
|
||||
|
||||
### Plan
|
||||
|
||||
|
||||
Reference in New Issue
Block a user