Newbie question: How should I structure my very simple project / app?
Hi All, I'm new to Django (and to be honest, a little bit hazy on the subtleties of MVC, but if you don't try, you don't learn). I want to create a simple web frontend for a Python program I have already (mostly) written and I'd like to use Django (which may be overkill... not sure). - Users have a bunch of externally generated XML files. (Could be one, could be many (max of 20?). Possibly in an zip or tar.gz archive). - Users access the Django app and can upload via a simple form (with funky Ajax uploadiness - including as many ponies and rainbows as might be necessary) - A backend script will process this XML, performing all manner of fantastical space/time-bending magic (which will not take longer than 5 to 10 secs... Max tested with many, many input files is about 40seconds). - The output will be produced and the user will have the option to download as CSV or possibly PDF. Possibly with functionality to allow the report to be mailed to them when complete (so user identity needs to be built in). Very vague I know. But a very simple web app I think. Essentially, the backend script summarizes the input files into a summary per file and a total summary of the presence and count of certain keys / values or combinations of data. There's a set of logical rules that I have yet to invent which will be used when parsing the input XML (for example: if value "B" exists in "A" with attribute "Z" but not attribute "X" then count, otherwise do not). The reason I want to use Django is: - I know I will be asked to add all sorts of functionality to this. Django is extensible, powerful. - I don't want to be responsible for maintaing the "rules" and would love to be able to expose this via an admin interface so anyone (with authorization) can add or edit rules logic. - I've already got the bulk of the parsing script written in Python. I guess I need: - a handler for the input files. - a way to pass these file serially to my backend script (I presume I would use the filesystem for this? The input files can be anywhere from 2K to 1MB in very extreme cases.) - a mechanism to separate different user sessions. - a way to accumulate the results of each file parse and then report on the total (store the results in the DB?) - a mechanism to present and archive the reports (and then this leads to a way to look up old reports). So, given this paucity of requirements and the horrendously unclear explanation above, what suggestions might you lot have? (Apart from "RTFM", of course!) - Do / Don't use Django? - Structure of projects / Apps? - Any key external apps / modules that might be useful (e.g. for handling for uploads) - Any gotchas when invoking backend scripts? ... I'm really just looking for a nudge in the right direction. Thanks in advance for any tips, pointers or help you can give. Thanks Waza -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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.
Re: Newbie question: How should I structure my very simple project / app?
Hi Javier, Many thanks for your comments. On 19 October 2010 15:57, Javier Guerra Giraldez wrote: > first and foremost, yes, you have to read the manual, and do the > tutorial. ideally, you should forget about your specific project > while doing it. it's not too long, should take a few hours to do > completely. the fact is, if you skip this step, you won't get useful > answers here. > Understood. I'm working my way through them now. [...comment ref: message queueing...] I appreciate your insight into the queuing side. The one thing that I cannot seem to parse is how to structure the App so it fits with the Django approach. Is this one project and one app or is it an app per functional element of the system? Essentially this is a glorified form 'that does stuff in the backend'. I'm struggling with how to structure it... good luck, and welcome > Appreciated! Regards W -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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.
Re: Newbie question: How should I structure my very simple project / app?
Just a quick response to thank everyone for the suggestions. I'll let you all know how I get on. ;-) (Actually, you'll probably guess from the quality or absurdity of my questions that may come up over the coming days / weeks) WZ On 20 October 2010 00:01, timc3 wrote: > Take a look at: > > http://lincolnloop.com/django-best-practices/projects/layout.html > > After you have done the tutorials and stuff. > > Tim. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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.
problems using apps in main project (NameErrors)
Hi All, I've spent the last hour or so looking for a clear and simple explanation to this but I've been unsuccessful. Maybe someone here could help me (please!) What do I need to do to make sure my created apps are useable? This is the structure of my "XMLmunger" project. In order to simplify my project I want to use different apps for the major functional bits of the project. First stop is the "upload" application. I cannot figure out why my upload app is not being recognised by django. Note, at the moment I'm only using views / urls and templates. No models at all. ├── apps │ ├── __init__.py (empty) │ └── upload │ ├── __init__.py (empty) │ ├── urls.py │ └── views.py ├── __init__.py (empty) ├── manage.py ├── public │ └── static (css, js and images) ├── settings.py ├── templates │ └── (all of my templates) ├── urls.py └── views.py - In my /settings.py I added "upload" to "INSTALLED_APPS". - In my apps directory I have __init__.py (empty) to allow all sub dirs to be imported as modules. - I would like to pass all urls for an app to the urls.py in that app directory: (r"^/upload$", include('upload.urls')) Now the dev server won't start, complaining: >python manage.py runserver Error: No module named upload OK. Let's change "upload" to "apps.upload" in INSTALLED_APPS. Now the dev server starts but any page I try to go to gives: NameError at / "name 'apps' is not defined". I have a feeling I'm missing something very obvious but everything djangoesque is still forming in my mind and I'm really not sure where the problem is. I've been trying "from XMLMunger.view import *" in my root urls.py without success. I am thinking that I do need to import but I'm just not sure where and what... Thanks in advance... W -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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.
Re: problems using apps in main project (NameErrors)
Hi Piotr, On 27 October 2010 15:54, Piotr Zalewa wrote: > If you want to have the apps in apps folder you need to put them on the > python path, so eithor modify the python path environment variable or > (prefered) modify manage.py and add > site.addsitedir(path('apps')) Many thanks for the response. A question: I presume this only matters for the dev server then? I added this just before "execute_manager(settings)" $ python manage.py runserver Traceback (most recent call last): File "manage.py", line 11, in site.addsitedir(path('apps')) NameError: name 'site' is not defined Apologies if I'm being very stupid! Thanks W > zalun > > On 10/27/10 14:50, wawa wawawa wrote: >> Hi All, >> >> I've spent the last hour or so looking for a clear and simple >> explanation to this but I've been unsuccessful. Maybe someone here could >> help me (please!) >> >> What do I need to do to make sure my created apps are useable? >> >> This is the structure of my "XMLmunger" project. >> >> In order to simplify my project I want to use different apps for the >> major functional bits of the project. First stop is the "upload" >> application. >> I cannot figure out why my upload app is not being recognised by django. >> Note, at the moment I'm only using views / urls and templates. No models >> at all. >> >> >> ├── apps >> │ ├── __init__.py (empty) >> │ └── upload >> │ ├── __init__.py (empty) >> │ ├── urls.py >> │ └── views.py >> ├── __init__.py (empty) >> ├── manage.py >> ├── public >> │ └── static (css, js and images) >> ├── settings.py >> ├── templates >> │ └── (all of my templates) >> ├── urls.py >> └── views.py >> >> - In my /settings.py I added "upload" to "INSTALLED_APPS". >> - In my apps directory I have __init__.py (empty) to allow all sub dirs >> to be imported as modules. >> - I would like to pass all urls for an app to the urls.py in that app >> directory: (r"^/upload$", include('upload.urls')) >> >> Now the dev server won't start, complaining: >> >>>python manage.py runserver >> Error: No module named upload >> >> OK. Let's change "upload" to "apps.upload" in INSTALLED_APPS. >> >> Now the dev server starts but any page I try to go to gives: NameError >> at / "name 'apps' is not defined". >> >> I have a feeling I'm missing something very obvious but everything >> djangoesque is still forming in my mind and I'm really not sure where >> the problem is. >> >> I've been trying "from XMLMunger.view import *" in my root urls.py >> without success. I am thinking that I do need to import but I'm just not >> sure where and what... >> >> Thanks in advance... >> >> W >> >> -- >> You received this message because you are subscribed to the Google >> Groups "Django users" group. >> To post to this group, send email to django-us...@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. > > > -- > blog http://piotr.zalewa.info > jobs http://webdev.zalewa.info > twit http://twitter.com/zalun > face http://facebook.com/zaloon > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-us...@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. > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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.
using python-magic on request.FILES['datafile']
Hi All, I'm trying to allow some flexibility for my end users. I want to support the uploading of multiple file archive types (tar.gz, tar.bzip2, zip, rar etc). I want to use python-magic to guess the filetype from the files magic number and then use the appropriate decompression modules to get at the data in the files. Basically, I'm not sure how to make the type of the request.FILES['datafile'] be compatible with the requirements of python-magic (which needs a file-location or a string) I have a view: def upload_file(request): c ={} c.update(csrf(request)) if request.method == 'POST': frag = request.FILES['datafile'].read(65536) ft = magic.from_buffer(frag) res = {} res.update({ "result" : ft }) res.update({ "datafile" : type(request.FILES['datafile']) }) res.update({ "frag" : type(frag) }) return render_to_response("simple.html", {'content': res }) else: form = UploadFileForm() return render_to_response('upload.html') "simple.html" just outputs the data structure "res", as below. {'content': {'datafile': , 'frag': , 'result': 'empty'}} I've tried different combinations of magic.from_file and magic.from_buffer and both read() and chunk() from the TemporaryUploadedFile object but I either get a type error or an "empty" result. I think the above should work fine! Using python-magic on the temp object that's been uploaded (and saved to disk 'cos is > 2.5MB) works with both magic.from_buffer(open("f").read(65536)) and magic.from_file("f"). Any ideas? (also, anyone have any quick drop in helper methods for debugging I can use instead of the horrible "res" dict I'm using?) Thanks in advance Wa -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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.
Re: using python-magic on request.FILES['datafile']
And again, I solve a problem exactly 14 seconds after asking it... DOH! I had a hander method that was reading the file object prior to the tests. So, the "empty" was actually correct. I changed the order of the methods and it alls works as expected now. Oops. W On 29 October 2010 18:15, wawa wawawa wrote: > Hi All, > I'm trying to allow some flexibility for my end users. I want to > support the uploading of multiple file archive types (tar.gz, > tar.bzip2, zip, rar etc). > I want to use python-magic to guess the filetype from the files magic > number and then use the appropriate decompression modules to get at > the data in the files. > Basically, I'm not sure how to make the type of the > request.FILES['datafile'] be compatible with the requirements of > python-magic (which needs a file-location or a string) > > I have a view: > > def upload_file(request): > c ={} > c.update(csrf(request)) > if request.method == 'POST': > frag = request.FILES['datafile'].read(65536) > ft = magic.from_buffer(frag) > res = {} > res.update({ "result" : ft }) > res.update({ "datafile" : type(request.FILES['datafile']) }) > res.update({ "frag" : type(frag) }) > return render_to_response("simple.html", {'content': res }) > else: > form = UploadFileForm() > return render_to_response('upload.html') > "simple.html" just outputs the data structure "res", as below. > > {'content': > {'datafile': 'django.core.files.uploadedfile.TemporaryUploadedFile'>, > 'frag': , > 'result': 'empty'}} > > > I've tried different combinations of magic.from_file and > magic.from_buffer and both read() and chunk() from the > TemporaryUploadedFile object but I either get a type error or an > "empty" result. I think the above should work fine! > > Using python-magic on the temp object that's been uploaded (and saved > to disk 'cos is > 2.5MB) works with both > magic.from_buffer(open("f").read(65536)) and magic.from_file("f"). > > Any ideas? > > (also, anyone have any quick drop in helper methods for debugging I > can use instead of the horrible "res" dict I'm using?) > > Thanks in advance > > Wa > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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.
Is it madness to process uploaded tars and zips completely in memory?
Hi, I am writing an app to "apply some rainbows and unicorns" to a bunch of uploaded XML files (which can be uploaded as a compressed tar or zip file). Celery and rabbitmq will be used for the asynchronous tasks with jQuery (maybe with dajaxproject) to get updates on progress to the browser. I'm at the point where I'm passing the uploaded files to my offline tasks and using cStringIO with both the tarfile and zipfile modules to handle the whole compressed files as strings and then saving the decompressed XML files in an array of strings to be later manhandled by cElementTree. There is a closed audience for this app and uncompressed filesizes will never be more than 3 or 4 MB (mostly they'll under 100KB). I don't expect this to be used by more than a handful of people per day (but it will save _alot_ of man hours). Is it madness to try to do this all in memory? Should I write out the file contents to the filesystem first using "for i in uploadedfile.chunks()"? Does anyone know of any open Django apps that do anything similar (upload a file, get presented with the results) so I can have a look? Thanks in advance W -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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.
Re: Is it madness to process uploaded tars and zips completely in memory?
On 2 November 2010 14:03, Cal Leeming [Simplicity Media Ltd] wrote: > All depends on whether; > > you have enough memory > you are going to enforce the file size > you have appropriate resource limitations in place on the server > you are going to enforce the maximum number of processing requests > > etc etc... > Personally, if all those conditions were met, I'd probably do it in memory > to avoid the unnecessary disk IO overhead.. but it all depends on what you > need :) Hi Cal Thanks for this. I think I'll continue as I am then, taking into account your suggestions. Kind Regards Wa -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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.
rabbitmq + celery + django + celery.views.task_status ... simple example?
Hi All, So, I've got my django app, rabbitmq and celery working and processing my uploaded files. Next step is to get the client to display status results provided by JSON, ultimately refreshing to a results page when complete. I'm a little new to JSON / AJAX (AJAJ!) and I'm struggling a little with the templates and views part. Are there any easy examples out there? I can't seem to find any! Many thanks in advance for any suggestions. Cheers W -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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.
Re: rabbitmq + celery + django + celery.views.task_status ... simple example?
Hi, I'm using a message queue because the task is really "offline" and could take 1sec or 30 seconds (or longer). I'll look at b-list. Thankyou W On 3 November 2010 07:09, Prashanth wrote: > > > On Tue, Nov 2, 2010 at 10:42 PM, wawa wawawa wrote: >> >> Hi All, >> >> So, I've got my django app, rabbitmq and celery working and processing >> my uploaded files. Next step is to get the client to display status >> results provided by JSON, ultimately refreshing to a results page when >> complete. >> >> I'm a little new to JSON / AJAX (AJAJ!) and I'm struggling a little >> with the templates and views part. >> >> Are there any easy examples out there? >> > > > Is the expectation like user will upload a file and will see a result? if > that is case why are using celery? b-list has a ajax example[1]. BTW, if > you are trying to upload a file using ajax you need to create iframe using > javascript, you might want to use jsupload[2] > > [1] http://www.b-list.org/weblog/2006/jul/31/django-tips-simple-ajax-example-part-1/ > [2] http://valums.com/ > -- > regards, > Prashanth > twitter: munichlinux > blog: honeycode.in > irc: munichlinux, JSLint, munichpython. > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-us...@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. > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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.
Re: rabbitmq + celery + django + celery.views.task_status ... simple example?
You Sir, are awesome. I think this seems to be exactly what I was looking for... Can I ask for JS code that does the periodic polling from the client please and possibly the appropriate bits of the template? Many thanks! W On 3 November 2010 11:10, Tom Evans wrote: > On Tue, Nov 2, 2010 at 5:12 PM, wawa wawawa wrote: >> Hi All, >> >> So, I've got my django app, rabbitmq and celery working and processing >> my uploaded files. Next step is to get the client to display status >> results provided by JSON, ultimately refreshing to a results page when >> complete. >> >> I'm a little new to JSON / AJAX (AJAJ!) and I'm struggling a little >> with the templates and views part. >> >> Are there any easy examples out there? >> >> I can't seem to find any! >> >> Many thanks in advance for any suggestions. >> >> Cheers >> >> W >> > > Sure. I have a TV recording system built using Django (the UI is web > based), which records TV shows to disk in MPEG2 format. I then use the > whole celery stack to convert those video files into something that I > can then load up onto my ipad/iphone. > > The transcoding is initiated by a user clicking an icon on the episode > page, which triggers an AJAX call, which eventually calls this > function: > > def setup_transcode_episode(episode): > data = { 'valid': False, } > if episode.media: > file = unicode(episode.media) > rv = transcode_episode_for_ipad.delay(file=file, episode_id=episode.id) > tm, created = TaskMeta.objects.get_or_create(task_id=rv.task_id) > episode.ipad_media = tm > episode.save() > data['task_id'] = rv.task_id > data['valid'] = True > return data > > The data dictionary is returned back to the client, which now > periodically polls a view for status, using the task_id. > > The task that is invoked, transcode_episode_for_ipad, looks like this: > > @task > def transcode_episode_for_ipad(file, episode_id, **kwargs): > args = make_ipad_encoder_args(file=file) > out = args[-1] > ffmpeg = FFmpegProgressMonitor(file=file, task_id=kwargs['task_id'], > args=args) > rv = ffmpeg.process() > episode = TVEpisode.objects.get(id=episode_id) > dir, fn = out.rsplit('/', 1) > imedia = MplayerFileMedia.objects.create(directory=dir, file=fn) > episode.ipad_media = imedia > episode.save() > return rv > > This is pretty straight-forward, I simply produce the arguments for > ffmpeg, and then process it, monitoring the output of the ffmpeg to > give me hints about how long through the transcoding process we are, > which I then store in memcache, to avoid requiring a database hit to > find out the status of the task. > This is easier than it sounds, every frames, ffmpeg prints out a > line indicating how far through the file it is. Just monitor the > output and update the cache as appropriate. > > The way my models are set up, TVEpisode.ipad_media is a generic > foreign key, so while transcoding is taking place it points at the > TaskMeta object, which contains the task id. This allows us to know > that the task is underway in the background, even if we didn't > initiate it ourselfs, and use that information to poll for status etc > as appropriate. > > Cheers > > Tom > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-us...@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. > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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.
Re: rabbitmq + celery + django + celery.views.task_status ... simple example?
Tom - many thanks again. This is good stuff. W On 3 November 2010 11:36, Tom Evans wrote: > On Wed, Nov 3, 2010 at 10:16 AM, wawa wawawa wrote: >> You Sir, are awesome. >> >> I think this seems to be exactly what I was looking for... >> >> Can I ask for JS code that does the periodic polling from the client >> please and possibly the appropriate bits of the template? >> >> Many thanks! >> >> W >> > > Sure. In the main page view, I check to see whether I have transcoded > or started transcoding the episode, and set context variables as > appropriate: > > if episode.ipad_media: > if hasattr(episode.ipad_media, 'task_id'): > from transcoding.utils import get_task_progress > data['ipad_media_class'] = 'transcoding' > data['ipad_media_progress'] = (episode.ipad_media.task_id, > get_task_progress(episode.ipad_media.task_id)) > else: > data['ipad_media_class'] = 'good' > else: > data['ipad_media_class'] = 'bad' > > This is rendered into a widget on the page: > > {% if episode.media %} > > Play episode > > {% if ipad_media_progress %} > Transcoding to ipad > {{ > ipad_media_progress.1 }} % > {% else %} > Transcode to ipad > {% endif %} > > > {% endif %} > > > Then, during page load, I configure an observer to update each > progress widget (I use the prototype JS framework): > > $$('div.pct').each(function(ctl) { > new Ajax.PeriodicalUpdater(ctl, '{% url transcode_task_status_ajax %}', { > method: 'get', > asynchronous: true, > frequency: 3, > decay: 2, > parameters: { task_id: ctl.id } > }); > }); > > That view is trivial, since it just updates the appropriate div with > the current percentage: > > def transcode_task_status_ajax(request): > from transcoding.utils import get_task_progress > task_id = request.GET.get('task_id') > return HttpResponse(u'%s %%' % get_task_progress(task_id)) > > > Cheers > > Tom > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-us...@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. > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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.
Multiple classes in tasks.py?
Hi All, I'm sure this is a very stupid question. But, here we go. I am using celery / rabbitmq. It's all working great. Until I try to move more of my code into my asynchronous tasks to be handled by celery. I think my problem is because my classes are subclasses of Task... It's confusing me (not a difficult job, I have to admit...) Views.py: - from tasks import FileExtractor def upload_file(request): if request.method == 'POST': form = UploadFileForm(request.POST, request.FILES) if form.is_valid(): # do some stuff results = process_upload(filepath) return render_to_response("processing.html") else: form = UploadFileForm() return render_to_response('upload.html', { 'form' : form }) def process_upload(datafile): return FileExtractor.delay(filepath) Tasks.py - from celery.task import Task from celery.registry import tasks class FileExtractor(Task): SOME_CLASS_VARS = def run(self, filepath, **kwargs): # do stuff with private methods results = FileParser.(self, extracted_data) # now a bunch of class-internal methods ("_methods") tasks.register(FileExtractor) class FileParser(Task): def run(self, filepath, **kwargs): # do stuff # a few more private methods = So, I can't seem to figure out how to create a new instance of the second class from the first. (Hence the AARRRGH. I've got no __init__ method!) What extremely basic point am I missing? Thankyou W -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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.