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
| def create_periodic_tasks(session): | |
| interval_schedule, created = IntervalSchedule.objects.get_or_create(every=1, period=IntervalSchedule.MINUTES) | |
| PeriodicTask.objects.bulk_create([ | |
| PeriodicTask( | |
| interval=interval_schedule, | |
| name=f'Set meeting status active, Session Id : {session.id}', | |
| task='app.tasks.task_name', | |
| args=json.dumps([session.id, "active"]) , | |
| one_off=True, | |
| start_time=session.start_time,), |
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 celery import shared_task | |
| "Imports here" | |
| @shared_task | |
| def set_session_status(session_id : int, status): | |
| session : Session = Session.objects.get(id=session_id) | |
| "Logic here" | |
| @shared_task |
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
| static Future<List<BootcampDetails>> getData(String filter, | |
| {String storeId = ""}) async { | |
| var response = await http.post( | |
| Uri.parse("https://dummyURl.com"), | |
| body: jsonEncode(<String, dynamic>{ | |
| "pageSize": 100, | |
| "pageNumber": 1, | |
| "keywords": "", | |
| "filters": { | |
| "searchText": filter |
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
| Widget _customPopupItemBuilder( | |
| BuildContext context, dynamic item, bool isSelected) { | |
| return Container( | |
| margin: const EdgeInsets.symmetric(horizontal: 8), | |
| decoration: !isSelected | |
| ? null | |
| : BoxDecoration( | |
| border: Border.all(color: Theme.of(context).primaryColor), | |
| borderRadius: BorderRadius.circular(5), | |
| color: Colors.white, |
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
| Widget _customDropDownPrograms(BuildContext context, BootcampDetails? item) { | |
| return Container( | |
| child: (item == null) | |
| ? const ListTile( | |
| contentPadding: EdgeInsets.all(0), | |
| title: Text("Search Programs", | |
| textAlign: TextAlign.start, | |
| style: TextStyle( | |
| fontSize: 13, | |
| color: Color.fromARGB(235, 158, 158, 158))), |
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
| DropdownSearch<Class>( | |
| mode: Mode.MENU, | |
| showSearchBox: true, | |
| isFilteredOnline: true, | |
| dropDownButton: const Icon( | |
| Icons.keyboard_arrow_down, | |
| color: Colors.grey, | |
| size: 18, | |
| ), | |
| dropdownSearchDecoration: Styles.inputDecoration( |
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
| def push_data_to_s3_bucket(self , bucket_name ,data , file_name, file_size , content_type ): | |
| config = TransferConfig( multipart_threshold=1024 * 25, #limit above which multiparts activate | |
| max_concurrency=10, #threads | |
| multipart_chunksize=1024 * 25, #size of data in each thread | |
| use_threads=True) #enabling threads | |
| self.s3.Object(bucket_name, file_name).upload_fileobj(data, | |
| ExtraArgs={'ContentType': content_type}, | |
| Config=config, |
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
| class AmazonS3: | |
| def __init__(self, aws_access_key_id ,aws_secret_access_key,region_name): | |
| self.s3 = boto3.resource('s3', | |
| aws_access_key_id = aws_access_key_id, | |
| aws_secret_access_key= aws_secret_access_key, | |
| region_name = region_name) |