Skip to content

Commit

Permalink
Merge branch 'master' into stable/2.2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
mariuz authored Dec 18, 2020
2 parents 8c96b6b + 6e2cb56 commit 486874a
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 8 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
- cron: '23 2 * * 0'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
language: [ 'python' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

steps:
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
8 changes: 4 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ Instructions for Ubuntu/Debian
I assume you have installed django from source with python setup.py install


cd /usr/local/lib/python2.7/dist-packages
cd /usr/local/lib/python3.8/dist-packages

sudo git clone git://github.com/maxirobaina/django-firebird.git

sudo ln -s django-firebird/firebird firebird

cd /usr/local/lib/python2.7/dist-packages/django/db/backends
cd /usr/local/lib/python3.8/dist-packages/django/db/backends

sudo ln -s /usr/local/lib/python2.7/dist-packages/django-firebird/firebird
sudo ln -s /usr/local/lib/python3.8/dist-packages/django-firebird/firebird

Configuration
-------------
Expand All @@ -74,7 +74,7 @@ Modify your setting.py ::
DATABASES = {
'default': {
'ENGINE' : 'firebird',
'NAME' : '/var/lib/firebird/2.5/data/django_firebird.fdb', # Path to database or db alias
'NAME' : '/var/lib/firebird/3.0/data/django_firebird.fdb', # Path to database or db alias
'USER' : 'SYSDBA', # Your db user
'PASSWORD' : '*****', # db user password
'HOST' : '127.0.0.1', # Your host machine
Expand Down
5 changes: 4 additions & 1 deletion firebird/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,10 @@ def convert_textfield_value(self, value, expression, connection, context):

def convert_binaryfield_value(self, value, expression, connection, context):
if value is not None:
value = force_bytes(value)
try:
value = force_bytes(value.read())
except:
value = force_bytes(value)
return value

def convert_booleanfield_value(self, value, expression, connection, context):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
url='https://github.com/maxirobaina/django-firebird',
packages=find_packages(),
classifiers=[
'Development Status :: 3 - Alpha',
'Development Status :: 2 - Pre-Alpha',
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
Expand Down
2 changes: 1 addition & 1 deletion tests/test_main/introspection/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from django.test.utils import ignore_warnings

import django
import mock
from unittest import mock

if (django.VERSION[0]==2 and django.VERSION[1] < 1) or django.VERSION[0] < 2:
# if django.version < 2.1
Expand Down
2 changes: 1 addition & 1 deletion tests/test_main/schema/tests.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import datetime
import itertools
import mock
from unittest import mock
import unittest
from copy import copy

Expand Down

0 comments on commit 486874a

Please sign in to comment.