teleren/devto huggingface dataset:
Custom Model Managers In Django
Tags: django, djanagomodel, python
Published: 2023-09-25 06:11:30

**Custom Model Managers In Django**
A manager is an interface through which database query operations are provided to Django models. At least one Manager exists for every model in a Django application, objects is the default manager of every model that retrieves all objects in the database.

However, one model can have multiple model managers, we can also build our own custom model managers by extending the base manager class.

Creating Custom Model Managers
`class Post(models.Model):
    title = models.CharField(max_length=200)
    content = models.TextField()
    active = models.BooleanField(default=False)

    def __str__(self):
        return self.title`
objects is the default model manager for every model, therefore Post.objects.all() will return all post objects.

The objects method is capable of doing all basic **QuerySets **then why would we need a custom model manager?

**Why would we need Custom Model Manager**

To add extra Manager methods.
To modify the initial QuerySet the Manager returns.
Let’s create a model manager to retrieve all the published posts.

Using the objects manager published posts can be retrieved with the following query.

Lets create some dummy data using Django Shell,

```
>>  Post.objects.filter(active=True) Out: <QuerySet [<Post: Fourth Post>, <Post: First post>]>

>> <QuerySet [<Post: Fourth Post>, <Post: First post>]>
```
We will build a custom model manager called publish to retrieve the published posts.

```
class PublishManager(models.Manager):
    def get_queryset(self):
        return super(PublishManager, self).get_queryset().filter(active=True)
```


```
class Post(models.Model):
    .. our fields

    objects = models.Manager()  # The default manager.
    publish = PublishManager()  # Our custom manager.

    def __str__(self):
        return self.title

```
Now we can retrieve posts with the custom model manager as follows.

```
>> Post.published.all()   
>> <QuerySet [<Post: First post>, <Post: Fourth Post>]>

>> Post.objects.filter(active= True)     
>> <QuerySet [<Post: First post>, <Post: Fourth Post>]>
```
Hope this would help you to understand the basic idea about custom model manager.
10 Important Features Every Codeless Test Automation Tool Must Have
Tags: codelesstestautomation, testautomation, crossbrowsertesting, devops
Published: 2023-09-25 06:04:59

