Thanks for the response I can look at converting the fixtures to json of that would make it work.
I wouldn't contribute xml.support at this stage, the quality of my contribution would likely be poor. Sayth On 14/05/2014 4:24 pm, "Avraham Serour" <tovm...@gmail.com> wrote: > Fixtures are usually in json. Not sure if the is support for importing > fixtures in XML > In any case you can always parse them yourself and create the proper > objects > > Don't forget that this is an open source project, you can code XML support > and contribute > On May 13, 2014 10:40 PM, "Sayth Renshaw" <flebber.c...@gmail.com> wrote: > >> Can I ask for some assistance please. >> >> For my project I will need to upate the database from an external xml >> file consistently. The xml is like this one >> http://old.racingnsw.com.au/Site/_content/racebooks/20140515GOSF0.xml >> If i have create my model objects, most of which will have a direct >> correlation to the xml file, but there will be extra model objects and >> fields relating to user input. How can I do updates to my database via xml. >> >> There are 2 docs I have been reviewing >> https://docs.djangoproject.com/en/1.6/howto/initial-data/#providing-initial-data-with-fixturesand >> https://docs.djangoproject.com/en/1.6/topics/serialization/. >> >> The guides talk about creating a fixture but I am not sure it is >> appropriate exactly and I am unsure from the guide how I would setup a >> mapping so that the xml data went to the correct model object. >> How do I do this? >> >> Currently I have my model as. >> >> from django.db import models >> >> class Meeting(models.Model): >> location = models.ForeignKey(Venue) >> MeetingRace = models.ForeignKey(Race) >> meeting_id = models.IntegerField(8) >> meeting_date = models.DateField() >> rail = models.CharField(max_length=75) >> weather = models.CharField(max_length=10) >> trackcondition = models.CharField(max_length=15) >> >> class Venue(models.Model): >> NameVenue = models.CharField(max_length=50) >> FullNamevenue = models.CharField(max_length=70) >> ClubCode = models.IntegerFields(5) >> AssosciationClass = models.IntegerField(5) >> >> class Race(models.Model): >> RaceHorse = models.ForeignKey(Horse) >> RaceID = models.IntegerField(8) >> RaceNumber = models.IntegerField(3) >> RaceDivision = models.IntegerField(10) >> RaceName = models.CharField(max_length=80) >> RaceClass = models.CharField(max_length=20) >> RaceDistance = models.IntegerField(12) >> RaceMinWeight = models.IntegerField(3) >> RaceRaisedWeight = models.IntegerField(3) >> RaceAge = models.IntegerField(3) >> RaceGrade = models.IntegerField(3) >> RaceWeightCondition = models.CharField(max_length=80) >> # Check timing method, fastest, sectional >> #Review adding conditionals >> >> class Horse(models.Model): >> HorseTrainer = models.ForeignKey(Trainer) >> HorseJockey = models.ForeignKey(Jockey) >> HorseName = models.CharField(max_length=40) >> HorseID = models.IntegerField(10) >> HorseBlinkers = models.IntegerField(3) >> HorseBarrier = models.IntegerField(3) >> HorseWeight = models.IntegerField(3) >> HorseRating = models.IntegerField(3) >> >> Thanks >> >> Sayth >> HorseDescription = models.CharField(max_length=60) >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Django users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to django-users+unsubscr...@googlegroups.com. >> To post to this group, send email to django-users@googlegroups.com. >> Visit this group at http://groups.google.com/group/django-users. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/django-users/f8e008bf-1f0a-4a0a-a35c-04c59f9997f6%40googlegroups.com<https://groups.google.com/d/msgid/django-users/f8e008bf-1f0a-4a0a-a35c-04c59f9997f6%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > -- > You received this message because you are subscribed to a topic in the > Google Groups "Django users" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/django-users/TZ2GbmlVk1o/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > django-users+unsubscr...@googlegroups.com. > To post to this group, send email to django-users@googlegroups.com. > Visit this group at http://groups.google.com/group/django-users. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/CAFWa6tKhyhqSF1whMkPKYtrAR-NzwJWER3S0Qr-Nsr4ysbTo2Q%40mail.gmail.com<https://groups.google.com/d/msgid/django-users/CAFWa6tKhyhqSF1whMkPKYtrAR-NzwJWER3S0Qr-Nsr4ysbTo2Q%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAN2of00atd7cJBsEjVtuF36EJGMYzfKJBvgUCh1%3DyyNCo5gDJA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.