t=True)
objects = models.Manager.from_queryset(ProcedureQuerySet)()
Warmly,
Felippe Raposo
2017-07-19 11:50 GMT-03:00 Fabio C. Barrionuevo da Luz :
> What is the right way to make Fluent interface on custom methods of custom
> Queryset class?
>
> In other words, how to make "by
What is the right way to make Fluent interface on custom methods of custom
Queryset class?
In other words, how to make "by_validity" work without lost previous
filters?
Procedure.objects.filter(is_active=False).by_validity()
I've tried using q = self or q = self.query
I want to be able to sort by several custom methods in Django Admin. This
question on StackOverflow
<http://stackoverflow.com/questions/2168475/django-admin-how-to-sort-by-one-of-the-custom-list-display-fields-that-has-no-d>
provides solution for one method only.
I tried to mod
Whoops, wow that really was basic Python. Sorry for the spam; of
course I know there's a difference between calling a method and
calling an attribute...how embarassing. =)
Thanks for your help Anssi. Also thanks for not adding, ", you
moron!" to the end of each sentence...
On Feb 19, 9:47 am, a
On Feb 19, 3:38 am, Gchorn wrote:
> Hello All,
>
> So in my models.py file, I have:
>
> class Player(models.Model):
> team = models.ForeignKey(Team)
> first_name = models.CharField(max_length=100)
> last_name = models.CharField(max_length=100)
> gp = models.IntegerF
Hello All,
So in my models.py file, I have:
class Player(models.Model):
team = models.ForeignKey(Team)
first_name = models.CharField(max_length=100)
last_name = models.CharField(max_length=100)
gp = models.IntegerField(max_length=2) #games played
mp = model
I think jquery may be the right way to go for this. It will allow you
to evaluate the weights in real time so you won't have to submit the
form before any validation errors would be returned.
Working it at the model level may get tricky, for ease I would handle
it at the form or view level.
On Au
On 8/12/2010 8:36 AM, lingrlongr wrote:
> Hi Nick,
>
> Thanks for the reply. Yes, the department weights will be used in a
> grading scheme. One department may be 25% (0.25), etc... But in the
> end, the weights should total 1.0. For example, in my Store model:
>
> class Store(models.Model):
Hi Nick,
Thanks for the reply. Yes, the department weights will be used in a
grading scheme. One department may be 25% (0.25), etc... But in the
end, the weights should total 1.0. For example, in my Store model:
class Store(models.Model):
#...etc...
def _get_total_dept_weight(self):
Are you trying to create a save function that evaluates all the
weights and returns an error if they are more than 1?
On Aug 10, 3:17 pm, lingrlongr wrote:
> I 'm trying to create a form dynamically. This works just fine, but
> there's no way for the form to offer any customized validation, by w
I 'm trying to create a form dynamically. This works just fine, but
there's no way for the form to offer any customized validation, by way
of the clean() method.
def get_dept_weight_form(store):
fields = {}
s = Store.objects.get(pk=store.id)
for d in store.department_set.all():
On Sep 8, 7:29 pm, Slammer wrote:
> FYI, I'm a beginner, I'm having trouble with custom methods, I'm
> using an existing database which is used for a fantasy football
> site, the primary data return is a list of players for a particular
> team, I've done th
Here is my total: {{my_total}}
On Tue, Sep 8, 2009 at 11:29 AM, Slammer wrote:
>
> FYI, I'm a beginner, I'm having trouble with custom methods, I'm
> using an existing database which is used for a fantasy football
> site, the primary data return is a list of player
FYI, I'm a beginner, I'm having trouble with custom methods, I'm
using an existing database which is used for a fantasy football
site, the primary data return is a list of players for a particular
team, I've done that fine, but the score for those players is in a
dif
> I've been hacking some filtering for related managers, have a look at
> the BoxManager
> here:http://django-pm.googlecode.com/svn/trunk/myproject/pm/models.py
Thanks for food for thoughts. Looking at your code got me thinking and
in the end my problem was really simple. I was using the example
I've been hacking some filtering for related managers, have a look at
the BoxManager here:
http://django-pm.googlecode.com/svn/trunk/myproject/pm/models.py
My app misses the user.inbox.new() feature, i will add it soon. :)
On Nov 16, 2:18 pm, "Tomi Pieviläinen" <[EMAIL PROTECTED]> wrote:
> Hi gr
I've added it, line 228
On Nov 16, 3:32 pm, Samuel Adam <[EMAIL PROTECTED]> wrote:
> I've been hacking some filtering for related managers, have a look at
> the BoxManager
> here:http://django-pm.googlecode.com/svn/trunk/myproject/pm/models.py
>
> My app misses the user.inbox.new() feature, i wi
Hi group,
Is it possible to have custom filtering methods for MTMManagers? More
precisely I'd like to be able to use user.received_messages.new in my
templates. I can define a custom manager for my Message model with a
custom new method, but unfortunately this returns all new messages in
the syst
Hello -- I've added a custom method to a model that returns a boolean --
I've tried something like this:
class Liquid(models.Model):
# ...
def ruins_everything(self):
return bool(0)
... which does show up as "False" in the list of the admin.
What I'm wondering is, what would I
> Now, I want to select all records whose duration (end_time -
> start_time) is more than 2 hours.
>
> I tried a custom method in the model like this which returns the
> duration but cannot figure out how to use it in queryset filters.
Filtering by calculated fields is best done on the server si
Hi everyone,
A simplified version of my model looks like this:
class Schedule(models.Model):
start_time = models.DateTimeField('Start Time')
end_time = models.DateTimeField('End Time')
event = models.CharField(maxlength=100)
Now, I want to select all records whose duration (end_time
21 matches
Mail list logo