Re: Extending the ManyToMany relation, maybe a bad idea

2011-07-27 Thread Joshua Russo
Someone tell me where I'm going wrong conceptually here, I feel like I'm making this too hard. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit

Re: Extending the ManyToMany relation, maybe a bad idea

2011-07-27 Thread Joshua Russo
My problem is that I have multiple values and I need to associate the list of extra fields with selected relations for the ManyToMany relation. Below is a simplified version of what my setup is. I want to create an edit form for Organization, but I'm struggling with how best to save (and

Re: Extending the ManyToMany relation, maybe a bad idea

2011-07-27 Thread Joshua Russo
Ok, so I can retrieve this extra data in the __init__ of the model form, but it seems like I will need to skip all of the cleaning and automatic validation of the form; because the data, to be displayed with the associated checkbox will have to be included with the items field in the

Re: Extending the ManyToMany relation, maybe a bad idea

2011-07-28 Thread Joshua Russo
Ya, sorry, I was just getting frustrated because I was taking longer than I wanted to implement this. The formset is what I ended up with. The tricky part is still that I want a defined list of options in the formset, so I can't just make it a model formset. I haven't worked in Django in a

Best practice when testing form values in a template?

2011-08-02 Thread Joshua Russo
Ok, so I've created a fairly simple form: class OrganizationItemForm(AuditModelForm): selected = forms.BooleanField() extraRequired = forms.BooleanField(widget=forms.HiddenInput) multiLineInfo = forms.BooleanField(widget=forms.HiddenInput) def __init__(self, *args,

Re: Best practice when testing form values in a template?

2011-08-03 Thread Joshua Russo
Or am I not using these concepts as intended? -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/UvoTGqPzDBoJ. To post to this group, send email to

Re: Best practice when testing form values in a template?

2011-08-03 Thread Joshua Russo
Really? Nothing? Do you need more information? From the lack of response I feel like I'm completely off the mark and nobody wants to tell me. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit

Re: Best practice when testing form values in a template?

2011-08-05 Thread Joshua Russo
Ok, I apologize. Here is a fuller representation of what I'm doing. I had a hard time figuring out how much was enough versus too much. This is simplified, but I think it represents what I'm trying to do. For instance, don't pay too much attention to the save logic in the view, I haven't

How to test form values in a template? (simplified)

2011-08-07 Thread Joshua Russo
I realize that I went from too little information, to too much information in the previous post, so this is an attempt to find a middle ground. What I'm building is the ability to have a list of checkable options, and depending on the setup for a give option it may have a text field to enter

Re: How to test form values in a template? (simplified)

2011-08-07 Thread Joshua Russo
It's more that I want to have different ways of displaying the same form field. I want the text field to be on the same line as the checkbox when it's an input field and below it when it's displayed as a textarea. There's also the point of changing the required setting of the same field based

How to prevent model formset from saving the empty forms?

2011-08-09 Thread Joshua Russo
I have a model formset that's displaying an extra form, but when I save I always get that form saved as an empty entry. How do I tell it not to save the model forms that I don't edit? It doesn't happen this way in the admin, does it? -- You received this message because you are subscribed to

Re: How to prevent model formset from saving the empty forms?

2011-08-09 Thread Joshua Russo
Ok, I figured out why, but I still don't know how to fix it. I set a dropdown to empty_label = None, which automatically selects the first element. I want that, but the form then thinks it has changed because the value in the list of initial values is empty for that field, and I can't see how

Re: How to prevent model formset from saving the empty forms?

2011-08-09 Thread Joshua Russo
Nm, I got it -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/lYt3r0vdv4cJ. To post to this group, send email to django-users@googlegroups.com. To

Re: How to prevent model formset from saving the empty forms?

2011-08-09 Thread Joshua Russo
I just needed to retrieve the first pk value from the field's queryset in the init of the form and set the initial value there. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit

Splitting models.py results in table rename?

2011-08-19 Thread Joshua Russo
My models.py was getting too large so I tried to split it into /models __init__.py someLogicalGroupOfModels.py andSoOn.py in the __init__.py I have from appName.models.someLogicalGroupOfModels import * from appName.models.andSoOn import * All of my imports still work but the queries are

Re: Splitting models.py results in table rename?

2011-08-19 Thread Joshua Russo
Perfect! Thank you -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/NRyP256j0G4J. To post to this group, send email to django-users@googlegroups.com. To

I need help with reverse and url patterns

2011-08-20 Thread Joshua Russo
I setup this patter in url.py url(r'^events/(?P\d{4})/(?P\d{2})/$', events, name="eventsMonth") in my template I have this tag {% url eventsMonth year=month.prev.year month=month.prev.month %} but I keep getting Caught NoReverseMatch while rendering: Reverse for 'eventsMonth'

Re: I need help with reverse and url patterns

