home / django_tickets / tickets

tickets: 6233

This data as json

id created changetime last_pulled_from_trac stage status component type severity version resolution summary description owner reporter keywords easy has_patch needs_better_patch needs_tests needs_docs ui_ux
6233 2007-12-18 00:22:39 2013-03-15 10:10:56 2022-03-06 03:36:34.906585 Accepted closed Core (Serialization) Bug Normal 0.96 duplicate fixture fails to load on inet field Using the admin interface I entered a couple of records for my model. {{{ class TugInstance(models.Model): """This class represents a single instance of TUG in the multi-instance case.""" enabled = models.BooleanField(default=False) public_ip = models.IPAddressField(unique=True) wan_ip = models.IPAddressField(unique=True, blank=True, null=True) lan_ip = models.IPAddressField(unique=True) ready_for_calls = models.BooleanField(default=True) calls_in_progress = models.PositiveIntegerField() default_icp = models.ForeignKey(Icp) def __str__(self): return str(self.id) class Admin: pass }}} I am using postgresql-7.4.13-2.RHEL4.1 on CentOS 4.4. I used the json serializer to dump json format of these records. {{{ [root@vmware-espresso teleworker]# cat sample_data.json [{"pk": "1", "model": "top.tuginstance", "fields": {"default_icp": 1, "wan_ip": "", "ready_for_calls": true, "lan_ip": "192.168.1.55", "enabled": true, "public_ip": "216.191.234.111", "calls_in_progress": 5}}, {"pk": "2", "model": "top.tuginstance", "fields": {"default_icp": 2, "wan_ip": "216.191.234.112", "ready_for_calls": true, "lan_ip": "10.33.15.145", "enabled": false, "public_ip": "216.191.234.112", "calls_in_progress": 0}}] }}} I then cleared the table manually, and tried to load this json as a fixture. {{{ [root@vmware-espresso teleworker]# python manage.py --pythonpath=.. loaddata sample_data.json Loading 'sample_data.json' fixtures... Installing json fixture 'sample_data' from absolute path. Problem installing fixture 'sample_data.json': invalid input syntax for type inet: "" }}} Seems that there are issues translating the json to sql that postgres will accept. nobody Michael P. Soulier <msoulier@digitaltorque.ca>   0 0 0 0 0 0
Powered by Datasette · Queries took 12.005ms