The demand for efficient and effective testing tools has never been higher. As organizations strive to deliver high-quality software at an accelerated pace, [codeless test automation](https://tenjinonline.com/) tools are gaining immense significance. These tools empower testers, even those without extensive programming knowledge, to create and execute test scripts quickly and easily.

It’s clear that incorporating test automation tool as a part of application development is inevitable, but choosing the right tool makes all the difference. Not all codeless test automation tools are created equal, it is essential for organizations to choose the right test automation tool that best suits their requirements and budget. But how to choose the right tool? To help you make an informed decision, we’ve compiled a list of 10 important features in this article that every codeless test automation tool must have.
Looking for Vue JS Project
Published: 2023-09-25 05:34:36

Are you looking for a reliable Laravel and VueJS developer? With years of experience in PHP and Laravel, I can provide top-quality web development services, from building a website from scratch to upgrading an existing Laravel-based application. 

Here I created a new account let's discuss 
[](https://www.fiverr.com/rajendra_nagar/laravel-vue-js-development)

Expertise
    • Code refactoring 
    • Bug fixing 
    • REST APIs
    • PHP Unit Testing
    • VUEX (State Management)

I use the following technology 
    1. PHP
    2. Laravel
    3. MySQL
    4. JavaScript / jQuery
    5. Vue Js

I always Keep in my mind

    1. 100% Client Satisfaction
    2. Unlimited Revision to build a good relation
    3. 100% Money-back Guarantee
    4. Timely delivery of work
Need help!
Published: 2023-09-25 06:01:27

"Hello, everyone! I'm Saad, hailing from Pakistan. I've embarked on a journey into the world of front-end development, and I've already acquired skills in HTML and CSS, with a budding understanding of JavaScript. Currently, I'm actively engaged in the Scrimba front-end development career path.

Despite my enthusiasm for learning, I've never been part of an online community before. Today, I've taken the step to break the ice and seek your valuable advice on how to further my mastery of JavaScript. Your insights and guidance would be greatly appreciated!"
#FrontEnd#WebDevelopment
#HTML
#CSS
#JavaScript
#UI
#UX
#ResponsiveDesign
#WebDesign
#FrontEndDev
#Code
#DesignInspiration
#CodeNewbie
#DevCommunity
#WebDev
#Programming
#UserExperience
#WebDesigner
#CSS3
I need the opinions of developers who have worked with Korean companies and projects.
Tags: webdev, programming, devops, html
Published: 2023-09-25 05:55:41

I would like to request a brief survey from those who have experience working with overseas companies and projects.  
We are looking for freelance developers who want to participate in a project for Korean companies and generate higher profits. 
We are a team dedicated to creating a service that connects IT companies in South Korea with developers from around the world. 
If you're interested in participating in Korean IT projects regardless of language, age, gender, or nationality, please answer a few questions in the survey below. 
Your feedback will help us improve our service to provide better hiring opportunities for developers  If possible, please submit the survey through the link below.

Survey Link : https://forms.gle/rN42fGp3691Ft4BbA
🌲Svelte + 🍃Leaflet + 📍 Clusters
Tags: svelte, leaflet, javascript, sveltekit
Published: 2023-09-25 05:37:49

For a personal project, I had to use [Leaflet](https://leafletjs.com/) with [Svelte](https://svelte.dev/), and I faced some problems during development.

In this article, I will list each point that required finding a solution.

## Integrating Leaflet into a SvelteKit project

I highly recommend that you read the article [Using Leaflet with SvelteKit](https://dev.to/khromov/using-leaflet-with-sveltekit-3jn1) written by [Stanislav Khromov](https://dev.to/khromov).

He explains an effective way to add **Leaflet** to a project made with SvelteKit. It was my starting point in my project.

## Install Leaflet.markercluster plugin

You can retrieve this plugin from its official repo on Github : [Leaflet.markercluster](https://github.com/Leaflet/Leaflet.markercluster).

I used npm to add it to my project.

```bash
npm install leaflet.markercluster
```
Now, it needs to be integrated into the code of the file `LeafletMap.svelte`.

```javascript
onMount(async () => {
	if (browser) {
		const leaflet = await import('leaflet');
		const { MarkerClusterGroup }: any = await import('leaflet.markercluster');
```
Afterwards, we can declare the variable lower in the file, and add each marker to the `markers` element. Finally, add all the markers to the map.

```javascript
// L.MarkerClusterGroup extends L.FeatureGroup
// by clustering the markers contained within
let markers = new MarkerClusterGroup();

// create feature group
// for each marker, add it to markers
markers.addLayer(marker);

// Add all markers to map
map.addLayer(markers);
```
Of course, don’t forget to add the CSS style.

```css
@import 'leaflet.markercluster/dist/MarkerCluster.Default.css';
```
## Bug of icons in production environment

The Leaflet framework can give an error once the project is deployed, the path to the icon causes a 404 (not found) error. To remedy this, one of the solutions is to manually define the icon with an image available in the project’s `assets`.

```javascript
const iconRetinaUrl = './images/leaflet/marker-icon-2x.png';
const iconUrl = './images/leaflet/marker-icon.png';
const shadowUrl = './images/leaflet/marker-shadow.png';
const iconDefault = leaflet.icon({
	iconRetinaUrl,
	iconUrl,
	shadowUrl,
	iconSize: [25, 41],
	iconAnchor: [12, 41],
	popupAnchor: [1, -34],
	tooltipAnchor: [16, -28],
	shadowSize: [41, 41]
});
```
Afterwards, you need to use the `iconDefault` variable in the marker definition, for example:

```javascript
leaflet.marker(coords, {
	icon: iconDefault
})
```
By using the `iconDefault` variable in the marker definition, you can ensure that all markers use the same default icon.

Et voilà :tada:

These are the only errors I had to correct during my development, I hope this article will be useful to you.
Безопасность - ответственность каждого
Tags: egov, security
Published: 2023-09-25 05:30:35

Хочу рассказать об одной уязвимости на нашем egov.kz.
В 2021 году в рамках проведения интеграций выявил, что данные касательно оружия, перевозки взрывчатых веществ лежат в открытом доступе.
Если вкратце,
1) любой человек мог бы скачать документы у кого, где и какое оружие хранится.
Вот такие вот бумажки:


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/efqdf27ngphqivy16nlk.png)

Доступные данные: Какое оружие, ну и адрес где оно хранится.

Хочу заметить, что был доступен список не только физлиц, но и также всяких юрлиц, типа охранных организаций, тиров и т.д.

2) Ну и для примера, еще были такие документы:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/epfyyupvdtm0u8ooic64.png)


Ну надеюсь этот мерседес с взрывчаткой и детонаторами там больше не проезжает.


Наверное не нужно объяснять абсурдность выставления этих данных на всеобщее обозрение. Также хочу сказать, кажется до сентября 2021 года, если ты получил эти данные, то это было законно. Нормативку поменяли позже, а как вы знаете закон обратной силы не имеет.

## Как это все потом закрыли

Вообще это было первое официальное взаимодейтсвие с КИБ. После написания письма туда, я две недели наблюдал как его туда сюда футболили. Прошло время, я даже забыл про это. Ну ладно, если им нет интереса, то мне какое дело. После на одном мероприятии встретился со своим хорошим знакомым из силовых ведомств. Там у него был выход на людей то ли из КНБ, то ли из ГТС. Хватило одного звонка, и только на следующий день, после обеда ко мне позвонили с КИБа с претензией, что данные указанные в письме были неверны. Пришлось ответить, ну если так считаете, у меня вопросов нет. Потом через некоторое время, не сразу, а через несколько недель, все-таки данные скрыли в рамках изменения нормативки.

## Почему сейчас поднимаю эту тему

На прошлой неделе был в Алматы. Меня попросили посмотреть данные с одного госсайта, и там тоже грубые ошибки по безопасности. Я уверен, что и эта система, да и весь егов проходил у нас аттестацию по ИБ от ГТС, но все равно есть моменты по безопасности. И относительно грубые. Ну если бы такие проблемы были на какой-нибудь частной системе, то наказание было бы моментальным. Думаю, что после переписки с КИБом, озвучу ошибку.

**_К чему все это - прохождение аттестации/тестирования на ИБ, не всегда обеспечивает ИБ. ИБ - это постоянный процесс, ответственность каждого. Не только разработчиков, админов, девопсов. Это ответственность - аналитиков, службы кадров, бухгалтерии, даже людей, которые делают уборку. Тестирование на ИБ от сертифицированных лабораторий может выявить какие-то стандартные вещи, а нестандартные - они не выявляемы._**


## PS

Ну и если кому-то интересно, само письмо. По тексту можно понять насколько все было открыто.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rdqnt6lc17fo3ywt8xp6.png)
Empowering Safety: The Domestic Violence Registry in New Jersey
Published: 2023-09-25 05:14:55