2011-08-20 Thread Joshua Russo
Never mind I got it. I changed my url patter to url(r'^events/(?P\d{4})/(?P\d{1,2})/$', events, name="eventsMonth") I'm still not very sharp on my regex skills. I realized that {2} required a 2 digit number -- You received this message because you are subscribed to the Google Groups

DB based translations?

2011-08-20 Thread Joshua Russo
Ok, I've been looking into the different database based translation solutions out there and I can't find what I really had in mind. I need to have non-technical people easily update the translations. So I wanted a solution where I could create an interface to ease the process. One problem is

Re: DB based translations?

2011-08-21 Thread Joshua Russo
Ooo that looks like what I'm looking for. Thanks for the tip. Do you have any experience with it? -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit

Re: Best approach to handling different types of Users

2011-08-21 Thread Joshua Russo
Things will break in the sense that, if you add another app that accesses the User model they will only see the original implementation. They won't get your subclass. Other than that, other apps that use the User model should "work" just fine. Unless I'm missing something, and in that case

CSS question

2011-08-21 Thread Joshua Russo
I know this is a bit off topic but I know this place is full of very helpful intelligent people. :o) Ok so I have an html block (div, p, doesn't matter what kind), and I fill it with a label and an input text field. The input is always larger than the label (rightly so), but the label is

Re: CSS question

2011-08-21 Thread Joshua Russo
Thanks for the help, CSS is always my gremlin -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/TmoW1R-DflQJ. To post to this group, send email to

Re: Python question about subprocess.Popen() and stdout

2010-08-05 Thread Joshua Russo
On Aug 4, 6:49 pm, Hassan wrote: > > Ok, so it appears that (in Python 2.5 at least) there is no way to capture > > the stdout of subprocess.Popen() > > just do this > > from subprocess import Popen, PIPE > p = Popen([cmd], stdout=PIPE) > p.stdout.readlines() > > thats it!

Re: Python question about subprocess.Popen() and stdout

2010-08-06 Thread Joshua Russo
On Thu, Aug 5, 2010 at 10:53 PM, Steve Holden <holden...@gmail.com> wrote: > On 8/5/2010 7:16 PM, Joshua Russo wrote: > > On Aug 4, 6:49 pm, Hassan <hsn.zam...@gmail.com> wrote: > >>> Ok, so it appears that (in Python 2.5 at least) there is no way to > capture

Re: Python question about subprocess.Popen() and stdout

2010-08-06 Thread Joshua Russo
On Aug 6, 9:57 am, "J. Cliff Dyer" <j...@sdf.lonestar.org> wrote: > "Joshua Russo" <josh.r.ru...@gmail.com> wrote: > >On Thu, Aug 5, 2010 at 10:53 PM, Steve Holden <holden...@gmail.com> wrote: > > >> On 8/5/2010 7:16 PM, Joshua Russo wr

Re: Python question about subprocess.Popen() and stdout

2010-08-06 Thread Joshua Russo
On Fri, Aug 6, 2010 at 12:17 PM, Joshua Russo <josh.r.ru...@gmail.com>wrote: > On Aug 6, 9:57 am, "J. Cliff Dyer" <j...@sdf.lonestar.org> wrote: > > "Joshua Russo" <josh.r.ru...@gmail.com> wrote: > > >On Thu, Aug 5, 2010 at 10:53 PM, Steve

Which PostgreSQL driver do you use

2010-08-26 Thread Joshua Russo
There are a lot of PostgreSQL drivers listed on the Python Wiki http://wiki.python.org/moin/PostgreSQL Has anyone found one to be better or even that different from another? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

Re: Which PostgreSQL driver do you use

2010-08-26 Thread Joshua Russo
On Thu, Aug 26, 2010 at 10:17 PM, Joshua Russo <josh.r.ru...@gmail.com>wrote: > There are a lot of PostgreSQL drivers listed on the Python Wiki > http://wiki.python.org/moin/PostgreSQL > > Has anyone found one to be better or even that different from another? > Neverm

Generic web-dev question: Best way to do a processing page?

2010-05-01 Thread Joshua Russo
This is mainly just curiosity at the moment. How do you create a "processing" intermediate page, like you see on travel sites when they are looking for the rates? I would always avoid this if at all possible, but sometimes you have a process that takes longer than usual. I've been looking around

Python question about subprocess.Popen() and stdout

2010-08-02 Thread Joshua Russo
I'm creating a wxPython application that the client can run to make sure the installation stack is functioning properly. I want to include the unit test processing in this application but I've run into some difficulties. An additional wrinkle I threw in was that I am using py2exe so they don't

Re: Python question about subprocess.Popen() and stdout

2010-08-03 Thread Joshua Russo
On Mon, Aug 2, 2010 at 6:41 PM, Joshua Russo <josh.r.ru...@gmail.com> wrote: > I'm creating a wxPython application that the client can run to make > sure the installation stack is functioning properly. I want to include > the unit test processing in this application but I'v

<    1   2   3