Skip to content

Commit

Permalink
BRITECLAIM-1031 Update BriteEAV readme
Browse files Browse the repository at this point in the history
  • Loading branch information
iamanikeev authored and Shend Çarkaxhiu committed May 28, 2019
1 parent 1ca033a commit 727fcd4
Showing 1 changed file with 48 additions and 9 deletions.
57 changes: 48 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,44 @@
# BriteEAV - entity-attribute-value storage for Django

This repository is based on a [django-eav2](https://github.com/makimo/django-eav2) package. It provides an ability to
have unknown amount of fields for a Django model without having to change code when adding new fields.
Full description could be found in original library's `README`. This version has some significant changes that adopt the
library for BriteCore needs, therefore we have our own fork.
# BriteEAV. Entity-Attribute-Value storage for Django.

![CodeBuild](https://codebuild.us-east-1.amazonaws.com/badges?uuid=eyJlbmNyeXB0ZWREYXRhIjoic1V5K0RzemZ0ZE1JbDNlS0tYUFBoSlRrN0RlNkhMTzMyRzVzOXIwVHQyM25LNVpOdWFmRERMT3NSSXZGLzQ1RTR1eWJXaFNhUTBlZFZJZGhWdVJHTWlZPSIsIml2UGFyYW1ldGVyU3BlYyI6InV6aW9IQ3BoMTJTN2F0blMiLCJtYXRlcmlhbFNldFNlcmlhbCI6MX0%3D&branch=master) [![codecov](https://codecov.io/gh/IntuitiveWebSolutions/BriteEav/branch/master/graph/badge.svg?token=Ja81TG1179)](https://codecov.io/gh/IntuitiveWebSolutions/BriteEav)

BriteEAV provides an ability to have unknown amount of fields for a Django model without having to change code when adding new fields.

# Contacts

| Name | Role | Username |
|-------------------|-------------------|-------------------|
| Kujtim Hoxha | System Architect | @kujtimiihoxha |
| Shend Carkaxhiu | Lead Engineer | @shendcarkaxhiu |
| Ferdi Bejtullahu | Lead Engineer | @ferdibejtullahu |
| Agon Gjonbalaj | Software Engineer | @agonix |
| Albert Hoxha | Software Engineer | @alberthoxha97 |
| Alexander Anikeev | Software Engineer | @iamanikeev |
| Erzen Komoni | Software Engineer | @erzenkomoni |
| Rexhep Berlajolli | Software Engineer | @rexhepberlajolli |


# Communication
Relevant Slack channels to join:

- `#pd-claims-int`
- `#pd-claims-ext`
- `#pd-claims-eng-int`
- `#pd-claims-cloud-int`
- `#pd-claims-gh-int`

# Additional information

This repository is based on a [django-eav2](https://github.com/makimo/django-eav2) package. Full description could be found in original library's `README`.
This version has some significant changes that adopt the library for BriteCore needs, therefore we have our own fork.

# Installation

Add corresponding requirement to your `requirements.txt`, or just install with `pip`:

pip install brite_eav

# Usage
# Getting started

## Registration

Expand Down Expand Up @@ -112,8 +139,20 @@ These `kwargs` are being passed to corresponding serializer field when EAV attri
Consider there is a following attribute attached to the model container `Attribute(name="short_string", datatype=Attribute.TYPE_TEXT, kwargs={"max_length": 2})`.
Then passing `short_string` with more then 3 characters will raise a validation error on serializer.

# Repository best practices

- Since it's a django package that is supposed to affect data model, always check the model changes by
running `manage.py makemigrations` and `manage.py migrate` in order to make sure that tour changes result
in correct migration. There is a dummy settings file at `tests.test_settings` that imitate Django app using EAV.
Migrations should not be committed go version control.
- After committing the changes in pull request, run `bumpversion patch` to add a new release.
It will automatically change corresponding version files.
- Cover new changes with tests and add regression test cases when bugs get fixed.


# Other notes

# What is changed in BriteCore version of Django-EAV
## What is changed in BriteCore version of Django-EAV

- Since we use `UUID` as primary keys, `Value` model has been modified to store generic relations as `UUID` fields.
- Introduced the concept of EAV containers. Containers are models that define what fields are available for a particular
Expand All @@ -126,7 +165,7 @@ to `urlconf`.
- Tests refactored to use `Pytest`.


# Testing
## Testing

Tests could be ran by the following command:

Expand Down

0 comments on commit 727fcd4

Please sign in to comment.