Re: return related objects from a queryset

2009-09-17 Thread Milan Andric
On Sep 17, 4:02 am, mrts wrote: > On Sep 17, 8:21 am, Milan Andric wrote: > > > So is there a way I can query on Alumni.objects.filter(**query_params) > > but then return the Profile objects related to the Alumni objects > > rather than the Alumni objects? > >

return related objects from a queryset

2009-09-16 Thread Milan Andric
Hello, I'm not sure if the subject makes sense but i have two models: class Profile(models.Model): user = models.OneToOneField(User, primary_key=True) middle_name = models.CharField(max_length=50, blank=True) title = models.CharField(blank=True, max_length=128) about = models.Text

Re: apps that relate to each other

2009-08-07 Thread Milan Andric
On Aug 7, 3:00 pm, Masklinn wrote: > On 7 Aug 2009, at 23:33 , Milan Andric wrote: > > > > > > > Hello I have two apps that have foreign keys to each other.  Like: > > > people.models: > > >  class Profile(Model): > >     secondar

Re: apps that relate to each other

2009-08-07 Thread Milan Andric
On Aug 7, 2:56 pm, Peter Herndon wrote: > On 08/07/2009 05:33 PM, Milan Andric wrote: > > > > > Hello I have two apps that have foreign keys to each other.  Like: > > > people.models: > > >    class Profile(Model): > >       secondary_email

Re: apps that relate to each other

2009-08-07 Thread Milan Andric
On Aug 7, 2:54 pm, Daniel Roseman wrote: > On Aug 7, 10:33 pm, Milan Andric wrote: > > > > > > > Hello I have two apps that have foreign keys to each other.  Like: > > > people.models: > > >   class Profile(Model): > >      secondary

apps that relate to each other

2009-08-07 Thread Milan Andric
Hello I have two apps that have foreign keys to each other. Like: people.models: class Profile(Model): secondary_email = CharField() class Staff(Profile): office = ForeignKey(Room) resources.models: class Room(Model): name = CharField() class Reservation(Model):

Re: how to deploy Django on the web server?

2009-08-07 Thread Milan Andric
Justin, it's not. Have you seen the deployment docs? http://docs.djangoproject.com/en/dev/howto/deployment/#howto-deployment-index -- Milan On Aug 7, 1:56 pm, justin jools wrote: > thanks for the reply but I have access to a server for free so I wanted to > set it up myself, how can it be so

multiple sites using one CMS

2009-05-15 Thread Milan Andric
So we are building a CMS that should allow multiple sites to be supported based on the sites framework or a sites key on various models we want to be multisite. This is how I imagine it working: Each publication site will be a separate django project using the same database as the CMS. And each

mystery with my form being saved

2009-04-29 Thread Milan Andric
Hello, I've been banging my head on this for several hours ... for some reason on my reservation edit view, the start_when field will not save but summary does. The assertEquals always fails on line 198 in the paste below. Do you see anything fishy here? http://dpaste.com/39489/ Is it because

Re: Does anyone know how to prepopulate a form with model data

2009-04-28 Thread Milan Andric
On Apr 9, 1:02 am, Daniel Roseman wrote: > On Apr 9, 2:55 am, codecowboy wrote: > > > > > I want to create aformthat allows a user to edit his/her profile.  I > > don't want to bind myformto a model because theformwill involve > > two different models.  Does anyone have any ideas.  I've read c

Re: dynamic search forms

2009-03-05 Thread Milan Andric
On Thu, Mar 5, 2009 at 6:56 AM, Christoph Pingel wrote: > > Hello, > > this is my first post to the list. Great to work with such a well- > designed framework! > > My question - is there an 'official' way to build dynamic search > forms where users can add/remove search criteria? > And if not: Ho

Re: how reverse works

2009-03-05 Thread Milan Andric
On Mar 5, 12:56 pm, adrian wrote: > I've had some problems with reverse and have some questions and > thoughts: > > 1. When I add a view and a corresponding entry in urls,py, sometimes I > get a reverse error until I stop the dev server and restart it, even > though nothing is wrong with either

Re: Django docs and automation tests

2009-01-25 Thread Milan Andric
On Jan 25, 9:32 am, Oleg Oltar wrote: > Hi! > Can you please explain me idea of testing django applications with Client() > > There many examples in doc, where test cases just checked the > response.status_code == 200, > > But I am often getting 302 instead of 200. Is there any workaround in th