The Domestic Violence Registry in New Jersey is a vital tool in the state's commitment to protecting individuals from domestic abuse. This centralised database tracks and documents individuals convicted of domestic violence offences, ensuring that victims receive necessary safeguards and support. It compiles records of convictions, providing essential information for law enforcement agencies, courts, and relevant authorities. Strict privacy measures are in place, limiting access to authorised personnel. Continually updated, the registry remains a reliable resource for authorities working to protect victims and hold perpetrators accountable for their actions in New Jersey.
Visit us : https://srislaw.com/domestic-violence-registry-new-jersey/
The Future of Supply Chain Management
Tags: webdev, blockchain, supplychain, web3
Published: 2023-09-25 05:10:18

The Future of Supply Chain Management:

Blockchain technology has the potential to revolutionize supply chain management. By providing a secure and transparent way to track the movement of goods, blockchain can help businesses to reduce costs, improve efficiency, and increase customer satisfaction.

Here are a few ways that blockchain is being used to improve supply chain management today:

* **Tracking the movement of goods:** Blockchain can be used to track the movement of goods from raw materials to finished products. This can help businesses to identify bottlenecks in their supply chain and make necessary adjustments.
* **Ensuring product quality and safety:** Blockchain can be used to track the quality and safety of products throughout the supply chain. This can help businesses to identify and recall contaminated or defective products quickly and efficiently.
* **Reducing fraud and counterfeiting:** Blockchain can be used to create a tamper-proof record of all transactions in a supply chain. This can help businesses to reduce fraud and counterfeiting, and protect their brand reputation.
* **Improving efficiency:** Blockchain can help businesses to improve the efficiency of their supply chain by automating tasks such as order processing and payment.

