rules and planning finalize for docs to be standrd always
This commit is contained in:
@@ -1,6 +1,63 @@
|
||||
# Database Models Reference
|
||||
|
||||
**Last Verified:** December 25, 2025
|
||||
**Last Verified:** December 27, 2025
|
||||
|
||||
---
|
||||
|
||||
## Data Scoping Overview
|
||||
|
||||
| Scope | Models | Base Class | Filter By |
|
||||
|-------|--------|------------|-----------|
|
||||
| **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` |
|
||||
|
||||
---
|
||||
|
||||
## Global Models (`igny8_core/modules/system/global_settings_models.py`)
|
||||
|
||||
**Purpose:** Platform-wide defaults and API keys. Admin-only. NOT account-scoped.
|
||||
|
||||
### GlobalIntegrationSettings (Singleton)
|
||||
|
||||
```python
|
||||
class GlobalIntegrationSettings(models.Model):
|
||||
# OpenAI (used by ALL accounts)
|
||||
openai_api_key = CharField(max_length=500)
|
||||
openai_model = CharField(default='gpt-4o-mini')
|
||||
openai_temperature = FloatField(default=0.7)
|
||||
openai_max_tokens = IntegerField(default=8192)
|
||||
|
||||
# DALL-E / Image Generation
|
||||
dalle_api_key = CharField(max_length=500)
|
||||
dalle_model = CharField(default='dall-e-3')
|
||||
dalle_size = CharField(default='1024x1024')
|
||||
|
||||
# Runware
|
||||
runware_api_key = CharField(max_length=500)
|
||||
```
|
||||
|
||||
**Critical:** Singleton (pk=1). API keys here are used by ALL accounts.
|
||||
|
||||
### GlobalAIPrompt
|
||||
|
||||
```python
|
||||
class GlobalAIPrompt(models.Model):
|
||||
prompt_type = CharField(max_length=100) # clustering, ideas, content_generation
|
||||
prompt_value = TextField()
|
||||
variables = JSONField(default=list)
|
||||
is_active = BooleanField(default=True)
|
||||
```
|
||||
|
||||
### GlobalAuthorProfile
|
||||
|
||||
```python
|
||||
class GlobalAuthorProfile(models.Model):
|
||||
name = CharField(max_length=255)
|
||||
tone = CharField(max_length=50) # professional, casual, technical
|
||||
language = CharField(max_length=10, default='en')
|
||||
is_active = BooleanField(default=True)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user