semvec/pypi-packages huggingface dataset:
django-admin-item-owner 0.2.0
Model item always has an owner, and login user can only see owned items.
License: MIT
Keywords: django-admin-item-owner

# django-admin-item-owner

Model item always has an owner, and login user can only see owned items.

## Goal

- Set item's owner to current user automatically.

## Install

```bash
pip install django-admin-item-owner
```

## Settings

```python

INSTALLED_APPS = [
    ....
    'django_global_request',
    'item_owner',
    ...
]

MIDDLEWARE = [
    ...
    'django_global_request.middleware.GlobalRequestMiddleware',
    ...
]
```

## Example

example/models.py

```python
from django.db import models
from item_owner.models import ItemOwnerMixin
from item_owner.models import ItemShareMixin

class Category(ItemOwnerMixin, models.Model):
    title = models.CharField(max_length=32)

    def __str__(self):
        return self.title

class Book(ItemOwnerMixin, ItemShareMixin, models.Model):
    category = models.ForeignKey(Category, on_delete=models.SET_NULL, null=True, blank=True, related_name="books")
    title = models.CharField(max_length=32)

    def __str__(self):
        return self.title

```

example/admin.py


```python
from django.contrib import admin
from django import forms
from item_owner.admin import ItemOwnerMixin
from item_owner.admin import ItemShareMixin
from .models import Category
from .models import Book



class BookInline(ItemOwnerMixin, ItemShareMixin, admin.TabularInline):
    model = Book

class CategoryAdmin(ItemOwnerMixin, admin.ModelAdmin):
    list_display = ["title"]
    inlines = [
        BookInline,
    ]

class BookAdmin(ItemOwnerMixin, ItemShareMixin, admin.ModelAdmin):
    list_display = ["title"]

admin.site.register(Category, CategoryAdmin)
admin.site.register(Book, BookAdmin)

```

## Releases

### v0.2.0 2020-01-08

- Add ItemShareMixin for models and admins.

### v0.1.0 2019-12-01

- First release.
jokettt 1.0.0
A Tic Tac Toe game developed by joke
License: MIT
Requires Python: >=3.6

# JokeTTT: a Tic Tac Toe game developed by joke

JokeTTT is a library providing tic tac toe structures useful to develop games based on several kind of players.
It was developed just for fun and to learn Python and some concepts of machine learning.

## Project setup

The project has been tested only with python3 on Ubuntu Linux. If you have python3 installed in your machine, just install the package with the usual ```pip``` command.

To avoid the usual problems with messy Python configurations (python 2 vs. 3, packages to install, etc.), conda is used for development.

For those that wants to do the same and does not know conda, this is a a quick reference:

- [TDHopper article on python environment with conda]
- [Get your computer ready for machine learning using *conda]

If you have conda installed, enter the project directory (the one with the environment.yml file) and enter the following command:

```bash
conda env create
```

This shall be done only the one time. After this the ```jokettt``` conda environment is created. It can be activated with the command:

```bash
conda activate jokettt
```

To update the conda environment every time that the ```environment.yml``` is changed, enter the command:

```bash
conda env update
```

## Demo programs

For example of simple applications that uses the jokettt classes, see the [jokettt_demo] repository.

## Credits

- A.L. Aradhya [Minimax introduction article] (and all the following) in geeksforgeeks.org for implementation of the minimax player
- T. Simonini "[An introduction to reinforcement learning]" for introduction theory on value function and for directing me to the Sutton and Barto book.

[TDHopper article on python environment with conda]: https://tdhopper.com/blog/my-python-environment-workflow-with-conda/
[Get your computer ready for machine learning using *conda]: https://towardsdatascience.com/get-your-computer-ready-for-machine-learning-how-what-and-why-you-should-use-anaconda-miniconda-d213444f36d6
[Minimax introduction article]: https://www.geeksforgeeks.org/minimax-algorithm-in-game-theory-set-1-introduction/
[An introduction to reinforcement learning]: https://medium.com/free-code-camp/an-introduction-to-reinforcement-learning-4339519de419

[jokettt_demo]: https://github.com/fpiantini/jokettt_demo