Blockchain technology is still in its early stages of development, but it has the potential to revolutionize supply chain management. As blockchain continues to develop and become more widely adopted, we can expect to see even more innovative and effective ways to use blockchain to improve the efficiency, transparency, and security of supply chains.
Electrical Testing
Tags: electricalsystem
Published: 2023-09-25 05:06:51

Reliable, efficient, & safe Electrical Service Company in Singapore thru years of providing effective electrical consultation, testing & licensing services

VISIT OUR WEBSITE - [Electrical Testing](https://www.resengrg.com/about-us)

RES Engineering Services is able to provide the following services

 Renew / Apply for the yearly EMA Electrical Installation License (400V & 22kV)
 Renew / Apply for EMA Supply Installation License (Temporary Site Generator)
 Lightning Protection & Earthing Design / Endorsement
 Electrical Site Testing
 Electrical Preventive and Predictive Maintenance
 Electrical System Study Using ETAP / VipCode
 Electrical Safety Training
 Electrical QP Services
 Project LEW
 Training for LEW Preparation Course
 Partial Discharge Measurement
 Infrared Thermography
 Power Quality & Data Logging


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sbbbwhkvmaoyt2i7ban1.jpg)
Demystifying Laravel Design Patterns: Building Robust Applications
Tags: laravel, designpatterns, applications, tutorial
Published: 2023-09-25 04:45:23

When it comes to building robust and maintainable web applications, choosing the right design patterns can make a world of difference. Laravel, one of the most popular PHP web frameworks, not only simplifies web development but also encourages the use of design patterns to ensure code readability, scalability, and maintainability.

In this blog post, we'll delve into some of the key design patterns in Laravel and explore how they can help you create elegant and efficient applications.


**Factory Method Pattern**

The Factory Method pattern in Laravel allows you to define an interface for creating objects, but it lets subclasses alter the type of objects that will be created. This is particularly useful when you have multiple classes that share a common interface but need to instantiate different concrete implementations based on the context.


**Singleton Pattern**

The Singleton pattern ensures that a class has only one instance while providing a global point of access to that instance. In Laravel, the Service Container acts as a Singleton and manages instances of various services. This pattern helps maintain a single point of configuration and ensures efficient resource usage.


**Repository Pattern**

The Repository pattern in Laravel abstracts the data access layer, providing a clean and consistent way to interact with your data. By separating database queries and data manipulation from the rest of your application, you can easily switch between different data sources, such as databases or external APIs, without affecting your core logic.


**Dependency Injection**

Laravel's built-in dependency injection container allows you to inject dependencies into your classes, rather than having them create their dependencies themselves. This promotes a more modular and testable codebase, as well as reducing tight coupling between components.


**Observer Pattern**

The Observer pattern in Laravel is implemented through its event system. It enables classes to subscribe to and listen for events, allowing for loose coupling between different parts of your application. When something significant happens, events are fired, and the appropriate observers are notified, making your application more flexible and extensible.


Laravel's embrace of design patterns contributes significantly to its popularity among web developers. By incorporating these patterns into your Laravel applications, you can build software that is not only robust but also easier to maintain and extend.

Using these design patterns in Laravel is a smart approach to writing clean, organized, and scalable code. As you continue to explore Laravel and design patterns, remember to refer to the images provided above for a visual representation of these concepts.

Incorporate these design patterns into your Laravel projects, and you'll be well on your way to creating web applications that are not only powerful but also maintainable and adaptable to future changes. **Happy coding!**
How To Integrate Paypal Payment Gateway In Laravel 10
Tags: laravel, php, paypal, integration
Published: 2023-09-25 04:19:19

As a Laravel 10 developer, I understand the importance of providing a secure and user-friendly payment experience for online businesses. 

That's why integrating a reliable payment gateway like PayPal into your Laravel 10 application can be a game-changer. 

If you're looking to integrate PayPal into your Laravel 10 project, you're in the right place.