Re: installing django and pythan

2009-01-16 Thread Milan Andric
On Jan 16, 6:13 am, jazz wrote: > iam installing django and activepython on my vista machine but its not > working. can anyone help me with the installation please. I am bit > confused how to create the environment variable. nothing is working > for me... Sorry jazz I don't have much advice fo

Re: reusable apps and dependencies

2009-01-10 Thread Milan Andric
On Sat, Jan 10, 2009 at 1:15 PM, uber.ubiwanken...@gmail.com wrote: > > Sorry, I'm afraid I was not too clear. > For example: > > I've got 2 projects 'myproject1' and 'myproject2' that use django-cms > (and django-tinymce and so on...). > 'myproject1' use an old version of django-cms, 'myproject2

Re: working with shp files and geodjango

2008-12-24 Thread Milan Andric
(srid=3084) # 3084 is NAD83 spatial relation -- Milan On Wed, Dec 24, 2008 at 10:31 PM, Milan Andric wrote: > Hello, I'm playing around with geodjango and this is a GIS question > but I'm starting my quest for an answer by asking here. > > So have a shp file I'm usi

working with shp files and geodjango

2008-12-24 Thread Milan Andric
Hello, I'm playing around with geodjango and this is a GIS question but I'm starting my quest for an answer by asking here. So have a shp file I'm using from the city of chicago: http://egov.cityofchicago.org/webportal/COCWebPortal/COC_ATTACH/CitywideWardsMap2008.zip There is a wards.shp file b

template inheritance miff

2008-12-20 Thread Milan Andric
Hello, I have two templates in this example, page_base.html http://dpaste.com/101058/ and intro.html http://dpaste.com/101059/ . intro.html inherits from page_base.html, but the content_head block does not get inherited. what am i doing wrong or mis-understanding? Thanks for your help, Milan

Re: auth: get_profile(): create if it does not exist.

2008-12-17 Thread Milan Andric
On Wed, Dec 17, 2008 at 4:00 AM, Thomas Guettler wrote: > > Hi, > > The method user.get_profile() fails, if the user has no profile. During > my custom login I > check if the user has a profile and create it if needed. > > But sometimes this fails: A new user gets created, but before his first >

Re: TemplateSyntaxError No module name utils

2008-12-10 Thread Milan Andric
On Dec 10, 8:52 pm, Milan Andric <[EMAIL PROTECTED]> wrote: > I'm getting one of those bubbly exceptions coming through the template > that are tricky to debug. > > TemplateSyntaxError at / > Caught an exception while rendering: Could not import > journalism_mm.w

TemplateSyntaxError No module name utils

2008-12-10 Thread Milan Andric
I'm getting one of those bubbly exceptions coming through the template that are tricky to debug. TemplateSyntaxError at / Caught an exception while rendering: Could not import journalism_mm.workshops.views. Error was: No module named utils http://dpaste.com/97981/ I was reorganizing my code, mo

Re: Django Training

2008-12-08 Thread Milan Andric
On Mon, Dec 8, 2008 at 10:39 AM, Roland van Laar <[EMAIL PROTECTED]> wrote: > > Steve Holden wrote: >> I am looking at expanding our training offerings for the coming year, >> and a short course in Django looks like it might be popular. There >> don't seem to be many Django classes at the moment,

Re: filtering in a template based on foreign key or query params

2008-11-08 Thread Milan Andric
Oh, the answer here was to use the regroup template tag. Thanks Magus. -- Milan On Fri, Nov 7, 2008 at 4:37 PM, Milan Andric <[EMAIL PROTECTED]> wrote: > > Any thoughts on this one? Just checking. > > Thanks. > > On Nov 6, 9:06 pm, "Milan Andric" &l

Re: filtering in a template based on foreign key or query params

2008-11-07 Thread Milan Andric
Any thoughts on this one? Just checking. Thanks. On Nov 6, 9:06 pm, "Milan Andric" <[EMAIL PROTECTED]> wrote: > Hello, > > I have a view that displays hundreds of applications based on some filter > params.  But I want to render the actual template based on use

filtering in a template based on foreign key or query params

2008-11-06 Thread Milan Andric
Hello, I have a view that displays hundreds of applications based on some filter params. But I want to render the actual template based on user (an fkey) and list their applications as sub objects. but only the applications that were filtered on. bleh. So in the view I do something like:

Re: dispatch.fcgi as text

