semvec/pypi-packages huggingface dataset:
django-readedit-switch-admin 0.4.8
Read item detail first, and click the Edit switch button to turn to edit view.
License: MIT
Keywords: django admin extentions, django readedit switch admin

# django-readedit-switch-admin

Read item detail first, and click the Edit switch button to turn to edit view.


## Install

```shell
pip install django-readedit-switch-admin
```

## Usage

**pro/settings.py**

```python

INSTALLED_APPS = [
    ...
    'django_readedit_switch_admin',
    ...
]
```

**app/admin.py**

```python
from django.contrib import admin
from .models import Category
from .models import Book

from django_readedit_switch_admin.admin import DjangoReadEditSwitchAdmin


class BookInline(admin.TabularInline):
    model = Book

class CategoryAdmin(DjangoReadEditSwitchAdmin, admin.ModelAdmin):
    list_display = ["pk", "name"]
    list_editable = ["name"]
    inlines = [
        BookInline
    ]

admin.site.register(Category, CategoryAdmin)

```

## Releases

### v0.1.0

- First release.

### v0.1.1

- Fix add/change/delete permission problem in changelist view. Changelist view should obey the real permission.

### v0.1.2

- Don't check is_edit_view in getting add and delete permissions.

### v0.2.0

- App rename to django_readedit_switch_admin.

### v0.3.0

- Fix django_readedit_switch_admin.apps' verbose_name.
- Rename DjangoReadEditSwitchAdminMixin to DjangoReadEditSwitchAdmin. It's NOT good to add mixin suffix.

### v0.4.0

- Rename django_readedit_switch_admin.html to change_form.html, so that it can be override by other applications.

### v0.4.1

- Fix problem for all NONE DjangoReadeditSwitchAdmins.

### v0.4.2

- Fix block.super spell mistake.

### v0.4.3

- Use jquery.js shipped with django, and control js loading order.

### v0.4.4

- Fix edit problem with _changelist_filters.

### v0.4.5

- Fix has_add_permission problem.
- Test in Django 3.2.

### v0.4.6

- Doc update.

### v0.4.7

- Fix js error in latest django versions.

### v0.4.8

- doc update.
django-toggle-switch-widget 0.1.4
Display toggle switch in stead of checkbox for BooleanField in django admin site.
License: MIT
Keywords: django admin extentions, django toggle switch widget

# django-toggle-switch-widget

Display toggle switch in stead of checkbox for BooleanField in django admin site.

## Install

```shell
pip install django-toggle-switch-widget
```

## Widget init parameters

- attrs: Inherit from CheckboxInput.
- check_test: Inherit from CheckboxInput.
- round: Default to False. If round=True, display round switch. If round=False, display squire switch.
- klass: Default to empty string "". Pre-setted klass are:
    - django-toggle-switch-success: Show success color (green, #06ad3d) while toggle on.
    - django-toggle-switch-warning: Show warning color (orange, #ff6a00) while toggle on.
    - django-toggle-switch-danger: Show danger color (red, #ba2121) while toggle on.
    - django-toggle-switch-dark-primary: Show dark primary color (darkcyan, #417690) while toggle on.
    - django-toggle-switch-primary: Show primary color (cadetblue, #79aec8) while toggle on.

## Usage

**pro/settings.py**

```python
INSTALLED_APPS = [
    ...
    'django_toggle_switch_widget',
    ...
]
```

**app/model.py**

```python
from django.db import models

class TestModel(models.Model):
    title = models.CharField(max_length=64, help_text="Please input model title.")
    published = models.BooleanField(verbose_name="Is this test model published.")
    is_demo = models.BooleanField(help_text="Is this a demo test model?")

```

**app/admin.py**

```python
from django.contrib import admin
from django.forms import ModelForm
from django_toggle_switch_widget.widgets import DjangoToggleSwitchWidget
from .models import TestModel

class TestModelForm(ModelForm):
    class Meta:
        model = TestModel
        fields = "__all__"
        widgets = {
            "published": DjangoToggleSwitchWidget(klass="django-toggle-switch-dark-primary"),
            "is_demo": DjangoToggleSwitchWidget(round=True, klass="django-toggle-switch-success"),
        }

class TestModeldmin(admin.ModelAdmin):
    form = TestModelForm

admin.site.register(TestModel, TestModeldmin)

```

## Tips

- It's better to use together with django-checkbox-normalize app.

## Release


### v0.1.0 2020/03/02

- First release.

### v0.1.1 2020/09/09

- Add License.

### v0.1.3 2023/09/15

- Doc update.

### v0.1.4 2025/10/27

- Doc update.
random-useless-facts 1.0.3
A Python package that returns random useless facts. So useless in fact that it's actually usefull.
License: MIT
Requires Python: >=3.7

# Useless Facts

A Python package that returns random useless facts to brighten your day! 🎉

With over **500+ useless facts** across 5 categories, you'll never run out of entertaining trivia!

## Installation

You can install the package using pip:

```bash
pip install useless-facts
```

## Usage

### Basic Usage

```python
from useless_facts import get_random_fact

# Get a random fact
fact = get_random_fact()
print(fact)
# Output: "A group of flamingos is called a 'flamboyance'."
```

### Get Facts by Category

```python
from useless_facts import get_random_fact, get_fact_by_category, get_categories

# Get a random fact from a specific category
animal_fact = get_random_fact("animals")
print(animal_fact)
# Output: "Octopuses have three hearts and blue blood."

# Get all facts from a category
all_animal_facts = get_fact_by_category("animals")
print(all_animal_facts)

# Get all available categories
categories = get_categories()
print(categories)
# Output: ['animals', 'science', 'history', 'food', 'random']
```

### Advanced Usage

```python
from useless_facts import get_all_facts, get_fact_count

# Get all facts organized by category
all_facts = get_all_facts()
print(all_facts)

# Get the total number of facts
total_facts = get_fact_count()
print(f"Total facts available: {total_facts}")
```

## Available Categories

- **animals**: Facts about animals and wildlife
- **science**: Scientific facts and discoveries
- **history**: Historical facts and events
- **food**: Food-related facts and trivia
- **random**: Miscellaneous interesting facts

## API Reference

### Functions

- `get_random_fact(category=None)`: Get a random fact from all categories or a specific category
- `get_all_facts()`: Get all facts organized by category
- `get_fact_by_category(category)`: Get all facts from a specific category
- `get_categories()`: Get all available categories
- `get_fact_count()`: Get the total number of facts

## Examples

```python
import useless_facts

# Get a random fact
print(useless_facts.get_random_fact())

# Get a science fact
print(useless_facts.get_random_fact("science"))

# Get all animal facts
animal_facts = useless_facts.get_fact_by_category("animals")
for fact in animal_facts:
    print(fact)
```

## Development

To install the package in development mode:

```bash
git clone https://github.com/yourusername/useless-facts.git
cd useless-facts
pip install -e .
```

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

## License

This project is licensed under the MIT License - see the LICENSE file for details.

## Changelog

### 1.0.0
- Initial release
- Added 500+ useless facts across 5 categories
- Basic API for accessing facts
- 102 animal facts
- 100 science facts
- 98 history facts
- 103 food facts
- 102 random facts