Using 2 different filtered inline formsets of the same table

2010-04-12 Thread Tim Langeman
I'd like to display 2 inline forms on the same page, which are
different filtered versions of the same table.

Screenshot of the page: 
http://static.mftransparency.org/media/misc/2-inline-filtered-formsets.png

I filter the queryset to limit the form to a subset of the table:

class DisbursementProductFeesFormSet(BaseInlineFormSet):
def get_queryset(self):
return
ProductFees.objects.filter(product=self.instance).filter(assessedAt=1)

class ContinuingProductFeesFormSet(BaseInlineFormSet):
   def get_queryset(self):
   return
ProductFees.objects.filter(product=self.instance).filter(assessedAt=2)

I am able to get the form to display using the following controller
code:

ProductFeesFormSet = inlineformset_factory(Product, ProductFees,
formset=DisbursementProductFeesFormSet, extra=2, max_num=2)
disbursementFeesFormset = ProductFeesFormSet(instance=data)

ContinuingFormset = inlineformset_factory(Product, ProductFees,
formset= ContinuingProductFeesFormSet, extra=2, max_num=2)
continuingFeesFormset = ContinuingFormset(instance=data)

But I have problems saving saving the forms individually, which I
theorize is because the fields on both forms are created with the same
field ids, as seen by this example for the description field:

  disbursement inline form:
id_productfees_set-0-description

  continuing inline form:
id_productfees_set-0-description

Is there a way that I can setup the two forms so that their field
names are different, or is there a better way to display two different
versions of the same table on the same form?

-Tim Langeman
Akron, PA

-- 
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: Django and WordPress together?

2010-03-04 Thread Tim Langeman
Here's another post about a how to connect to wordpress mysql tables
from within Django.
  http://uswaretech.com/blog/2010/01/wordpress-and-django-best-buddies/

The author has done all the work of setting up the django models for
you.

With multi-db available in Django 1.2, it is now possible to connect
to mysql wordpress tables from within a Postgres-db-based Django app.

-Tim


On Mar 3, 6:41 pm, John Griessen  wrote:
> Does anyone run Django and WordPress together?
>
> I like the P2 theme of WordPress, so I'm wanting to use it with links to 
> documents
>   in a P2 blog, but I want it all searchable from Django apps.
>
> Anyone do that where Django is the main admin interface to a site's pages and
> WordPress is just for a subdomain?  If you do this, is it easy access the 
> WordPress
> database via Django?
>
> I found this about what I'm asking:  
> http://geekscrap.com/2010/02/integrate-wordpress-and-django/
>
> Know any other write ups?
>
> Thanks,
>
> John

-- 
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.



Updating a PO file with makemessages without removing previous translation strings

2010-02-16 Thread Tim Langeman
I'm having trouble appending new translation strings to an existing po
file without removing some of the previously translated strings.

Here's some background:
-
I have a project that I've divided into sections.  I have removed some
templates from a section that I do no want to update for this
particular language, and I have updated other templates by marking
additional strings.

I had previously created a po with existing translations that total
857 strings (0 which are untranslated), but when I run makemessages,
it removes some of my strings, resulting in a smaller file of 603
strings (26 which are untranslated).

The documentation says that makemessages "creates (or updates) a
message file in the conf/locale (in the django tree) or locale (for
project and application) directory."
  http://docs.djangoproject.com/en/dev/ref/django-admin/#makemessages

The syntax I am using is:
  python manage.py makemessages -l es

Based upon my attempt, it does not appear as though the "update" is
happening as expected.  Is there something I should be doing
differently, or is my interpretation of "update" wrong?

-Tim Langeman
Akron, PA (USA)

-- 
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: Chart tool

2009-11-29 Thread Tim Langeman
We're using AnyChart.  It is similar to Fusion Charts in that it is an
XML data source that is rendered on the client side with a Flash SWF.
   http://www.anychart.com

I don't think AnyChart has a free version, so you'll have to look into
the licensing arrangements to see if it is worth it for you.

We're using the scatter chart with my company to display microfinance
interest rate data.
   http://www.mftransparency.org/data/countries/ba/data/

-Tim Langeman
Akron, PA (USA)

On Nov 29, 4:31 am, John M  wrote:
> We started playing with FusionCharts, they have a free version which
> is pretty slick.  It's flash based, and not sure about the printing
> aspect yet.  It's generated with some XML and an SWF file.
>
> J
>
> On Nov 25, 12:07 pm, "S.Selvam"  wrote:
>
>
>
> > Hi all,
>
> > This is my first post here andi  am new to django.
>
> > I need to show some data as a chart.
>
> > I would like to achieve a high quality rendering.
>
> > Is reportlab or matplotlib enough ?
>
> > I hope you can direct me on track.
>
> > --
> > Yours,
> > S.Selvam
> > Sent from Bangalore, KA, India

--

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: mixed Case Field names in the database columns

2009-11-27 Thread Tim Langeman
Thanks!

Don't know how I missed it in the docs.

-Tim

On Nov 27, 11:28 am, Karen Tracey  wrote:
> On Fri, Nov 27, 2009 at 9:26 AM, Tim Langeman wrote:
>
> > I know that there is a setting to configure the db_table in django,
> > but I haven't found any similar setting for the field names.
>
> There is one:
>
> http://docs.djangoproject.com/en/dev/ref/models/fields/#db-column
>
> Karen

--

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.




mixed Case Field names in the database columns

2009-11-27 Thread Tim Langeman
I'm trying to query my Postgres database through an ODBC data source
in Windows (Excel & Access).

I've found that Excel does not like mixed case field names and the
recommendation for linked SQL servers is to use all lower case names.
I assume this also applies to other types of connections with the
windows ODBC driver.
  
http://www.postgresonline.com/journal/index.php?/archives/46-Setting-up-PostgreSQL-as-a-Linked-Server-in-Microsoft-SQL-Server-64-bit.html

I know that there is a setting to configure the db_table in django,
but I haven't found any similar setting for the field names.  What
approach would you recommend to address this problem.  It seems that
my options are:

1) rename all the fields to lower case in django and in the db
2) find a way to continue to use mixed case in my application but
change the tables
3) find a way to get the ODBC driver to handle mixed cases so that
everything can stay mixed case

-Tim Langeman
Akron, PA

--

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.