2008-09-02 Thread Milan Andric
On Mon, Sep 1, 2008 at 7:19 PM, Ronaldo Z. Afonso <[EMAIL PROTECTED]> wrote: > > Hi everybody, > > I'm running Django on a shared-hosting provider with Apache and I walked > through the documentation about FastCGI of the Django website but when I > try to access some page of my web site, instead o

Re: dreaded FieldError (used to be KeyError) can only replicate on production, ugh!

2008-07-10 Thread Milan Andric
On Tue, Jul 8, 2008 at 4:30 PM, Milan Andric <[EMAIL PROTECTED]> wrote: > > > > On Jun 30, 3:01 pm, Milan Andric <[EMAIL PROTECTED]> wrote: >> I've been wresting with this one for a couple hours now trying to >> track it down, but no luck. I'm recent

Re: AutoImageField From Custom upload and filters

2008-07-09 Thread Milan Andric
On Tue, Jul 8, 2008 at 10:23 AM, Milan Andric <[EMAIL PROTECTED]> wrote: > On Tue, Jul 8, 2008 at 10:02 AM, moos3 <[EMAIL PROTECTED]> wrote: >> >> does any know why the auto_rename loses the file name but not the >> extension? > > Not familiar with auto_ren

Re: Django, Apache, and CSS

2008-07-08 Thread Milan Andric
On Tue, Jul 8, 2008 at 9:47 PM, foo <[EMAIL PROTECTED]> wrote: > > First, I want to thank you for your reply Milan! I just recently > joined the group and I'm impressed at how active the group is and how > helpful all of the advice I've found here has been. > > I've made the changes that you sugg

Re: does django cache models.py?

2008-07-08 Thread Milan Andric
On Tue, Jul 8, 2008 at 6:12 PM, Daehee <[EMAIL PROTECTED]> wrote: > > i'm trying it figure out why django is not recognizing a new models.py > file for my app. even when i completely butcher the code in models.py > or change the filename and run "manage.py sqlreset" or "manage.py > syndb," it stil

Re: Django, Apache, and CSS

2008-07-08 Thread Milan Andric
On Tue, Jul 8, 2008 at 7:58 PM, foo <[EMAIL PROTECTED]> wrote: > > OK, I know this has been posted in the forums before, but for some > reason, I'm still struggling to get my CSS stylesheet applied to my > django templates. I'm hoping that if I post my configuration, someone > can point out what

Re: Trying to understand project structure w/apps

2008-07-08 Thread Milan Andric
On Tue, Jul 8, 2008 at 3:53 PM, eddie <[EMAIL PROTECTED]> wrote: > > Hi guys+gals, > > I'm new to django, and I'm trying to wrap my head around a project > structure. I have a simple case that I'm thinking about, but can't > put together a reasonable mental model for it. > > I've got a site that

Re: dreaded FieldError (used to be KeyError) can only replicate on production, ugh!

2008-07-08 Thread Milan Andric
On Jun 30, 3:01 pm, Milan Andric <[EMAIL PROTECTED]> wrote: > I've been wresting with this one for a couple hours now trying to > track it down, but no luck.  I'm recently updated to django trunk and > getting very odd reponses.  I could take the same page and refr

Re: AutoImageField From Custom upload and filters

2008-07-08 Thread Milan Andric
On Tue, Jul 8, 2008 at 10:02 AM, moos3 <[EMAIL PROTECTED]> wrote: > > does any know why the auto_rename loses the file name but not the > extension? Not familiar with auto_rename but maybe if you show a little code and explain what you are trying to do then someone can help. -- Milan --~--~

Re: newforms-admin, forms.ModelForm, formtools.preview

2008-07-08 Thread Milan Andric
On Tue, Jul 8, 2008 at 10:00 AM, Milan Andric <[EMAIL PROTECTED]> wrote: > On Mon, Jul 7, 2008 at 6:22 AM, d-rave <[EMAIL PROTECTED]> wrote: >> >> Has anyone successfully got formtools.preview working with >> forms.ModelForm so that the form fields are populate

Re: newforms-admin, forms.ModelForm, formtools.preview

2008-07-08 Thread Milan Andric
On Mon, Jul 7, 2008 at 6:22 AM, d-rave <[EMAIL PROTECTED]> wrote: > > Has anyone successfully got formtools.preview working with > forms.ModelForm so that the form fields are populated from the model. > > If so, do you have an example?? Dave, I'm not familiar with formtools but if all you want to

