Thank you so much guys, your suggestions are very helpful. Bruno,
others: I really appreciate your help.
--
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
On Fri, Aug 5, 2011 at 5:14 PM, Subhranath Chunder wrote:
> Your model declarations are very confusing for me, and seems to be running
> around in circles. Very difficult to follow for me.
> The logical relationships are not clear. So, how to arrive at the
> 'rebate_pct' and 'wac' as you actually
On Fri, Aug 5, 2011 at 7:51 AM, bruno desthuilliers
wrote:
> Without more informations about your models (and specially the
> relationships), it's going to be rather difficult. As a general
> consideration, if your Claim model can access these other models thru
> relationships, well you just have
On Thu, Aug 4, 2011 at 5:31 PM, Javier Guerra Giraldez
wrote:
> On Thu, Aug 4, 2011 at 3:53 PM, nixlists wrote:
>> What's the correct way to write the view then? Any work-arounds?
>
> - collect the modified objects to a list, don't rely on the queryset
> to store th
On Thu, Aug 4, 2011 at 4:47 PM, Javier Guerra Giraldez
wrote:
> you're modifying the 'claim' objects cached by the queryset. as soon
> as the queryset loads another part of the table (typically it loads in
> 21-record chunks) or if it's clone()'d (happens a lot), it will
> construct new 'claim' o
On Thu, Aug 4, 2011 at 4:10 PM, Javier Guerra Giraldez
wrote:
> On Thu, Aug 4, 2011 at 2:14 PM, nixlists wrote:
>> I need to rewrite the view so that for each object I need to make a
>> simple calculation based on the data in the fields of that object
>
> you can simply
On Thu, Aug 4, 2011 at 3:17 PM, Jacob Kaplan-Moss wrote:
> Well, without more details about your model(s) and what calculation
> you'd like to make it's impossible to give you a specific answer.
> However, you may want to take a look at Django's
> aggregation/annotation commands (http://django.me/
Hi.
I have a view that currently simply takes a QuerySet and displays it
using pagination with the list_detail.object_list generic method:
return list_detail.object_list(
request,
queryset = cset,
paginate_by=30
)
I need to rewrite the view so that for each
Hi.
The humanize module -
https://docs.djangoproject.com/en/1.3/ref/contrib/humanize/ does not
support humanizing decimal values similar to 'intcomma', only
integers. Is there an extension to do so, and if not how would one
write one?
How would one use this http://djangosnippets.org/snippets/842/
On Tue, Jul 26, 2011 at 7:42 AM, Roman Klesel
wrote:
...
> The main question you may ask yourself may be whether or not you
> really want to have django do the whole calculation thing. Many
> database engines have very powerful aggregation capabilities, support
> for stored procedures, functions
On Tue, Jul 26, 2011 at 9:52 AM, Tom Evans wrote:
> p_dict = dict(contract_products.values_list('product', 'wac__wac'))
>
> This should cut down the number of queries in the view significantly.
Thanks! This is much better than what I had.
--
You received this message because you are subscribed
Wow, these are great.
I was thinking about having to write something much more basic, now I
have something to learn from. Thanks for sharing!
--
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@goog
Hi. I am a newbie :)
This is probably not a very Django-like design at this point, but the
goal is to move towards it from a legacy-type design DB.
My models are currently set up something like the following (since
there is quite a bit of trial-and-error database design and data
import work to s
On Sun, Jul 24, 2011 at 2:46 PM, Jarilyn Hernandez
wrote:
> Hi, Thanks for the response. My problem is that I have my tables created on
> django. All I want is to import some data from a csv file to these tables
I am using HeidiSQL with MySQL for this, but a script could do much
more than simple
On Thu, Jul 21, 2011 at 5:35 PM, Marc Aymerich wrote:
>
> ups, I think it should be:
> contract.products.filter(id=Y).values_list('rebate_pct', flat=True)
> product.contractproduct_set.filter(id=X).values_list('rebate_pct',
> flat=True)
Thanks. The first one does not work since rebate_pct is in t
On Thu, Jul 21, 2011 at 4:30 PM, Jani Tiainen wrote:
> ContractProduct.objects.all()
> Following might work also (not sure, but is easy to test in shell for
> example):
> for c in Contract.objects.all():
> for cp in c.contractproduct_set.all():
> print c, cp.product, cp.rebate_pct
> --
On Thu, Jul 21, 2011 at 2:17 PM, Jani Tiainen wrote:
> Hi,
> So you want to tie Contract with Product(s) with rebate_pct? You then need
> custom intermediary m2m table say "ContractProduct"
> https://docs.djangoproject.com/en/1.3/topics/db/models/#intermediary-manytomany>
> for more. So in the end
17 matches
Mail list logo