diff --git a/.idea/misc.xml b/.idea/misc.xml
index 6ba69809..a8cdf8dc 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -1,4 +1,4 @@
-
+
\ No newline at end of file
diff --git a/.idea/unicoding.iml b/.idea/unicoding.iml
index 3e4215da..87d97568 100644
--- a/.idea/unicoding.iml
+++ b/.idea/unicoding.iml
@@ -13,8 +13,10 @@
-
-
+
+
+
+
diff --git a/accounting/api/account.py b/accounting/api/account.py
index e843e616..46598b03 100644
--- a/accounting/api/account.py
+++ b/accounting/api/account.py
@@ -7,16 +7,15 @@
from django.db.models import Sum, Avg
from rest_framework import status
+from accounting.utilities import Balance
from restauth.authorization import AuthBearer
account_router = Router(tags=['account'])
-
@account_router.get("/get_all", response=List[AccountOut])
def get_all(request):
return status.HTTP_200_OK, Account.objects.order_by('full_code')
-
@account_router.get('/get_one/{account_id}/', response={
200: AccountOut,
404: FourOFourOut,
@@ -51,37 +50,7 @@ def get_account_balances(request):
result = []
for a in accounts:
result.append({
- 'account': a.name, 'balance': list(a.balance())
+ 'account': a.name, 'balance': list(a.total_balance())
})
return status.HTTP_200_OK, result
-
-
-
-
-class Balance:
- def __init__(self, balances):
- balance1 = balances[0]
- balance2 = balances[1]
-
- if balance1['currency'] == 'USD':
- balanceUSD = balance1['sum']
- balanceIQD = balance2['sum']
- else:
- balanceIQD = balance1['sum']
- balanceUSD = balance2['sum']
-
- self.balanceUSD = balanceUSD
- self.balanceIQD = balanceIQD
-
- def __add__(self, other):
- self.balanceIQD += other.balanceIQD
- self.balanceUSD += other.balanceUSD
- return [{
- 'currency': 'USD',
- 'sum': self.balanceUSD
- }, {
- 'currency': 'IQD',
- 'sum': self.balanceIQD
- }]
-
diff --git a/accounting/models.py b/accounting/models.py
index a7d49b7f..6f93070d 100644
--- a/accounting/models.py
+++ b/accounting/models.py
@@ -2,6 +2,8 @@
from django.db.models import Sum
from django.dispatch import receiver
from django.db.models.signals import post_save
+
+from accounting.utilities import Balance
from accounting.exceptions import AccountingEquationError
'''
@@ -49,7 +51,7 @@ class CurrencyChoices(models.TextChoices):
class Account(models.Model):
- parent = models.ForeignKey('self', null=True, blank=True, on_delete=models.SET_NULL)
+ parent = models.ForeignKey('self', null=True, blank=True, on_delete=models.SET_NULL, related_name='children')
type = models.CharField(max_length=255, choices=AccountTypeChoices.choices)
name = models.CharField(max_length=255)
code = models.CharField(max_length=20, null=True, blank=True)
@@ -62,6 +64,16 @@ def __str__(self):
def balance(self):
return self.journal_entries.values('currency').annotate(sum=Sum('amount')).order_by()
+ def total_balance(self):
+ children = self.children.all()
+ if len(children) <= 1: return self.balance()
+
+ total = []
+ for child in list(children):
+ total.append(Balance(child.balance()))
+
+ return sum(total)
+
# def save(
# self, force_insert=False, force_update=False, using=None, update_fields=None
# ):
diff --git a/accounting/utilities.py b/accounting/utilities.py
new file mode 100644
index 00000000..12402178
--- /dev/null
+++ b/accounting/utilities.py
@@ -0,0 +1,39 @@
+from functools import total_ordering
+
+@total_ordering
+class Balance:
+ def __init__(self, balances):
+ balanceUSD, balanceIQD = 0, 0
+
+ for bal in balances:
+ if bal['currency'] == 'USD':
+ balanceUSD = bal['sum']
+ else:
+ balanceIQD = bal['sum']
+
+ self.balanceUSD, self.balanceIQD = balanceUSD, balanceIQD
+
+ def __eq_zero__(self):
+ return self.balanceUSD == 0 and self.balanceIQD == 0
+
+ def __gt__(self, other):
+ return (((self.balanceUSD, self.balanceIQD) > (other.balanceUSD, other.balanceIQD)),
+ ((self.balanceIQD, self.balanceUSD) > (other.balanceIQD, other.balanceUSD)))
+
+ def __lt__(self, other):
+ return (((self.balanceUSD, self.balanceIQD) < (other.balanceUSD, other.balanceIQD)),
+ ((self.balanceIQD, self.balanceUSD) < (other.balanceIQD, other.balanceUSD)))
+
+ def __add__(self, other):
+ self.balanceIQD += other.balanceIQD
+ self.balanceUSD += other.balanceUSD
+ return [{
+ 'currency': 'USD',
+ 'sum': self.balanceUSD
+ }, {
+ 'currency': 'IQD',
+ 'sum': self.balanceIQD
+ }]
+
+ def __radd__(self, other):
+ return self if other == 0 else self.__add__(other)
diff --git a/db.sqlite3 b/db.sqlite3
index 3cb73d59..c7248eff 100644
Binary files a/db.sqlite3 and b/db.sqlite3 differ
diff --git a/unicoding_venv/bin/Activate.ps1 b/unicoding_venv/bin/Activate.ps1
index 7bc3e7c6..b49d77ba 100644
--- a/unicoding_venv/bin/Activate.ps1
+++ b/unicoding_venv/bin/Activate.ps1
@@ -1,241 +1,247 @@
-<#
-.Synopsis
-Activate a Python virtual environment for the current PowerShell session.
-
-.Description
-Pushes the python executable for a virtual environment to the front of the
-$Env:PATH environment variable and sets the prompt to signify that you are
-in a Python virtual environment. Makes use of the command line switches as
-well as the `pyvenv.cfg` file values present in the virtual environment.
-
-.Parameter VenvDir
-Path to the directory that contains the virtual environment to activate. The
-default value for this is the parent of the directory that the Activate.ps1
-script is located within.
-
-.Parameter Prompt
-The prompt prefix to display when this virtual environment is activated. By
-default, this prompt is the name of the virtual environment folder (VenvDir)
-surrounded by parentheses and followed by a single space (ie. '(.venv) ').
-
-.Example
-Activate.ps1
-Activates the Python virtual environment that contains the Activate.ps1 script.
-
-.Example
-Activate.ps1 -Verbose
-Activates the Python virtual environment that contains the Activate.ps1 script,
-and shows extra information about the activation as it executes.
-
-.Example
-Activate.ps1 -VenvDir C:\Users\MyUser\Common\.venv
-Activates the Python virtual environment located in the specified location.
-
-.Example
-Activate.ps1 -Prompt "MyPython"
-Activates the Python virtual environment that contains the Activate.ps1 script,
-and prefixes the current prompt with the specified string (surrounded in
-parentheses) while the virtual environment is active.
-
-.Notes
-On Windows, it may be required to enable this Activate.ps1 script by setting the
-execution policy for the user. You can do this by issuing the following PowerShell
-command:
-
-PS C:\> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
-
-For more information on Execution Policies:
-https://go.microsoft.com/fwlink/?LinkID=135170
-
-#>
-Param(
- [Parameter(Mandatory = $false)]
- [String]
- $VenvDir,
- [Parameter(Mandatory = $false)]
- [String]
- $Prompt
-)
-
-<# Function declarations --------------------------------------------------- #>
-
-<#
-.Synopsis
-Remove all shell session elements added by the Activate script, including the
-addition of the virtual environment's Python executable from the beginning of
-the PATH variable.
-
-.Parameter NonDestructive
-If present, do not remove this function from the global namespace for the
-session.
-
-#>
-function global:deactivate ([switch]$NonDestructive) {
- # Revert to original values
-
- # The prior prompt:
- if (Test-Path -Path Function:_OLD_VIRTUAL_PROMPT) {
- Copy-Item -Path Function:_OLD_VIRTUAL_PROMPT -Destination Function:prompt
- Remove-Item -Path Function:_OLD_VIRTUAL_PROMPT
- }
-
- # The prior PYTHONHOME:
- if (Test-Path -Path Env:_OLD_VIRTUAL_PYTHONHOME) {
- Copy-Item -Path Env:_OLD_VIRTUAL_PYTHONHOME -Destination Env:PYTHONHOME
- Remove-Item -Path Env:_OLD_VIRTUAL_PYTHONHOME
- }
-
- # The prior PATH:
- if (Test-Path -Path Env:_OLD_VIRTUAL_PATH) {
- Copy-Item -Path Env:_OLD_VIRTUAL_PATH -Destination Env:PATH
- Remove-Item -Path Env:_OLD_VIRTUAL_PATH
- }
-
- # Just remove the VIRTUAL_ENV altogether:
- if (Test-Path -Path Env:VIRTUAL_ENV) {
- Remove-Item -Path env:VIRTUAL_ENV
- }
-
- # Just remove the _PYTHON_VENV_PROMPT_PREFIX altogether:
- if (Get-Variable -Name "_PYTHON_VENV_PROMPT_PREFIX" -ErrorAction SilentlyContinue) {
- Remove-Variable -Name _PYTHON_VENV_PROMPT_PREFIX -Scope Global -Force
- }
-
- # Leave deactivate function in the global namespace if requested:
- if (-not $NonDestructive) {
- Remove-Item -Path function:deactivate
- }
-}
-
-<#
-.Description
-Get-PyVenvConfig parses the values from the pyvenv.cfg file located in the
-given folder, and returns them in a map.
-
-For each line in the pyvenv.cfg file, if that line can be parsed into exactly
-two strings separated by `=` (with any amount of whitespace surrounding the =)
-then it is considered a `key = value` line. The left hand string is the key,
-the right hand is the value.
-
-If the value starts with a `'` or a `"` then the first and last character is
-stripped from the value before being captured.
-
-.Parameter ConfigDir
-Path to the directory that contains the `pyvenv.cfg` file.
-#>
-function Get-PyVenvConfig(
- [String]
- $ConfigDir
-) {
- Write-Verbose "Given ConfigDir=$ConfigDir, obtain values in pyvenv.cfg"
-
- # Ensure the file exists, and issue a warning if it doesn't (but still allow the function to continue).
- $pyvenvConfigPath = Join-Path -Resolve -Path $ConfigDir -ChildPath 'pyvenv.cfg' -ErrorAction Continue
-
- # An empty map will be returned if no config file is found.
- $pyvenvConfig = @{ }
-
- if ($pyvenvConfigPath) {
-
- Write-Verbose "File exists, parse `key = value` lines"
- $pyvenvConfigContent = Get-Content -Path $pyvenvConfigPath
-
- $pyvenvConfigContent | ForEach-Object {
- $keyval = $PSItem -split "\s*=\s*", 2
- if ($keyval[0] -and $keyval[1]) {
- $val = $keyval[1]
-
- # Remove extraneous quotations around a string value.
- if ("'""".Contains($val.Substring(0, 1))) {
- $val = $val.Substring(1, $val.Length - 2)
- }
-
- $pyvenvConfig[$keyval[0]] = $val
- Write-Verbose "Adding Key: '$($keyval[0])'='$val'"
- }
- }
- }
- return $pyvenvConfig
-}
-
-
-<# Begin Activate script --------------------------------------------------- #>
-
-# Determine the containing directory of this script
-$VenvExecPath = Split-Path -Parent $MyInvocation.MyCommand.Definition
-$VenvExecDir = Get-Item -Path $VenvExecPath
-
-Write-Verbose "Activation script is located in path: '$VenvExecPath'"
-Write-Verbose "VenvExecDir Fullname: '$($VenvExecDir.FullName)"
-Write-Verbose "VenvExecDir Name: '$($VenvExecDir.Name)"
-
-# Set values required in priority: CmdLine, ConfigFile, Default
-# First, get the location of the virtual environment, it might not be
-# VenvExecDir if specified on the command line.
-if ($VenvDir) {
- Write-Verbose "VenvDir given as parameter, using '$VenvDir' to determine values"
-}
-else {
- Write-Verbose "VenvDir not given as a parameter, using parent directory name as VenvDir."
- $VenvDir = $VenvExecDir.Parent.FullName.TrimEnd("\\/")
- Write-Verbose "VenvDir=$VenvDir"
-}
-
-# Next, read the `pyvenv.cfg` file to determine any required value such
-# as `prompt`.
-$pyvenvCfg = Get-PyVenvConfig -ConfigDir $VenvDir
-
-# Next, set the prompt from the command line, or the config file, or
-# just use the name of the virtual environment folder.
-if ($Prompt) {
- Write-Verbose "Prompt specified as argument, using '$Prompt'"
-}
-else {
- Write-Verbose "Prompt not specified as argument to script, checking pyvenv.cfg value"
- if ($pyvenvCfg -and $pyvenvCfg['prompt']) {
- Write-Verbose " Setting based on value in pyvenv.cfg='$($pyvenvCfg['prompt'])'"
- $Prompt = $pyvenvCfg['prompt'];
- }
- else {
- Write-Verbose " Setting prompt based on parent's directory's name. (Is the directory name passed to venv module when creating the virtual environment)"
- Write-Verbose " Got leaf-name of $VenvDir='$(Split-Path -Path $venvDir -Leaf)'"
- $Prompt = Split-Path -Path $venvDir -Leaf
- }
-}
-
-Write-Verbose "Prompt = '$Prompt'"
-Write-Verbose "VenvDir='$VenvDir'"
-
-# Deactivate any currently active virtual environment, but leave the
-# deactivate function in place.
-deactivate -nondestructive
-
-# Now set the environment variable VIRTUAL_ENV, used by many tools to determine
-# that there is an activated venv.
-$env:VIRTUAL_ENV = $VenvDir
-
-if (-not $Env:VIRTUAL_ENV_DISABLE_PROMPT) {
-
- Write-Verbose "Setting prompt to '$Prompt'"
-
- # Set the prompt to include the env name
- # Make sure _OLD_VIRTUAL_PROMPT is global
- function global:_OLD_VIRTUAL_PROMPT { "" }
- Copy-Item -Path function:prompt -Destination function:_OLD_VIRTUAL_PROMPT
- New-Variable -Name _PYTHON_VENV_PROMPT_PREFIX -Description "Python virtual environment prompt prefix" -Scope Global -Option ReadOnly -Visibility Public -Value $Prompt
-
- function global:prompt {
- Write-Host -NoNewline -ForegroundColor Green "($_PYTHON_VENV_PROMPT_PREFIX) "
- _OLD_VIRTUAL_PROMPT
- }
-}
-
-# Clear PYTHONHOME
-if (Test-Path -Path Env:PYTHONHOME) {
- Copy-Item -Path Env:PYTHONHOME -Destination Env:_OLD_VIRTUAL_PYTHONHOME
- Remove-Item -Path Env:PYTHONHOME
-}
-
-# Add the venv to the PATH
-Copy-Item -Path Env:PATH -Destination Env:_OLD_VIRTUAL_PATH
-$Env:PATH = "$VenvExecDir$([System.IO.Path]::PathSeparator)$Env:PATH"
+<#
+.Synopsis
+Activate a Python virtual environment for the current PowerShell session.
+
+.Description
+Pushes the python executable for a virtual environment to the front of the
+$Env:PATH environment variable and sets the prompt to signify that you are
+in a Python virtual environment. Makes use of the command line switches as
+well as the `pyvenv.cfg` file values present in the virtual environment.
+
+.Parameter VenvDir
+Path to the directory that contains the virtual environment to activate. The
+default value for this is the parent of the directory that the Activate.ps1
+script is located within.
+
+.Parameter Prompt
+The prompt prefix to display when this virtual environment is activated. By
+default, this prompt is the name of the virtual environment folder (VenvDir)
+surrounded by parentheses and followed by a single space (ie. '(.venv) ').
+
+.Example
+Activate.ps1
+Activates the Python virtual environment that contains the Activate.ps1 script.
+
+.Example
+Activate.ps1 -Verbose
+Activates the Python virtual environment that contains the Activate.ps1 script,
+and shows extra information about the activation as it executes.
+
+.Example
+Activate.ps1 -VenvDir C:\Users\MyUser\Common\.venv
+Activates the Python virtual environment located in the specified location.
+
+.Example
+Activate.ps1 -Prompt "MyPython"
+Activates the Python virtual environment that contains the Activate.ps1 script,
+and prefixes the current prompt with the specified string (surrounded in
+parentheses) while the virtual environment is active.
+
+.Notes
+On Windows, it may be required to enable this Activate.ps1 script by setting the
+execution policy for the user. You can do this by issuing the following PowerShell
+command:
+
+PS C:\> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
+
+For more information on Execution Policies:
+https://go.microsoft.com/fwlink/?LinkID=135170
+
+#>
+Param(
+ [Parameter(Mandatory = $false)]
+ [String]
+ $VenvDir,
+ [Parameter(Mandatory = $false)]
+ [String]
+ $Prompt
+)
+
+<# Function declarations --------------------------------------------------- #>
+
+<#
+.Synopsis
+Remove all shell session elements added by the Activate script, including the
+addition of the virtual environment's Python executable from the beginning of
+the PATH variable.
+
+.Parameter NonDestructive
+If present, do not remove this function from the global namespace for the
+session.
+
+#>
+function global:deactivate ([switch]$NonDestructive) {
+ # Revert to original values
+
+ # The prior prompt:
+ if (Test-Path -Path Function:_OLD_VIRTUAL_PROMPT) {
+ Copy-Item -Path Function:_OLD_VIRTUAL_PROMPT -Destination Function:prompt
+ Remove-Item -Path Function:_OLD_VIRTUAL_PROMPT
+ }
+
+ # The prior PYTHONHOME:
+ if (Test-Path -Path Env:_OLD_VIRTUAL_PYTHONHOME) {
+ Copy-Item -Path Env:_OLD_VIRTUAL_PYTHONHOME -Destination Env:PYTHONHOME
+ Remove-Item -Path Env:_OLD_VIRTUAL_PYTHONHOME
+ }
+
+ # The prior PATH:
+ if (Test-Path -Path Env:_OLD_VIRTUAL_PATH) {
+ Copy-Item -Path Env:_OLD_VIRTUAL_PATH -Destination Env:PATH
+ Remove-Item -Path Env:_OLD_VIRTUAL_PATH
+ }
+
+ # Just remove the VIRTUAL_ENV altogether:
+ if (Test-Path -Path Env:VIRTUAL_ENV) {
+ Remove-Item -Path env:VIRTUAL_ENV
+ }
+
+ # Just remove VIRTUAL_ENV_PROMPT altogether.
+ if (Test-Path -Path Env:VIRTUAL_ENV_PROMPT) {
+ Remove-Item -Path env:VIRTUAL_ENV_PROMPT
+ }
+
+ # Just remove the _PYTHON_VENV_PROMPT_PREFIX altogether:
+ if (Get-Variable -Name "_PYTHON_VENV_PROMPT_PREFIX" -ErrorAction SilentlyContinue) {
+ Remove-Variable -Name _PYTHON_VENV_PROMPT_PREFIX -Scope Global -Force
+ }
+
+ # Leave deactivate function in the global namespace if requested:
+ if (-not $NonDestructive) {
+ Remove-Item -Path function:deactivate
+ }
+}
+
+<#
+.Description
+Get-PyVenvConfig parses the values from the pyvenv.cfg file located in the
+given folder, and returns them in a map.
+
+For each line in the pyvenv.cfg file, if that line can be parsed into exactly
+two strings separated by `=` (with any amount of whitespace surrounding the =)
+then it is considered a `key = value` line. The left hand string is the key,
+the right hand is the value.
+
+If the value starts with a `'` or a `"` then the first and last character is
+stripped from the value before being captured.
+
+.Parameter ConfigDir
+Path to the directory that contains the `pyvenv.cfg` file.
+#>
+function Get-PyVenvConfig(
+ [String]
+ $ConfigDir
+) {
+ Write-Verbose "Given ConfigDir=$ConfigDir, obtain values in pyvenv.cfg"
+
+ # Ensure the file exists, and issue a warning if it doesn't (but still allow the function to continue).
+ $pyvenvConfigPath = Join-Path -Resolve -Path $ConfigDir -ChildPath 'pyvenv.cfg' -ErrorAction Continue
+
+ # An empty map will be returned if no config file is found.
+ $pyvenvConfig = @{ }
+
+ if ($pyvenvConfigPath) {
+
+ Write-Verbose "File exists, parse `key = value` lines"
+ $pyvenvConfigContent = Get-Content -Path $pyvenvConfigPath
+
+ $pyvenvConfigContent | ForEach-Object {
+ $keyval = $PSItem -split "\s*=\s*", 2
+ if ($keyval[0] -and $keyval[1]) {
+ $val = $keyval[1]
+
+ # Remove extraneous quotations around a string value.
+ if ("'""".Contains($val.Substring(0, 1))) {
+ $val = $val.Substring(1, $val.Length - 2)
+ }
+
+ $pyvenvConfig[$keyval[0]] = $val
+ Write-Verbose "Adding Key: '$($keyval[0])'='$val'"
+ }
+ }
+ }
+ return $pyvenvConfig
+}
+
+
+<# Begin Activate script --------------------------------------------------- #>
+
+# Determine the containing directory of this script
+$VenvExecPath = Split-Path -Parent $MyInvocation.MyCommand.Definition
+$VenvExecDir = Get-Item -Path $VenvExecPath
+
+Write-Verbose "Activation script is located in path: '$VenvExecPath'"
+Write-Verbose "VenvExecDir Fullname: '$($VenvExecDir.FullName)"
+Write-Verbose "VenvExecDir Name: '$($VenvExecDir.Name)"
+
+# Set values required in priority: CmdLine, ConfigFile, Default
+# First, get the location of the virtual environment, it might not be
+# VenvExecDir if specified on the command line.
+if ($VenvDir) {
+ Write-Verbose "VenvDir given as parameter, using '$VenvDir' to determine values"
+}
+else {
+ Write-Verbose "VenvDir not given as a parameter, using parent directory name as VenvDir."
+ $VenvDir = $VenvExecDir.Parent.FullName.TrimEnd("\\/")
+ Write-Verbose "VenvDir=$VenvDir"
+}
+
+# Next, read the `pyvenv.cfg` file to determine any required value such
+# as `prompt`.
+$pyvenvCfg = Get-PyVenvConfig -ConfigDir $VenvDir
+
+# Next, set the prompt from the command line, or the config file, or
+# just use the name of the virtual environment folder.
+if ($Prompt) {
+ Write-Verbose "Prompt specified as argument, using '$Prompt'"
+}
+else {
+ Write-Verbose "Prompt not specified as argument to script, checking pyvenv.cfg value"
+ if ($pyvenvCfg -and $pyvenvCfg['prompt']) {
+ Write-Verbose " Setting based on value in pyvenv.cfg='$($pyvenvCfg['prompt'])'"
+ $Prompt = $pyvenvCfg['prompt'];
+ }
+ else {
+ Write-Verbose " Setting prompt based on parent's directory's name. (Is the directory name passed to venv module when creating the virtual environment)"
+ Write-Verbose " Got leaf-name of $VenvDir='$(Split-Path -Path $venvDir -Leaf)'"
+ $Prompt = Split-Path -Path $venvDir -Leaf
+ }
+}
+
+Write-Verbose "Prompt = '$Prompt'"
+Write-Verbose "VenvDir='$VenvDir'"
+
+# Deactivate any currently active virtual environment, but leave the
+# deactivate function in place.
+deactivate -nondestructive
+
+# Now set the environment variable VIRTUAL_ENV, used by many tools to determine
+# that there is an activated venv.
+$env:VIRTUAL_ENV = $VenvDir
+
+if (-not $Env:VIRTUAL_ENV_DISABLE_PROMPT) {
+
+ Write-Verbose "Setting prompt to '$Prompt'"
+
+ # Set the prompt to include the env name
+ # Make sure _OLD_VIRTUAL_PROMPT is global
+ function global:_OLD_VIRTUAL_PROMPT { "" }
+ Copy-Item -Path function:prompt -Destination function:_OLD_VIRTUAL_PROMPT
+ New-Variable -Name _PYTHON_VENV_PROMPT_PREFIX -Description "Python virtual environment prompt prefix" -Scope Global -Option ReadOnly -Visibility Public -Value $Prompt
+
+ function global:prompt {
+ Write-Host -NoNewline -ForegroundColor Green "($_PYTHON_VENV_PROMPT_PREFIX) "
+ _OLD_VIRTUAL_PROMPT
+ }
+ $env:VIRTUAL_ENV_PROMPT = $Prompt
+}
+
+# Clear PYTHONHOME
+if (Test-Path -Path Env:PYTHONHOME) {
+ Copy-Item -Path Env:PYTHONHOME -Destination Env:_OLD_VIRTUAL_PYTHONHOME
+ Remove-Item -Path Env:PYTHONHOME
+}
+
+# Add the venv to the PATH
+Copy-Item -Path Env:PATH -Destination Env:_OLD_VIRTUAL_PATH
+$Env:PATH = "$VenvExecDir$([System.IO.Path]::PathSeparator)$Env:PATH"
diff --git a/unicoding_venv/bin/activate b/unicoding_venv/bin/activate
index c4d653c2..f1302f40 100644
--- a/unicoding_venv/bin/activate
+++ b/unicoding_venv/bin/activate
@@ -28,6 +28,7 @@ deactivate () {
fi
unset VIRTUAL_ENV
+ unset VIRTUAL_ENV_PROMPT
if [ ! "${1:-}" = "nondestructive" ] ; then
# Self destruct!
unset -f deactivate
@@ -37,7 +38,7 @@ deactivate () {
# unset irrelevant variables
deactivate nondestructive
-VIRTUAL_ENV="/Users/lzah/Desktop/unicoding/unicoding_venv"
+VIRTUAL_ENV="/Users/muntadhar/Desktop/Task3/unicoding/unicoding_venv"
export VIRTUAL_ENV
_OLD_VIRTUAL_PATH="$PATH"
@@ -56,6 +57,8 @@ if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT:-}" ] ; then
_OLD_VIRTUAL_PS1="${PS1:-}"
PS1="(unicoding_venv) ${PS1:-}"
export PS1
+ VIRTUAL_ENV_PROMPT="(unicoding_venv) "
+ export VIRTUAL_ENV_PROMPT
fi
# This should detect bash and zsh, which have a hash command that must
diff --git a/unicoding_venv/bin/activate.csh b/unicoding_venv/bin/activate.csh
index 41b83bb7..8bc8133f 100644
--- a/unicoding_venv/bin/activate.csh
+++ b/unicoding_venv/bin/activate.csh
@@ -3,12 +3,12 @@
# Created by Davide Di Blasi .
# Ported to Python 3.3 venv by Andrew Svetlov
-alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PATH" && unset _OLD_VIRTUAL_PATH; rehash; test $?_OLD_VIRTUAL_PROMPT != 0 && set prompt="$_OLD_VIRTUAL_PROMPT" && unset _OLD_VIRTUAL_PROMPT; unsetenv VIRTUAL_ENV; test "\!:*" != "nondestructive" && unalias deactivate'
+alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PATH" && unset _OLD_VIRTUAL_PATH; rehash; test $?_OLD_VIRTUAL_PROMPT != 0 && set prompt="$_OLD_VIRTUAL_PROMPT" && unset _OLD_VIRTUAL_PROMPT; unsetenv VIRTUAL_ENV; unsetenv VIRTUAL_ENV_PROMPT; test "\!:*" != "nondestructive" && unalias deactivate'
# Unset irrelevant variables.
deactivate nondestructive
-setenv VIRTUAL_ENV "/Users/lzah/Desktop/unicoding/unicoding_venv"
+setenv VIRTUAL_ENV "/Users/muntadhar/Desktop/Task3/unicoding/unicoding_venv"
set _OLD_VIRTUAL_PATH="$PATH"
setenv PATH "$VIRTUAL_ENV/bin:$PATH"
@@ -18,6 +18,7 @@ set _OLD_VIRTUAL_PROMPT="$prompt"
if (! "$?VIRTUAL_ENV_DISABLE_PROMPT") then
set prompt = "(unicoding_venv) $prompt"
+ setenv VIRTUAL_ENV_PROMPT "(unicoding_venv) "
endif
alias pydoc python -m pydoc
diff --git a/unicoding_venv/bin/activate.fish b/unicoding_venv/bin/activate.fish
index 7f9c9192..abfe25cf 100644
--- a/unicoding_venv/bin/activate.fish
+++ b/unicoding_venv/bin/activate.fish
@@ -20,6 +20,7 @@ function deactivate -d "Exit virtual environment and return to normal shell env
end
set -e VIRTUAL_ENV
+ set -e VIRTUAL_ENV_PROMPT
if test "$argv[1]" != "nondestructive"
# Self-destruct!
functions -e deactivate
@@ -29,7 +30,7 @@ end
# Unset irrelevant variables.
deactivate nondestructive
-set -gx VIRTUAL_ENV "/Users/lzah/Desktop/unicoding/unicoding_venv"
+set -gx VIRTUAL_ENV "/Users/muntadhar/Desktop/Task3/unicoding/unicoding_venv"
set -gx _OLD_VIRTUAL_PATH $PATH
set -gx PATH "$VIRTUAL_ENV/bin" $PATH
@@ -61,4 +62,5 @@ if test -z "$VIRTUAL_ENV_DISABLE_PROMPT"
end
set -gx _OLD_FISH_PROMPT_OVERRIDE "$VIRTUAL_ENV"
+ set -gx VIRTUAL_ENV_PROMPT "(unicoding_venv) "
end
diff --git a/unicoding_venv/bin/django-admin b/unicoding_venv/bin/django-admin
index d398987e..f368c57a 100755
--- a/unicoding_venv/bin/django-admin
+++ b/unicoding_venv/bin/django-admin
@@ -1,4 +1,4 @@
-#!/Users/lzah/Desktop/unicoding/unicoding_venv/bin/python3.9
+#!/Users/muntadhar/Desktop/Task3/unicoding/unicoding_venv/bin/python3
# -*- coding: utf-8 -*-
import re
import sys
diff --git a/unicoding_venv/bin/email_validator b/unicoding_venv/bin/email_validator
index 4591bd53..23ede45a 100755
--- a/unicoding_venv/bin/email_validator
+++ b/unicoding_venv/bin/email_validator
@@ -1,4 +1,4 @@
-#!/Users/lzah/Desktop/unicoding/unicoding_venv/bin/python3.9
+#!/Users/muntadhar/Desktop/Task3/unicoding/unicoding_venv/bin/python3
# -*- coding: utf-8 -*-
import re
import sys
diff --git a/unicoding_venv/bin/pip b/unicoding_venv/bin/pip
index 1b5e2763..1929d04f 100755
--- a/unicoding_venv/bin/pip
+++ b/unicoding_venv/bin/pip
@@ -1,4 +1,4 @@
-#!/Users/lzah/Desktop/unicoding/unicoding_venv/bin/python3.9
+#!/Users/muntadhar/Desktop/Task3/unicoding/unicoding_venv/bin/python3
# -*- coding: utf-8 -*-
import re
import sys
diff --git a/unicoding_venv/bin/pip3 b/unicoding_venv/bin/pip3
index 1b5e2763..1929d04f 100755
--- a/unicoding_venv/bin/pip3
+++ b/unicoding_venv/bin/pip3
@@ -1,4 +1,4 @@
-#!/Users/lzah/Desktop/unicoding/unicoding_venv/bin/python3.9
+#!/Users/muntadhar/Desktop/Task3/unicoding/unicoding_venv/bin/python3
# -*- coding: utf-8 -*-
import re
import sys
diff --git a/unicoding_venv/bin/pip3.9 b/unicoding_venv/bin/pip3.10
similarity index 74%
rename from unicoding_venv/bin/pip3.9
rename to unicoding_venv/bin/pip3.10
index 1b5e2763..1929d04f 100755
--- a/unicoding_venv/bin/pip3.9
+++ b/unicoding_venv/bin/pip3.10
@@ -1,4 +1,4 @@
-#!/Users/lzah/Desktop/unicoding/unicoding_venv/bin/python3.9
+#!/Users/muntadhar/Desktop/Task3/unicoding/unicoding_venv/bin/python3
# -*- coding: utf-8 -*-
import re
import sys
diff --git a/unicoding_venv/bin/pyrsa-decrypt b/unicoding_venv/bin/pyrsa-decrypt
index 712d8a71..5bd365b1 100755
--- a/unicoding_venv/bin/pyrsa-decrypt
+++ b/unicoding_venv/bin/pyrsa-decrypt
@@ -1,4 +1,4 @@
-#!/Users/lzah/Desktop/unicoding/unicoding_venv/bin/python3.9
+#!/Users/muntadhar/Desktop/Task3/unicoding/unicoding_venv/bin/python3
# -*- coding: utf-8 -*-
import re
import sys
diff --git a/unicoding_venv/bin/pyrsa-encrypt b/unicoding_venv/bin/pyrsa-encrypt
index 602e08f5..7d3ba1ed 100755
--- a/unicoding_venv/bin/pyrsa-encrypt
+++ b/unicoding_venv/bin/pyrsa-encrypt
@@ -1,4 +1,4 @@
-#!/Users/lzah/Desktop/unicoding/unicoding_venv/bin/python3.9
+#!/Users/muntadhar/Desktop/Task3/unicoding/unicoding_venv/bin/python3
# -*- coding: utf-8 -*-
import re
import sys
diff --git a/unicoding_venv/bin/pyrsa-keygen b/unicoding_venv/bin/pyrsa-keygen
index 8d7656ea..df8a04f8 100755
--- a/unicoding_venv/bin/pyrsa-keygen
+++ b/unicoding_venv/bin/pyrsa-keygen
@@ -1,4 +1,4 @@
-#!/Users/lzah/Desktop/unicoding/unicoding_venv/bin/python3.9
+#!/Users/muntadhar/Desktop/Task3/unicoding/unicoding_venv/bin/python3
# -*- coding: utf-8 -*-
import re
import sys
diff --git a/unicoding_venv/bin/pyrsa-priv2pub b/unicoding_venv/bin/pyrsa-priv2pub
index d7d5fb4a..b8110bdb 100755
--- a/unicoding_venv/bin/pyrsa-priv2pub
+++ b/unicoding_venv/bin/pyrsa-priv2pub
@@ -1,4 +1,4 @@
-#!/Users/lzah/Desktop/unicoding/unicoding_venv/bin/python3.9
+#!/Users/muntadhar/Desktop/Task3/unicoding/unicoding_venv/bin/python3
# -*- coding: utf-8 -*-
import re
import sys
diff --git a/unicoding_venv/bin/pyrsa-sign b/unicoding_venv/bin/pyrsa-sign
index bf719e18..986b7069 100755
--- a/unicoding_venv/bin/pyrsa-sign
+++ b/unicoding_venv/bin/pyrsa-sign
@@ -1,4 +1,4 @@
-#!/Users/lzah/Desktop/unicoding/unicoding_venv/bin/python3.9
+#!/Users/muntadhar/Desktop/Task3/unicoding/unicoding_venv/bin/python3
# -*- coding: utf-8 -*-
import re
import sys
diff --git a/unicoding_venv/bin/pyrsa-verify b/unicoding_venv/bin/pyrsa-verify
index 39849786..3afc556f 100755
--- a/unicoding_venv/bin/pyrsa-verify
+++ b/unicoding_venv/bin/pyrsa-verify
@@ -1,4 +1,4 @@
-#!/Users/lzah/Desktop/unicoding/unicoding_venv/bin/python3.9
+#!/Users/muntadhar/Desktop/Task3/unicoding/unicoding_venv/bin/python3
# -*- coding: utf-8 -*-
import re
import sys
diff --git a/unicoding_venv/bin/python b/unicoding_venv/bin/python
index e616d269..b8a0adbb 120000
--- a/unicoding_venv/bin/python
+++ b/unicoding_venv/bin/python
@@ -1 +1 @@
-python3.9
\ No newline at end of file
+python3
\ No newline at end of file
diff --git a/unicoding_venv/bin/python3 b/unicoding_venv/bin/python3
index e616d269..1ec499c5 120000
--- a/unicoding_venv/bin/python3
+++ b/unicoding_venv/bin/python3
@@ -1 +1 @@
-python3.9
\ No newline at end of file
+/Library/Frameworks/Python.framework/Versions/3.10/bin/python3
\ No newline at end of file
diff --git a/unicoding_venv/bin/python3.10 b/unicoding_venv/bin/python3.10
new file mode 120000
index 00000000..b8a0adbb
--- /dev/null
+++ b/unicoding_venv/bin/python3.10
@@ -0,0 +1 @@
+python3
\ No newline at end of file
diff --git a/unicoding_venv/bin/python3.9 b/unicoding_venv/bin/python3.9
deleted file mode 120000
index ffeae670..00000000
--- a/unicoding_venv/bin/python3.9
+++ /dev/null
@@ -1 +0,0 @@
-/opt/homebrew/opt/python@3.9/bin/python3.9
\ No newline at end of file
diff --git a/unicoding_venv/bin/sqlformat b/unicoding_venv/bin/sqlformat
index 1bbb7d15..488a7fff 100755
--- a/unicoding_venv/bin/sqlformat
+++ b/unicoding_venv/bin/sqlformat
@@ -1,4 +1,4 @@
-#!/Users/lzah/Desktop/unicoding/unicoding_venv/bin/python3.9
+#!/Users/muntadhar/Desktop/Task3/unicoding/unicoding_venv/bin/python3
# -*- coding: utf-8 -*-
import re
import sys
diff --git a/unicoding_venv/lib/python3.9/site-packages/Django-4.0.6.dist-info/AUTHORS b/unicoding_venv/lib/python3.9/site-packages/Django-4.0.6.dist-info/AUTHORS
deleted file mode 100644
index dc2e77aa..00000000
--- a/unicoding_venv/lib/python3.9/site-packages/Django-4.0.6.dist-info/AUTHORS
+++ /dev/null
@@ -1,1029 +0,0 @@
-Django was originally created in late 2003 at World Online, the web division
-of the Lawrence Journal-World newspaper in Lawrence, Kansas.
-
-Here is an inevitably incomplete list of MUCH-APPRECIATED CONTRIBUTORS --
-people who have submitted patches, reported bugs, added translations, helped
-answer newbie questions, and generally made Django that much better:
-
- Aaron Cannon
- Aaron Swartz
- Aaron T. Myers
- Abeer Upadhyay
- Abhijeet Viswa
- Abhinav Patil
- Abhishek Gautam
- Abhyudai
- Adam Allred
- Adam Bogdał
- Adam Donaghy
- Adam Johnson
- Adam Malinowski
- Adam Vandenberg
- Adiyat Mubarak
- Adnan Umer
- Adrian Holovaty
- Adrien Lemaire
- Afonso Fernández Nogueira
- AgarFu
- Ahmad Alhashemi
- Ahmad Al-Ibrahim
- Ahmed Eltawela
- ajs
- Akash Agrawal
- Akis Kesoglou
- Aksel Ethem
- Akshesh Doshi
- alang@bright-green.com
- Alasdair Nicol
- Albert Wang
- Alcides Fonseca
- Aldian Fazrihady
- Aleksandra Sendecka
- Aleksi Häkli
- Alex Dutton
- Alexander Myodov
- Alexandr Tatarinov
- Alex Aktsipetrov
- Alex Becker
- Alex Couper
- Alex Dedul
- Alex Gaynor
- Alex Hill
- Alex Ogier
- Alex Robbins
- Alexey Boriskin
- Alexey Tsivunin
- Ali Vakilzade
- Aljaž Košir
- Aljosa Mohorovic
- Amit Chakradeo
- Amit Ramon
- Amit Upadhyay
- A. Murat Eren
- Ana Belen Sarabia
- Ana Krivokapic
- Andi Albrecht
- André Ericson
- Andrei Kulakov
- Andreas
- Andreas Mock
- Andreas Pelme
- Andrés Torres Marroquín
- Andrew Brehaut
- Andrew Clark
- Andrew Durdin
- Andrew Godwin
- Andrew Pinkham
- Andrews Medina
- Andrew Northall
- Andriy Sokolovskiy
- Andy Chosak
- Andy Dustman
- Andy Gayton
- andy@jadedplanet.net
- Anssi Kääriäinen
- ant9000@netwise.it
- Anthony Briggs
- Anthony Wright
- Anton Samarchyan
- Antoni Aloy
- Antonio Cavedoni
- Antonis Christofides
- Antti Haapala
- Antti Kaihola
- Anubhav Joshi
- Aram Dulyan
- arien
- Armin Ronacher
- Aron Podrigal
- Artem Gnilov
- Arthur
- Arthur Jovart
- Arthur Koziel
- Arthur Rio
- Arvis Bickovskis
- Arya Khaligh
- Aryeh Leib Taurog
- A S Alam
- Asif Saif Uddin
- atlithorn
- Audrey Roy
- av0000@mail.ru
- Axel Haustant
- Aymeric Augustin
- Bahadır Kandemir
- Baishampayan Ghose
- Baptiste Mispelon
- Barry Pederson
- Bartolome Sanchez Salado
- Barton Ip
- Bartosz Grabski
- Bashar Al-Abdulhadi
- Bastian Kleineidam
- Batiste Bieler
- Batman
- Batuhan Taskaya
- Baurzhan Ismagulov
- Ben Dean Kawamura
- Ben Firshman
- Ben Godfrey
- Benjamin Wohlwend
- Ben Khoo
- Ben Slavin
- Ben Sturmfels
- Berker Peksag
- Bernd Schlapsi
- Bernhard Essl
- berto
- Bill Fenner
- Bjørn Stabell
- Bo Marchman
- Bogdan Mateescu
- Bojan Mihelac
- Bouke Haarsma
- Božidar Benko
- Brad Melin
- Brandon Chinn
- Brant Harris
- Brendan Hayward
- Brendan Quinn
- Brenton Simpson
- Brett Cannon
- Brett Hoerner
- Brian Beck
- Brian Fabian Crain
- Brian Harring
- Brian Helba
- Brian Ray
- Brian Rosner
- Bruce Kroeze
- Bruno Alla
- Bruno Renié
- brut.alll@gmail.com
- Bryan Chow
- Bryan Veloso
- bthomas
- btoll@bestweb.net
- C8E
- Caio Ariede
- Calvin Spealman
- Cameron Curry
- Cameron Knight (ckknight)
- Can Burak Çilingir
- Can Sarıgöl
- Carl Meyer
- Carles Pina i Estany
- Carlos Eduardo de Paula
- Carlos Matías de la Torre
- Carlton Gibson
- cedric@terramater.net
- Chad Whitman
- ChaosKCW
- Charlie Leifer
- charly.wilhelm@gmail.com
- Chason Chaffin
- Cheng Zhang
- Chris Adams
- Chris Beaven
- Chris Bennett
- Chris Cahoon
- Chris Chamberlin
- Chris Jerdonek
- Chris Jones
- Chris Lamb
- Chris Streeter
- Christian Barcenas
- Christian Metts
- Christian Oudard
- Christian Tanzer
- Christoffer Sjöbergsson
- Christophe Pettus
- Christopher Adams
- Christopher Babiak
- Christopher Lenz
- Christoph Mędrela
- Chris Wagner
- Chris Wesseling
- Chris Wilson
- Claude Paroz
- Clint Ecker
- colin@owlfish.com
- Colin Wood
- Collin Anderson
- Collin Grady
- Colton Hicks
- Craig Blaszczyk
- crankycoder@gmail.com
- Curtis Maloney (FunkyBob)
- dackze+django@gmail.com
- Dagur Páll Ammendrup
- Dane Springmeyer
- Dan Fairs
- Daniel Alves Barbosa de Oliveira Vaz
- Daniel Duan
- Daniele Procida
- Daniel Greenfeld
- dAniel hAhler
- Daniel Jilg
- Daniel Lindsley
- Daniel Poelzleithner
- Daniel Pyrathon
- Daniel Roseman
- Daniel Tao
- Daniel Wiesmann
- Danilo Bargen
- Dan Johnson
- Dan Palmer
- Dan Poirier
- Dan Stephenson
- Dan Watson
- dave@thebarproject.com
- David Ascher
- David Avsajanishvili
- David Blewett
- David Brenneman
- David Cramer
- David Danier
- David Eklund
- David Foster
- David Gouldin
- david@kazserve.org
- David Krauth
- David Larlet
- David Reynolds
- David Sanders
- David Schein
- David Tulig
- David Winterbottom
- David Wobrock
- Davide Ceretti
- Deep L. Sukhwani
- Deepak Thukral
- Denis Kuzmichyov
- Dennis Schwertel
- Derek Willis
- Deric Crago
- deric@monowerks.com
- Deryck Hodge
- Dimitris Glezos
- Dirk Datzert
- Dirk Eschler
- Dmitri Fedortchenko
- Dmitry Jemerov
- dne@mayonnaise.net
- Dolan Antenucci
- Donald Harvey
- Donald Stufft
- Don Spaulding
- Doug Beck
- Doug Napoleone
- dready
- dusk@woofle.net
- Dustyn Gibson
- Ed Morley
- Egidijus Macijauskas
- eibaan@gmail.com
- elky
- Emmanuelle Delescolle
- Emil Stenström
- enlight
- Enrico
- Eric Boersma
- Eric Brandwein
- Eric Floehr
- Eric Florenzano
- Eric Holscher
- Eric Moritz
- Eric Palakovich Carr
- Erik Karulf
- Erik Romijn
- eriks@win.tue.nl
- Erwin Junge
- Esdras Beleza
- Espen Grindhaug
- Étienne Beaulé
- Eugene Lazutkin
- Evan Grim
- Fabian Büchler
- Fabrice Aneche
- Farhaan Bukhsh
- favo@exoweb.net
- fdr
- Federico Capoano
- Felipe Lee
- Filip Noetzel
- Filip Wasilewski
- Finn Gruwier Larsen
- Flávio Juvenal da Silva Junior
- flavio.curella@gmail.com
- Florian Apolloner
- Florian Demmer
- Florian Moussous
- Fran Hrženjak
- Francisco Albarran Cristobal
- Francisco Couzo
- François Freitag
- Frank Tegtmeyer
- Frank Wierzbicki
- Frank Wiles
- František Malina
- Fraser Nevett
- Gabriel Grant
- Gabriel Hurley
- gandalf@owca.info
- Garry Lawrence
- Garry Polley
- Garth Kidd
- Gary Wilson
- Gasper Koren
- Gasper Zejn
- Gavin Wahl
- Ge Hanbin
- geber@datacollect.com
- Geert Vanderkelen
- George Karpenkov
- George Song
- George Vilches
- Georg "Hugo" Bauer
- Georgi Stanojevski
- Gerardo Orozco
- Gil Gonçalves
- Girish Kumar
- Girish Sontakke
- Gisle Aas
- Glenn Maynard
- glin@seznam.cz
- GomoX