Re: ImageField error

2008-07-06 Thread Milan Andric
On Sun, Jul 6, 2008 at 3:12 PM, Molly <[EMAIL PROTECTED]> wrote: > > Millan, > > I'm doing this in dev environment with the built in webserver. No it's > not a mod_python error. > > I'm using the static setup and I can get to it fine when I upload my > photo. > The problem is when I click the phot

Re: Using a Custom Manager for date based generic views??

2008-07-06 Thread Milan Andric
On Sun, Jul 6, 2008 at 5:53 PM, Christopher Clarke <[EMAIL PROTECTED]> wrote: > Hi Guys > I'm building a django based system for a company that monitors the mutuals > funds industry > We have Mutual Funds Companies (Issuer) who have one or more funds (Fund) > and every month the funds submit a vo

Re: home page

2008-07-06 Thread Milan Andric
On Sun, Jul 6, 2008 at 10:52 PM, keegan3d <[EMAIL PROTECTED]> wrote: > > Hey everyone, > > I am a little foggy on how I would go about making a home page, by > that I mean the page that people see when they go to the main address: > www.mysite.com. > > Should I make a "home page" app? or does djan

Re: html templates - 'for' cycle without a variable

2008-07-06 Thread Milan Andric
On Thu, Jul 3, 2008 at 10:21 AM, antony_h <[EMAIL PROTECTED]> wrote: > > How could I repeat my 20 times? > I've found how I can repeat it 5 times: > {% for a in 12345|make_list %} > > {% endfor %} > But it's not so great for e.g. a hundred > Usage: my designer wants to test his layout and I don'

Re: pluggable django ticketing app?

2008-07-06 Thread Milan Andric
On Sun, Jul 6, 2008 at 12:05 AM, chefsmart <[EMAIL PROTECTED]> wrote: > > Does anyone know of a pluggable django ticketing app? Something like > the apps used by webhosts for online support? I have yet to see something available for Django that does ticketing/issue tracking. But I may have misse

Re: Django based CMS

2008-07-05 Thread Milan Andric
On Sat, Jul 5, 2008 at 6:09 AM, Fernando Rodríguez <[EMAIL PROTECTED]> wrote: > > Hi, > > Is there any open source django based cms you would recommend? Th > eonlyone I've seen so far is PyLucid. What else is there? > > Thanks! There's a couple of them available on code.google.com and elsewhere

Re: Free Comments problem...

2008-07-02 Thread Milan Andric
Can you paste your template at http://dpaste.com so we can have a look? On Wed, Jul 2, 2008 at 11:10 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > : ) absolutely! It's in an entry template. I've tried the same thing > in other templates as well (a gallery page, a photo page...) and the > s

Re: Using WingIDE's shell instead of manage.py shell

