rules and planning finalize for docs to be standrd always

This commit is contained in:
IGNY8 VPS (Salman)
2025-12-27 00:55:50 +00:00
parent 7a9fa8fd8f
commit 7af4190e6d
5 changed files with 228 additions and 247 deletions

View File

@@ -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)
```
---