Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vallemrv/python-ormsqlite
Es una orm simple. Con modelos JSON o con modelos derivados de Models.
https://github.com/vallemrv/python-ormsqlite
kivy orm-library python
Last synced: 5 days ago
JSON representation
Es una orm simple. Con modelos JSON o con modelos derivados de Models.
- Host: GitHub
- URL: https://github.com/vallemrv/python-ormsqlite
- Owner: vallemrv
- License: apache-2.0
- Created: 2017-06-11T13:58:01.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-05-03T15:22:05.000Z (over 4 years ago)
- Last Synced: 2024-10-15T06:41:18.773Z (22 days ago)
- Topics: kivy, orm-library, python
- Language: Python
- Homepage:
- Size: 164 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# python-ormsqlite
I've done it to work with kivy and android. It works great with mobile devices. For people who do not seek much complexity. It is simple but you can perform more or less complex queries. Create a model quickly in seconds. Just create the model and you can create JSON queries.
:package: Installation
-----------------------Install it via `pip`
`$ [sudo] pip install valleorm`
Or download zip and then install it by running
`$ [sudo] python setup.py install`
For kivy project only copy folder valleorm on root folder kivy project.
And create your models simply.Example from Class inheritance Models
-------------------------------------
```python
from valleorm.models import modelslass Musician(models.Model):
first_name = models.CharField(max_length=50)
last_name = models.CharField(max_length=50)
instrument = models.CharField(max_length=100)class Album(models.Model):
artist = models.ForeignKey(Musician, on_delete=models.CASCADE)
name = models.CharField(max_length=100)
release_date = models.DateField()
num_stars = models.IntegerField()m = Musician()
m.first_name = "Caracolo"
m.last_name = "tambolero"
m.instrument = "tambor"
m.save()a = Album()
a.name = "delicias"
a.release_date = datetime.datetime.now()
a.num_starts = 10m.album.add(m)
m = Musician.getByPk(1)
print(m.toJSON())als = m.album.get()
from a in als:
print(a.toJSON())
```
Condition example
-----------------```python
m = Musician.filter(first_name="caracolo")
m = Musician.filter(first_name__contain="ca")
m = Musician.filter(first_name__between=("caracolo", "picopato"))```
:yum: How to contribute
-----------------------Have an idea? Found a bug? [add a new issue](https://github.com/vallemrv/python-ormsqlite/issues) or
[fork] (https://github.com/vallemrv/orm-python-sqlite#fork-destination-box)
and sendme a pull request. Don't forget to add your name to the Contributors section of this document.:scroll: License
----------------Licensed under the Apache-2.0, see `LICENSE`
:heart_eyes: Contributors
--------------------------Manuel Rodriguez