Django Database Engine for Filemaker using pyodbc
Project description
#django-filemaker-pyodbc
##A Django Custom Database Engine that works with Filemaker using pyodbc.
###Initial components derived from https://github.com/lionheart/django-pyodbc. Using that package as a guide was very helpful.
####Use with a little caution as some functions in some components are expecting a MS-SQL backend. Those will be changed in due course as needed. Pull requests welcome.
####Note that NO testing has been done as yet on migrations. Our first use case was talking to an existing filemaker solution.
Example model. Note managed = False
and db_table
must match the table object name in the Filemaker Relationship Graph window.
\# -*- coding: utf-8 -*-
from \_\_future\_\_ import unicode_literals
from django.db import models
class Depot(models.Model):
id = models.IntegerField(primary_key=True,help_text='id',db_column='id')
uuid = models.UUIDField(null=True,blank=True,help_text='uuid',db_column='uuid',db_index=True,unique=True)
name = models.CharField(max_length=1024,null=True,help_text='134.13',db_column='depot_name',db_index=True)
filemaker_base_table_id = 134
def __str__(self):
return '%s id: %d' % (self.name, self.id)
class Meta:
db_table = 'depot'
managed = False
verbose_name = 'Depot'
verbose_name_plural = 'DepotList'
To use.
-
pip install django-filemaker-pyodbc
-
Create an odbc connection to the Filemaker solution and test that the credentials work.
-
Add references to the Filemaker odbc library that unixodbc can see.
Example content within
/usr/local/etc/odbcinst.ini
[filemaker]
Driver = /Library/ODBC/FileMaker ODBC.bundle/Contents/MacOS/fmodbc.so
DriverManagerEncoding=UTF-16
Setup =
To find where the settings are for unixodbc try
odbcinst -j
-
Add your connection details to your settings.py file.
DATABASES = {
'default': {
'ENGINE': 'django_filemaker_pyodbc',
'HOST': 'fully qualified domain or ip address',
'PORT': '2399',
'USER': 'filemaker user account with odbc/jdbc permissions',
'PASSWORD': '********',
'NAME': 'filemaker file name without the extension - preferably without spaces',
'OPTIONS' : {
'driver' : 'filemaker',
'driver_supports_utf8' : True,
},
}
}
Filemaker SQL is a partial implementation of SQL 92 See Filemaker 16 SQL Reference for more details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for django-filemaker-pyodbc-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9595fac212b2dc179ab24e021dc7b89fbc201bb83bd9f541a2102adb28c34d90 |
|
MD5 | 645809a7d8d602f838b405b60ecbb23f |
|
BLAKE2b-256 | 2b447cf928dcdfc48ea28df7b7d8c814fcb81434487877e66c3c52a7bbc79f27 |
Hashes for django_filemaker_pyodbc-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 26a80bcdc37a74a3766bfb255cfdbe8967612dbd77fb72ba416623690e589d2f |
|
MD5 | 883098da8a22b17144a880ede12af8b6 |
|
BLAKE2b-256 | cb3a2c340872e176ed63f9a49643d8d9a286ea3c4b6d0273bc203752dd1d3a63 |