complete first version of main proccess
This commit is contained in:
		
							parent
							
								
									6ff4740d04
								
							
						
					
					
						commit
						f2fc2362a7
					
				
					 61 changed files with 3280 additions and 28 deletions
				
			
		| 
						 | 
				
			
			@ -3,14 +3,15 @@ from django.db import models
 | 
			
		|||
from django.utils.html import format_html
 | 
			
		||||
from django.core.validators import RegexValidator
 | 
			
		||||
from simple_history.models import HistoricalRecords
 | 
			
		||||
from common.models import TagModel, BaseModel
 | 
			
		||||
from common.consts import UserRoles
 | 
			
		||||
from common.models import TagModel, BaseModel, NameSlugModel
 | 
			
		||||
from common.consts import UserRoles, BANK_CHOICES
 | 
			
		||||
from locations.models import Affairs, Broker, County
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Create your models here.
 | 
			
		||||
 | 
			
		||||
class Role(TagModel):
 | 
			
		||||
 | 
			
		||||
    class Meta:
 | 
			
		||||
        verbose_name = "نقش"
 | 
			
		||||
        verbose_name_plural = "نقشها"
 | 
			
		||||
| 
						 | 
				
			
			@ -68,6 +69,13 @@ class Profile(BaseModel):
 | 
			
		|||
            )
 | 
			
		||||
        ]
 | 
			
		||||
    )
 | 
			
		||||
    bank_name = models.CharField(
 | 
			
		||||
        max_length=255,
 | 
			
		||||
        choices=BANK_CHOICES,
 | 
			
		||||
        null=True,
 | 
			
		||||
        verbose_name="نام بانک",
 | 
			
		||||
        blank=True
 | 
			
		||||
    )
 | 
			
		||||
    phone_number_1 = models.CharField(
 | 
			
		||||
        max_length=11,
 | 
			
		||||
        null=True,
 | 
			
		||||
| 
						 | 
				
			
			@ -170,3 +178,17 @@ class Profile(BaseModel):
 | 
			
		|||
        return format_html(f"<img style='width:30px;' src='{self.pic.url}'>")
 | 
			
		||||
 | 
			
		||||
    pic_tag.short_description = "تصویر"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class Company(NameSlugModel):
 | 
			
		||||
    logo = models.ImageField(upload_to='companies/logos', null=True, blank=True, verbose_name='لوگوی شرکت')
 | 
			
		||||
    signature = models.ImageField(upload_to='companies/signatures', null=True, blank=True, verbose_name='امضای شرکت')
 | 
			
		||||
    address = models.TextField(null=True, blank=True, verbose_name='آدرس')
 | 
			
		||||
    phone = models.CharField(max_length=11, null=True, blank=True, verbose_name='شماره تماس')
 | 
			
		||||
   
 | 
			
		||||
    class Meta:
 | 
			
		||||
        verbose_name = 'شرکت'
 | 
			
		||||
        verbose_name_plural = 'شرکتها'
 | 
			
		||||
 | 
			
		||||
    def __str__(self):
 | 
			
		||||
        return self.name
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue