Re: Trying to create django app to view alarms
On Dec 23, 2:29 pm, Python_Junkiewrote: > I think that building the python code that performs your logic is a > great way to start, and not getting bogged down with django is a great > way to get started. > > There are several (relatively straight forward) pieces of django that > you will need to tie together. > > I will simply disucss the view.py components and the html template. > > Establish your python code as a module. > Import the module in the view and use it in the view.py. > > def function_called_for_log_display(request): > ..call your python module > ...create a python dictionary with the information > that is pulled back by your python module > > .render the html template and pass the > dictionary values to the template > > return render_to_response('polls/index.html', > {'latest_poll_list': latest_poll_list}) #I took this from the django > project tutorial > > ...use the appropriate template tags/logic to display the > results of the dictionary > Thanks Python-Junkie- I've got a prototype working but it's really clunky and currently involves a server submit whenever I want to filter or my alarm view. I'm thinking about what to do and am sure will post another question soon! :) -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Trying to create django app to view alarms
Hi- I'm new to Django and pretty basic with Python to be honest, but am trying to write a web tool that will let me upload 'before' and 'after' files of alarm logs and analyse the differences as follows: * alarms cleared during the period (in before, but not after) * alarms raised during the period (in after, but not before) * historic alarms (exist with same timestamp in both before and after lists) * existing alarms with activity (exist in before and after lists but with differing timestamps) Ball-park figure for the size of these alarm logs is about 200 KB (= about 40 logs). I've already written a standalone .py script that, takes as inputs the filenames of the before and after alarm log files and from this creates 6 lists of alarm objects: (before alarms, after alarms, and the 4 lists described above). What I'd like to do is to use Django to upload the alarm data and then be able to view the alarms by list. As a rough and ready starting point, I've created an html form with a couple of textareas in, and I seem to be able to paste the entire before and alarm files in these, so I can upload the alarms data to Django in a form. Can anyone suggest how best to implement my existing python code in the .py file to create a Django solution? Thanks for any advice. Jim -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.