On Feb 21, 11:14 am, Jeremy Dillworth wrote:
> and a view named list:
>
> def list(request):
> people = Person.objects.all()
> for p in people:
> p.columns = [None, None, None]
> for c in DataPoint.objects.filter(person=p, value__gt=4):
>
You could also put a columns property onto each person object.
Given the models:
class Person(models.Model):
name = models.CharField(max_length=30)
class DataPoint(models.Model):
person = models.ForeignKey(Person)
value = models.IntegerField()
and a view named list:
def list(reques
Presumably you'll eventually have enough transactions that you'll want
to start paging them. At that point, it would change how you would
arrive at the balance. If a user is looking at page 30, you shouldn't
need to retrieve the transactions from pages 1-29.
Eventually, you may want to consider so
Here's a few ideas:
Solution 1 - use the __main__ module
The downside to this is that it always reads x from the "top-level"
module, in other words, the script that is being run. So when you run
a1, you'll get "a1" when you run a2 module b will then find "a2".
a1.py
--
import
4 matches
Mail list logo