Thursday, June 27, 2013

Re: Save String /Value to Table Entry

There are several approaches:

1. Your code that currently reads the string could connect to the Django site via HTTP, log in as a user to which you have given suitable permissions, and know enough about how to talk to the admin interface to create and populate instances of the model that you have designed to hold the strings.

2. Similar to 1, but using a custom view you have written (possibly RESTful) that is single purpose for creating the populated model instances, and designed to be easier for a program to talk to.

3. Your program could create a Django "fixture" file containing the information, which can then be loaded using manage.py loaddata to load it into Django.  See https://docs.djangoproject.com/en/1.5/howto/initial-data/

4. Assuming that your existing code is in python, write a new management command based on it that fetches your strings as now, and then directly saves them using the ORM.

5. Have your program use an independent connection to the database that is backing Django to create the rows directly.

I suspect that 3 or 4 are the simplest to code, but will require more Django study than that required to put up a web site.

Bill


On Wed, Jun 26, 2013 at 5:28 PM, hiQ <johansontechnology@gmail.com> wrote:
I currently use Microsoft Visual Studio 2010 Express (my hardware is working under Windows) and have created an application that can read strings from an external source and display them on Msgbox's. 

I would like to save these values into an table in django so I can query them later. Is this possible. May I ask for some tutorial references or guidance?

Thanks,

--
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+unsubscribe@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.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
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+unsubscribe@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.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment