On Wed, Jan 29, 2014 at 5:28 PM, Will A wrote:
> Try
> target_name_name__icontains='foo' or update the foreign key definition.
target_name__name__icontains is what was needed.
Thanks.
>
>
>
> On Wed, Jan 29, 2014 at 5:08 PM, Larry Martell
> wrote:
>>
>> I have a table that has these 2 foreign
Try
target_name_name__icontains='foo' or update the foreign key definition.
On Wed, Jan 29, 2014 at 5:08 PM, Larry Martell wrote:
> I have a table that has these 2 foreign keys:
>
> target_name = models.ForeignKey(Target)
> wafer = models.ForeignKey(Wafer)
>
> Both Target and Wafer are
I have a table that has these 2 foreign keys:
target_name = models.ForeignKey(Target)
wafer = models.ForeignKey(Wafer)
Both Target and Wafer are defined the same:
name = models.CharField(max_length=40, db_index=True, unique=True)
When filtering by wafer I can do this:
wafer__name__icon
On Mar 8, 7:57 pm, Alex Gaynor wrote:
> On Sun, Mar 8, 2009 at 8:56 PM, danbergan wrote:
>
> > > > I changed the directory to "ea_app", and changed my settings.configure
> > > > to:
> > > > settings.configure(DEBUG=True, TEMPLATE_DEBUG=True, TEMPLATE_DIRS=("d:/
> > > > current/ea_app/tpl","c:/p
On Sun, Mar 8, 2009 at 8:56 PM, danbergan wrote:
>
> >
> >
> > > I changed the directory to "ea_app", and changed my settings.configure
> > > to:
> > > settings.configure(DEBUG=True, TEMPLATE_DEBUG=True, TEMPLATE_DIRS=("d:/
> > > current/ea_app/tpl","c:/python/tpl"), INSTALLED_APPS=("ea",))
> >
>
>
>
> > I changed the directory to "ea_app", and changed my settings.configure
> > to:
> > settings.configure(DEBUG=True, TEMPLATE_DEBUG=True, TEMPLATE_DIRS=("d:/
> > current/ea_app/tpl","c:/python/tpl"), INSTALLED_APPS=("ea",))
>
> The application name has now changed to ea_app, so you'll need to
On Sun, 2009-03-08 at 17:37 -0700, danbergan wrote:
[...]
>
> I changed the directory to "ea_app", and changed my settings.configure
> to:
> settings.configure(DEBUG=True, TEMPLATE_DEBUG=True, TEMPLATE_DIRS=("d:/
> current/ea_app/tpl","c:/python/tpl"), INSTALLED_APPS=("ea",))
The application nam
On Mar 8, 5:39 pm, Malcolm Tredinnick
wrote:
> On Sun, 2009-03-08 at 16:22 -0700, danbergan wrote:
> > On Mar 8, 5:13 pm, danbergan wrote:
> > > On Mar 8, 4:53 pm, Malcolm Tredinnick
> > > wrote:
>
> > > > On Sun, 2009-03-08 at 14:11 -0700, danbergan wrote:
>
> > > > [...]
>
> > > > > I'm gues
On Sun, 2009-03-08 at 16:22 -0700, danbergan wrote:
> On Mar 8, 5:13 pm, danbergan wrote:
> > On Mar 8, 4:53 pm, Malcolm Tredinnick
> > wrote:
> >
> >
> >
> > > On Sun, 2009-03-08 at 14:11 -0700, danbergan wrote:
> >
> > > [...]
> >
> > > > I'm guessing that the problem is that, since I'm not ru
On Mar 8, 5:13 pm, danbergan wrote:
> On Mar 8, 4:53 pm, Malcolm Tredinnick
> wrote:
>
>
>
> > On Sun, 2009-03-08 at 14:11 -0700, danbergan wrote:
>
> > [...]
>
> > > I'm guessing that the problem is that, since I'm not running withing
> > > django, I don't have anything set in "INSTALLED_APPS".
On Mar 8, 4:53 pm, Malcolm Tredinnick
wrote:
> On Sun, 2009-03-08 at 14:11 -0700, danbergan wrote:
>
> [...]
>
> > I'm guessing that the problem is that, since I'm not running withing
> > django, I don't have anything set in "INSTALLED_APPS".
>
> Indeed. Template tag directories are only looked
On Sun, 2009-03-08 at 14:11 -0700, danbergan wrote:
[...]
> I'm guessing that the problem is that, since I'm not running withing
> django, I don't have anything set in "INSTALLED_APPS".
Indeed. Template tag directories are only looked for in locations listed
in INSTALLED_APPS.
> I've tried
> s
Hello -
I'm using Django templates in my custom application (outside of the
Django web framework.)
I'm trying to use a custom filter in my template, but I can't seem to
find a way to get django to find my custom filter. Has anyone used a
custom filter outside of the framework?
In my template:
On Fri, 4 Apr 2008, josesoa wrote:
> Something like this should do the trick...
>
> Events.objects.filter(brags__isnull=False)
Thanks!!! That pointed me in the right direction. But, it created a
QuerySet where, for example, if an event had five brags five copies of the
that event were inclu
Something like this should do the trick...
Events.objects.filter(brags__isnull=False)
On Apr 4, 8:01 pm, Kevin Monceaux <[EMAIL PROTECTED]> wrote:
> Django Fans,
>
> I've tinkered around briefly off and on with Django for a while now.
> Finally a few days ago I finally found one of those "Round
Django Fans,
I've tinkered around briefly off and on with Django for a while now.
Finally a few days ago I finally found one of those "Round Tuits" I've
been looking for and started converting one of the web sites I act as
webmaster for from PHP to Django. My goal at this point is just to
co
DavidA escreveu:
> You build up a dynamic "and" query with a term for each checked box in
> the UI. Then you use that compound query to filter your model objects.
>
> Now that I think about it, since this is an "and" you could also do:
>
> def my_view(request):
> query = {}
> for i in
You've already had a couple of approaches suggested here, but I have a
question...
On Wed, 2006-09-20 at 19:18 +0100, Luis P. Mendes wrote:
> Hi,
>
> I want to let a user of one application to be able to filter results in
> a complex way.
>
> There are twelve variables, all boolean, that can be
You don't have to write all the filter statements at once, you can add
them incrementally. I usually do this kind of thing like:
var1 = request.GET.get('var1', None)
var2 = request.GET.get('var2', None)
var3 = request.GET.get('var3', None)
object_list = MyModel.objects.all()
if var1:
object_l
Luis P. Mendes wrote:
> But if he chooses to apply five filters, there will have to be five
> filter methods appended, or five key=values pairs as arguments.
You can do something like this:
from django.db.models import Q
def my_view(request):
query = Q()
for i in range(1, 13):
Hi,
I want to let a user of one application to be able to filter results in
a complex way.
There are twelve variables, all boolean, that can be used to perform
these filters. In PostgreSQL, all data for these variables are thus
saved as either True of False.
There is no difficulty to apply in
Thanks a lot guys :-), this works great. (Both suggestions from Dave
and Russ), so elegant : - ). Thanks a million!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, se
On 9/5/06, primitive <[EMAIL PROTECTED]
> wrote:
example codeqdict = QueryDict('id=1&fk_client_id=2')queryset = Ticket.objectsOk; so you have a GET request string 'id=1&fk_client_id=2', and you want to compose a query from it.
You will be hitting against two problems:1) The 'value' for each key in
primitive wrote:
> Is it possible to use a string (coming from an request object) as a
> keyword to filter? I keep getting errors, but I don't know how to
> convert these strings into types that filter will understand.
Sure, Python allows you to pass a dict as a set of keyword arguments,
so you
example code
qdict = QueryDict('id=1&fk_client_id=2')
queryset = Ticket.objects
for k, v in qdict.iteritems():
queryset = queryset.filter(k = v)
Essentially what I want to do here, is get a list of filter keywords
from an HTTP request, and then iterate through these to create the
final filt
On 9/5/06, primitive <[EMAIL PROTECTED]> wrote:
Is it possible to use a string (coming from an request object) as akeyword to filter? I keep getting errors, but I don't know how toconvert these strings into types that filter will understand.
Short answer; yes. request.GET is just a dictionary of or
Just from the top of my head (I'm a bit bored at work).
As the filter options are python scripts anyway, maybe you could
integrate them in your script and call them from within the script and
send the altered text to your template?
Or maybe you could write your template from within the script its
Good day,
I am a Python and Django newbie, so bear with me if this is a silly
question.
Is it possible to use a string (coming from an request object) as a
keyword to filter? I keep getting errors, but I don't know how to
convert these strings into types that filter will understand.
eg. I conve
28 matches
Mail list logo