This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sqlalchemy import String | |
from sqlalchemy.orm import DeclarativeBase | |
from sqlalchemy import Integer,String,Float | |
from sqlalchemy.orm import Mapped | |
from sqlalchemy.orm import mapped_column | |
class Base(DeclarativeBase): | |
pass | |
class Planet(Base): | |
__tablename__ = "planet" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sqlalchemy import create_engine | |
from sqlalchemy.orm import Session | |
import pymysql | |
pymysql.install_as_MySQLdb() #MySQL specific | |
connectionString="mysql+mysqldb://root:India12#$@localhost/alchemydb2" | |
engine = create_engine(connectionString,echo=False)#echo True will print on screen | |
session = Session(engine) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers\Api; | |
use App\Http\Controllers\Controller; | |
use App\Http\Requests\MobileVerificationRequest; | |
use App\Services\SmsService; | |
class VerificationController extends Controller | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Listeners; | |
use App\Events\AddressChangeEvent; | |
use Illuminate\Support\Facades\Log; | |
class AddressChangeListenerForLogistics | |
{ | |
public function __construct() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Events; | |
use App\Models\Order; | |
use Illuminate\Foundation\Events\Dispatchable; | |
class AddressChangeEvent | |
{ | |
use Dispatchable; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Services; | |
use App\Events\AddressChangeEvent; | |
use App\Models\Order; | |
class AddressChangeNotifService | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Services; | |
use App\DTO\AddressChangeDTO; | |
use App\Models\Order; | |
use App\Respository\OrderRepository; | |
use Exception; | |
class OrderService |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers; | |
use App\DTO\AddressChangeDTO; | |
use App\Http\Requests\AddressChangeRequest; | |
use App\Services\OrderService; | |
class AddressController extends Controller | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import models | |
from model_utils import FieldTracker | |
from stock import signals | |
class Stock(models.Model): | |
code = models.CharField(max_length=20,unique=True) | |
name = models.CharField(max_length=120) | |
current_value = models.FloatField() | |
# | |
current_value_tracker = FieldTracker(fields=['current_value']) | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"id": "emp-001", | |
"name": "Chris Nathan", | |
"department": "Dev", | |
"designation": "Analyst", | |
"experience": 7 | |
}, | |
{ | |
"id": "emp-002", |
NewerOlder