In this comprehensive guide, I will walk you through the step-by-step process of integrating the PayPal payment gateway into your Laravel 10 application. 

Together, we'll cover all the necessary steps, from setting up a PayPal Business account to implementing the payment functionality within your Laravel codebase.

By the end of this tutorial, you'll have a solid understanding of how to harness the power of Laravel's features and seamlessly integrate PayPal's API for secure and efficient payment processing in your application.

PayPal is an American company operating a worldwide online payments system that supports online money transfers and serves as an electronic alternative to traditional paper methods like checks and money orders.

So, let's dive right in and discover the incredible potential of PayPal integration in Laravel 10.
First post
Tags: technology
Published: 2023-09-25 04:18:35

This is a test post.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sgtxlgb6sbvwp9rowshr.jpg)

This is a next paragraph.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6ymelnxp25w4f61x47sa.png)
Nội thất
Tags: webdev, beginners, tutorial, programming
Published: 2023-09-25 04:17:59

Mua bán Thiết kế thi công, nội thất, noi that giá tốt nhất. noithat.info.vn - Website thương mại điện tử hàng đầu tại Việt Nam, cung cấp hàng trăm nghìn sản phẩm từ hàng nghìn nhà cung cấp khác nhau. Mua nội thất trang trí cho căn nhà hay văn phòng công sở bạn sẽ phân vân lựa chọn địa chỉ cung cấp những sản phẩm nội thất chất lượng nhất, hiện đại nhất, có sự đa dạng về hình dáng, màu sắc, chủng loại

Địa chỉ : TPHCM , Việt Nam

https://noithat.info.vn/

https://dichvu.info.vn/blog/

https://gialai.info.vn/blog/

https://backlink.info.vn/category/blog/
What is STLC? List all stages of STLC.
Published: 2023-09-25 04:13:45

The **Software Testing Life Cycle** (STLC) is a systematic approach to testing a software application to ensure that it meets the requirements and is free of defects. It is a process that follows a series of steps or phases, and each phase has specific objectives and deliverables. The STLC is used to ensure that the software is of high quality, reliable, and meets the needs of the end-users.	
**<u>Phases of STLC</u>**
**Requirement Analysis**: Requirement Analysis is the first step of the Software Testing Life Cycle (STLC). In this phase quality assurance team understands the requirements like what is to be tested.  
Creating a requirement traceability matrix (RTM) to map requirements to test cases
At the end of this stage, the testing team should have a clear understanding of the software requirements and should have identified any potential issues that may impact the testing process. 
**Test Planning**: Test Planning is the phase where all testing plans are defined. In this phase, team lead and team calculate the estimated effort and cost for the testing work. At the end of this stage, the testing team should have a detailed plan for the testing activities and a clear understanding of the testing objectives, scope, and deliverables. 
**Test Case Development**: The test case development phase gets started once the test planning phase is completed. In this phase testing team notes down the detailed test cases. The testing team also prepares the required test data for the testing. When the test cases are prepared then they are reviewed by the quality assurance team.
**Test Environment Setup**: Test environment setup is a vital part of the STLC. Basically, the test environment decides the conditions on which software is tested. This is independent activity and can be started along with test case development. In this process, the testing team is not involved. either the developer or the customer creates the testing environment.
**Test Execution**: After the test case development and test environment setup test execution phase gets started. In this phase testing team starts executing test cases based on prepared test cases in the earlier step.
The activities that take place during the test execution stage of the Software Testing Life Cycle (STLC) include:
**•	Test execution
•	Defect logging
•	Test data preparation
•	Test environment setup
•	Test execution
•	Test result analysis
•	Defect retesting
•	Test Reporting**

**Test Closure**: Test closure is the final stage of the Software Testing Life Cycle (STLC) where all testing-related activities are completed and documented. The main objective of the test closure stage is to ensure that all testing-related activities have been completed and that the software is ready for release.
Test closure is the final stage of the Software Testing Life Cycle (STLC) where all testing-related activities are completed and documented. The main activities in test closure stage include:
**•	Test summary report
•	Defect tracking
•	Test environment clean-up
•	Test closure report
•	Knowledge transfer
•	Feedback and improvements**