2008-07-02 Thread Milan Andric
On Wed, Jul 2, 2008 at 11:30 AM, Fernando Rodríguez <[EMAIL PROTECTED]> wrote: > > Hi, > > I'd like to use WingIDE's own python shell with django, instead of the > terminal you get with manage.py shell. > > However, if I try to eval a file form within Wing, I get this error: > > Traceback (most re

Re: ImageField error

2008-07-02 Thread Milan Andric
On Wed, Jul 2, 2008 at 12:21 PM, Molly <[EMAIL PROTECTED]> wrote: > > I added ImageField to my models like this: > > > photo = models.ImageField("Photograph", upload_to='media/images', > blank=True,null=True) > ==

Re: Adding groups to groups

2008-07-02 Thread Milan Andric
On Wed, Jul 2, 2008 at 2:23 PM, Dan Lazewatsky <[EMAIL PROTECTED]> wrote: > > Is there any way to add a group to another group, similarly to how you > would add a user to a group. For example, let's say I have four groups: > Undergraduates, Grad Students, Faculty and Staff, and there are a bunch >

Re: dreaded FieldError (used to be KeyError) can only replicate on production, ugh!

2008-07-01 Thread Milan Andric
On Jul 1, 5:03 am, "Scott Moonen" <[EMAIL PROTECTED]> wrote: > Milan, I took another look at the error and your template.  Judging from the > error (it seems to be complaining about some access to the member object, > rather than the project list), I think the reference to line 9 is a red > herr

Re: dreaded FieldError (used to be KeyError) can only replicate on production, ugh!

2008-06-30 Thread Milan Andric
On Jun 30, 3:32 pm, Milan Andric <[EMAIL PROTECTED]> wrote: > On Jun 30, 3:08 pm, "Scott Moonen" <[EMAIL PROTECTED]> wrote: > > > Hi Milan, would you mind posting the source for the object_list function as > > well? > > I just imported object_list

Re: dreaded FieldError (used to be KeyError) can only replicate on production, ugh!

2008-06-30 Thread Milan Andric
On Jun 30, 3:08 pm, "Scott Moonen" <[EMAIL PROTECTED]> wrote: > Hi Milan, would you mind posting the source for the object_list function as > well? > I just imported object_list from django.views.generic.list_detail. -- Milan --~--~-~--~~~---~--~~ You received t

dreaded FieldError (used to be KeyError) can only replicate on production, ugh!

2008-06-30 Thread Milan Andric
I've been wresting with this one for a couple hours now trying to track it down, but no luck. I'm recently updated to django trunk and getting very odd reponses. I could take the same page and refresh it several times in succession and eventually get the page, but usually get 500 errors. What w

Re: get admin url patch on db/models/base.py

2008-06-30 Thread Milan Andric
On Jun 29, 7:46 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Sun, 2008-06-29 at 17:27 -0700, Milan Andric wrote: > > I was just curious if anything like this get_admin_url patch was > > already available in django trunk somewhere and I can eliminate the >

get admin url patch on db/models/base.py

2008-06-29 Thread Milan Andric
I was just curious if anything like this get_admin_url patch was already available in django trunk somewhere and I can eliminate the patch from my patched version of django. Or is there a more appropriate way to do this so it doesn't cause a conflict? Link: http://dpaste.com/59850/ Pasted: svn

ugh, TypeError: Cannot resolve keyword err ...

2008-06-20 Thread Milan Andric
This TypeError message always baffles me and is hard to debug. I'm using SVN 6962 which means I should probably upgrade, but I tried that a month or so ago around query-set-refactor merge and things were unhappy so decided to wait. TypeError: Cannot resolve keyword 'presentation' into field. Cho

local import or not for django apps?

2008-05-29 Thread Milan Andric
http://code.google.com/p/django-survey/issues/detail?id=9&can=1 Anyone happen to have a strong opinion on this? Should django applications use local imports or package based imports? Sorry if this has been mulled over a million times. pasting conversation here: Comment 2 by doug.napoleone, To

Re: Ning-like applications for Django?

2008-05-28 Thread Milan Andric
Wow. Django distributions ... this should be on the djangoproject website. I'm amazed anyway ... the one that makes me happiest though is openid support. -- Milan On May 28, 6:26 am, "Justin Lilly" <[EMAIL PROTECTED]> wrote: > Funny you should mention this. Check > outhttp://pinax.hotcluboffra

Re: hanging os.system() when doing pdf generation

2008-05-27 Thread Milan Andric
On May 27, 11:05 am, Milan Andric <[EMAIL PROTECTED]> wrote: > On May 27, 1:10 am, Jeff Anderson <[EMAIL PROTECTED]> wrote: > > > Milan Andric wrote: > > > Hello, > > > > I have a helper-like django method that does a little pdf generation. > >

Re: Genealogy apps

2008-04-28 Thread Milan Andric
On Apr 28, 12:32 pm, ecrosstexas <[EMAIL PROTECTED]> wrote: > Does anyone know of any existing apps writtrn in Django for > genealogy?  I thought there was one in Google Code awhile back, but I > can't seem to find it now. I've heard of one called begat but it may have disappeared from google c

Great article about web2py

2008-04-28 Thread Milan Andric
This is not Django specific but it is framework relevant. I thought this was a great writeup of features for any framework. At least I am one person who likes the features of this web2py framework. http://mdp.cti.depaul.edu/examples/static/web2py_vs_others.pdf Web2py makes development happen f

Re: setting up apache on OSX

2008-02-09 Thread Milan Andric
Newbie, I use macports with osx, but that's on my production environment. Macports makes handling all the software packages much easier. You just need the latest version of Xcode (gcc and friends) to start building with macports. If you're just doing development you don't have to go through a

needs some template logic or model logic

2008-02-08 Thread Milan Andric
Hi I'm working on extending a forum app to allow for email subscriptions. http://code.google.com/p/django-forum/issues/list I'm running into one fairly simple issue and thought someone might be able to enlighten me. Here's part of my model: http://dpaste.com/34401/ And here's the template logic

Re: Shared hosting with FastCGI, problems

2008-01-05 Thread Milan Andric
On Jan 5, 7:46 pm, Michael Hipp <[EMAIL PROTECTED]> wrote: > Hello, > > I'm hoping to rework my website into Django, but am having trouble at my > shared hosting provider (HostMonster). > > They don't support mod_python, so Hostmonster said to add this to .htaccess > for FastCGI: > >AddHandler

creating a profile when a user is created

2008-01-03 Thread Milan Andric
Is it possible to set the destination of a redirect after a create in the admin? My scenario is such that when users are created it's also necessary to create a profile object. I'm trying to figure out a quick (possibly hack) that would make creating a user and profile easier. (I know, it's jus

Re: readable object

2007-12-12 Thread Milan Andric
On Dec 12, 1:13 pm, Milan Andric <[EMAIL PROTECTED]> wrote: > Is there an easy way to print an object in html? Basically with > display names and manytomany relationships resolved. (just for > viewing) > > I was thinking to write something like model_to_dict(obj) that

readable object

2007-12-12 Thread Milan Andric
Is there an easy way to print an object in html? Basically with display names and manytomany relationships resolved. (just for viewing) I was thinking to write something like model_to_dict(obj) that resolves a bunch of stuff and makes it more readable. But returns a big html string similar to

Re: multiplehiddeninput assigning to list

2007-12-12 Thread Milan Andric
Nevermind this one.. I just switched when I assign my request.session['foo'] value to the GET instead of the POST, seems to work fine. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to t

multiplehiddeninput assigning to list

2007-12-12 Thread Milan Andric
Hello, I ran into a problem recently (after updating to latest svn) where I'm assigning a list to a widgets.MultipleHiddenInput field but the list is rendered as a string in the html form. How do I assign a list to a multipleinput form field so it's rendered appropriately? The problem is exhib

Re: validating fields with newforms

2007-11-19 Thread Milan Andric
On Nov 19, 12:30 pm, Milan Andric <[EMAIL PROTECTED]> wrote: > On Nov 19, 12:16 pm, Milan Andric <[EMAIL PROTECTED]> wrote: > > > On Nov 19, 12:13 pm, RajeshD <[EMAIL PROTECTED]> wrote: > > > > > I would like to validate a field if another field is

Re: validating fields with newforms

2007-11-19 Thread Milan Andric
On Nov 19, 12:16 pm, Milan Andric <[EMAIL PROTECTED]> wrote: > On Nov 19, 12:13 pm, RajeshD <[EMAIL PROTECTED]> wrote: > > > > I would like to validate a field if another field is defined. So i > > > have two fields (state and state (international) ) -- o

Re: validating fields with newforms

2007-11-19 Thread Milan Andric
On Nov 19, 12:13 pm, RajeshD <[EMAIL PROTECTED]> wrote: > > I would like to validate a field if another field is defined. So i > > have two fields (state and state (international) ) -- one of them > > needs to be defined. How would i do this with newforms? > > By adding a clean() method to your

validating fields with newforms

2007-11-19 Thread Milan Andric
Hello, I would like to validate a field if another field is defined. So i have two fields (state and state (international) ) -- one of them needs to be defined. How would i do this with newforms? Thanks and sorry if this is something obvious and I missed it. -- Milan --~--~-~--~~-

Re: booleanfield and required = true

2007-11-15 Thread Milan Andric
On Nov 9, 12:34 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Fri, 2007-11-09 at 06:26 +0000, Milan Andric wrote: > > > On Nov 9, 12:02 am, Malcolm Tredinnick <[EMAIL PROTECTED]> > > wrote: > > > > Shouldn't the form give errors and not va

Re: booleanfield and required = true

2007-11-08 Thread Milan Andric
On Nov 9, 12:02 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > Shouldn't the form give errors and not validate? > > Nope. It's a bit tricky, though. The problem is that HTML forms do not > send *anything* for a checkbox that you don't check. So missing data for > a checkbox field means it

booleanfield and required = true

2007-11-08 Thread Milan Andric
I might be misunderstanding the documentation about BooleanField. http://www.djangoproject.com/documentation/newforms/#booleanfield but it seems if i have : >>> class Foo(forms.Form): bool = forms.BooleanField(required=True) >>> f=Foo({}) >>> f.is_valid() True >>>f.cleaned_data {'b': False}

uncommon newforms usage

2007-11-01 Thread Milan Andric
Hi, I'm working on an a little newforms problem and can surely use some advice. I have an application process that is broken up into several forms. So I have one Application model class and several AppFormParts 1-8. Since the application process is so painfully long we decided to break it up int

Re: using newforms, an uncommon case.

2007-10-30 Thread Milan Andric
On Oct 30, 12:27 pm, "Marty Alchin" <[EMAIL PROTECTED]> wrote: > Basically, you'd write pend() to take care of storing an in-progress > form, and save() for processing a completed form. Then you have a > couple options on deciding when to call which one. Also, I'll leave > pulling up a pended

using newforms, an uncommon case.

2007-10-30 Thread Milan Andric
Hi, I'm writing an application form (allow people to apply for a workshop) and we allow the applicant to submit unfinished applications because they can return to complete them at a later date. So most of the model fields are blank=True. Most of the fields are not required for a save() but i'd

Re: sharing django on production and dev

2007-09-29 Thread Milan Andric
Thanks for the input! On Sep 28, 10:18 pm, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote: > On 28-Sep-07, at 11:16 PM, Milan Andric wrote: > > > Is there some standard practice on a machine that has production code > > running in mod_python but also has developers running

sharing django on production and dev

2007-09-28 Thread Milan Andric
Is there some standard practice on a machine that has production code running in mod_python but also has developers running their django- python web server? Is that discouraged? I figure a regular user would not share the same django with mod_python because of .pyc files and permissions? So dev

subclassing flatpages model

2007-09-12 Thread Milan Andric
Hi, I would like to add tinymce to my flatpages in the admin. But the only way I can figure out how to do this is modifying django/contrib/ flatpages/models.py. Is there a way I can subclass the flatpages model and reference it from the django flatpage app? I'm confused. Thanks for your hel

Re: rendering files in markdown

2007-05-21 Thread Milan Andric
Last one, promise. On May 21, 5:53 pm, Milan Andric <[EMAIL PROTECTED]> wrote: > > On May 17, 5:34 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > > > [snip] > > >http://code.google.com/p/django-template-utils/wiki/GenericMarkup > > Ok,

Re: rendering files in markdown

2007-05-21 Thread Milan Andric
> On May 17, 5:34 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > > [snip] > >http://code.google.com/p/django-template-utils/wiki/GenericMarkup Ok, I've got to be pretty close here. I went ahead and created an empty app with just a template tags directory mmtags/templatetags/ mm_markup.py ...

Re: rendering files in markdown

2007-05-21 Thread Milan Andric
On May 18, 1:59 am, Milan Andric <[EMAIL PROTECTED]> wrote: > On May 17, 5:34 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > > [snip] > >http://code.google.com/p/django-template-utils/wiki/GenericMarkup > > Thanks alot for writing this, it was

TypeError: Cannot resolve keyword 'user' into field.

2007-05-18 Thread Milan Andric
I'm up against a problem and I don't really have a clue on how to approach it. When I try to edit a User in the Django admin I get this error: TypeError at /admin/auth/user/12/ Cannot resolve keyword 'user' into field. Choices are: permissions, id, name I've tried tracing the problem and I

Re: rendering files in markdown

2007-05-18 Thread Milan Andric
On May 17, 5:34 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > > http://code.google.com/p/django-template-utils/wiki/GenericMarkup > Thanks alot for writing this, it was a sinch to get going. Now I have a def my_markdown in template_utils/markup.py where I can do everything I need to do som

Re: rendering files in markdown

2007-05-17 Thread Milan Andric
So these will definitely take care of the backend and rendering. But on the admin frontend all I'm using is the normal builtin stuff. So the child File objects appear below the Pages they're part of when you edit a Page. And you just grab the link from the file object and drag it into the text a

Re: rendering files in markdown

2007-05-17 Thread Milan Andric
On May 17, 5:34 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > On 5/17/07, Milan Andric <[EMAIL PROTECTED]> wrote: > > > So how would i extend the markdown filter? > > > Would this be better handled in another place, better way or different > >

Re: rendering files in markdown

2007-05-17 Thread Milan Andric
Thanks! Someone in IRC also recommended writing another template filter and passing it through there before going to markdown. So between all these solutions, I'll come up with something. -- Milan --~--~-~--~~~---~--~~ You received this message because you are

rendering files in markdown

2007-05-17 Thread Milan Andric
Hello, I'm using markdown as an output filter in my templates. I'd like to extend it somehow so that it can parse a ![][123] image reference but the reference number will be a file object id or a inline reference, etc. So then the object would get rendered appropriately and dynamically from the

Re: ManyToManyField and TypeError using lists

2007-05-14 Thread Milan Andric
On May 14, 11:20 am, Milan Andric <[EMAIL PROTECTED]> wrote: > Hello, > > My Tutorial model has an author field, which can contain many authors: > > class Tutorial(models.Model): > ... > author = models.ManyToManyField(User,limit_choices_to = > {'is

ManyToManyField and TypeError using lists

2007-05-14 Thread Milan Andric
Hello, My Tutorial model has an author field, which can contain many authors: class Tutorial(models.Model): ... author = models.ManyToManyField(User,limit_choices_to = {'is_staff' :1}) When i try to save : users=[] users.append(User.objects.get(username='joe')) users.append(User.objec

Re: migrating 400 images

2007-05-07 Thread Milan Andric
On May 5, 7:17 am, Nate Straz <[EMAIL PROTECTED]> wrote: > > >>> from blog.migrate import loadCOREBlog > > In loadCOREBlog I loaded all of the Zope libraries and started iterating > through whatever needed to be migrated. When I detected a problem I > would use Python's code.interact function t

migrating 400 images

2007-05-04 Thread Milan Andric
Hi, I'm migrating a tutorials site to Django and have created a file model that is associated with tutorial pages, etc. Now I need to go through and migrate all the old content. Rather than upload 400 images I was hoping to write a script to call the File.save() method appropriately and just co

Re: a very slow view, > 30secs to load

2007-03-30 Thread Milan Andric
On Mar 30, 1:08 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > I'm confused. First you said it took 0.2 seconds, then you say it took > 47 seconds and then 3 seconds. Both of those numbers are bigger than > 0.2. I know this because I took advanced maths courses at university. > Yea, I tr

Re: a very slow view, > 30secs to load

2007-03-29 Thread Milan Andric
On Mar 29, 8:31 pm, "Gary Wilson" <[EMAIL PROTECTED]> wrote: > On Mar 29, 2:26 pm, "Milan Andric" <[EMAIL PROTECTED]> wrote: > > > But in the dev environment I can see pretty well that the view is > > functioning very quickly. So your hun

Re: a very slow view, > 30secs to load

2007-03-29 Thread Milan Andric
Great pointers, thanks! I will look at that. In the meantime I thought i would post my debug info. I used this snippet in my template to see what queries are happening. http://www.djangosnippets.org/snippets/93/ Looks like I'm making quite a few queries there, 71, but they still don't seem t

Re: a very slow view, > 30secs to load

2007-03-29 Thread Milan Andric
On Mar 28, 6:26 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Wed, 2007-03-28 at 19:59 +0000, Milan Andric wrote: > > Hellow, > > > Any advice you can offer on optimizing this view would be greatly > > appreciated. > > >http://dpaste.com/7543/ >

a very slow view, > 30secs to load

2007-03-28 Thread Milan Andric
Hellow, Any advice you can offer on optimizing this view would be greatly appreciated. http://dpaste.com/7543/ I was planning on trying to reduce the amount of data in pForms, the list that is passed to the template. Since i'm saving 19 presentations into this list along with the forms, i'm as

Re: changing maxlength html attribute

2007-02-09 Thread Milan Andric
gt; > Also, I'm not sure why it's giving you a maxlength of 30. In my > database, email is 75 characters, and I don't recall changing that. > > On Feb 9, 4:56 pm, "Milan Andric" <[EMAIL PROTECTED]> wrote: > > > Hello, > > > I'm using cont

changing maxlength html attribute

2007-02-09 Thread Milan Andric
Hello, I'm using contrib/auth User for my registration process like alot of folks but the maxlength attr on the html form for the email is 30 and that's too short. I tried modifying contrib/auth/models.py and adding maxlength to User.email but that doesn't seem to affect the form. So I need to

horrendous view, need advice on cleaning up

2007-02-05 Thread Milan Andric
Hello, I have a poorly written view that is 1) hard to understand and 2) performs slowly. Can you offer any incite into what is slowing this view down so much? Besides the app being over 60 fields long, what other things can I adjust to make this view perform better? http://dpaste.com/5362/ T

  1   2   >