Hi Florian,
I have been working on the problem the whole weekend and after trying
all the mog_wsgi debugging method I still do not have a solution. I do
know that the error does not lie in my django code or my apache
configuration as I did the exact setup on a ubuntu machine and it
works 100%. It
Hi
I was wondering if anyone had a similar problem when trying to use
pango in django running under mod_wsgi on apache.
I am running
|20:11:06|# cat /etc/debian_version
6.0.3
When I run a runserver on the same server it works fine but the moment
I "import pango" in any of my modules the mod_wsg
Hi
I was wondering if anyone had a similar problem when trying to use
pango in django running under mod_wsgi on apache.
I am running
|20:11:06|# cat /etc/debian_version
6.0.3
When I run a runserver on the same server it works fine but the moment
I "import pango" in any of my modules the mod_wsg
Ok, I found a way. I don't know if it's the best way but it works :)
return getattr(__import__(module_name, fromlist = [class_name]),
class_name)
Thanks for the help.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send
Hi Martin,
Thanks for the tip. The thing is that I store my class names in the
database. So
class B(models.Mode):
form_class = models.CharField(...)
def get_form_class(self):
return ..(self.form_class) <- this is where I need to some
how get the class object from a different
I should add that in the B class function get_a_class I only have a
variable name "A"
--
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 group, send email
Hi,
I have been struggling with this for a while now and I can't seem to
find a way of returning a class object from a different module without
importing it.
Say I have two files:
test_a.py
class A(models.Model):
pass
test_b.py
class B(models.Model):
def get_a_class(se
Ok this solution worked for me :):)
{{{
from django.db import models
from django.contrib.contenttypes.models import ContentType
from django.db.models.query import QuerySet
class SubclassingQuerySet(QuerySet):
def __getitem__(self, k):
result = super(SubclassingQuerySet, self).__getit
this is more or less what I found. I will have to see how I can
implement it on my side.
http://djangosnippets.org/snippets/1037/
--
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
Thank you, this is more or less what I am looking for. I don't however
want to make the CF class an abstract class as I want to have some
common fields in there. The Idea behind this is that I want to store
custom fields (CF) for various models that a user will be defining
themselves. I do not want
Just to clarify your suggestion
In [100]: isinstance(x, CFT)
Out[100]: False
In [101]: isinstance(x, CFI)
Out[101]: False
In [105]: isinstance(e, CF)
Out[105]: True
This is not what I am looking for.
I want to know to what class the CF primary key points to. So if it's
CFT or CFI
--
You rece
I now the isinstance function but that will return the CF class. I
want to know the child class of CF for that specific primary key.
On May 6, 9:30 pm, Shawn Milochik wrote:
> This might work:
>
> http://docs.python.org/library/functions.html#isinstance
--
You received this message because you
Hi, I am not sure if this is possible but it would really help if it
is.
I have 4 classes
class CF(models.Model):
class CFT(CF):
data = models.CharField(max_length=20)
class CFI(CF):
data = models.IntegerField()
class Doc(models.Model):
name = models.CharField(max_length =
Great thanks, will definitely have a look.
--
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 group, send email to
django-users+unsubscr...@googlegroups.c
Hit the nail on the head :) Thank you very much for the quick
response. Problem solved.
--
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 group, send emai
Hi,
I am constantly running in a brick wall when it comes to deleting
records in Django. If you have one or two foreign keys it is easy to
check if they are in use, but once an application starts getting big
you can not remember which models are making use of a foreign key and
if a specific foreig
Typically I simply want to do a left join but have it as an object in
django rather than a sql raw query.
The queryset would look like.
Select
a.code as 'product_code',
a.description as 'product_description',
b.code as 'customer_code',
b.code as 'customer_description',
ifnull(
Hi,
I have a tricky one, I don't have an error but rather trying to avoid
many database hits.
I am trying to build a product database which can have different field
values per customer.
So the model would look something like this.
class Customer(models.Model):
name = models.CharField(max_le
Ok, I think I have sorted out my queryset problem, I wrote a custom
manager:
class UserBranchModelManager(models.Manager):
def for_request(self, request):
if settings.DO_BRANCH_FILTER:
return super(UserBranchModelManager,
self).get_query_set().filter(branch__pk = request.us
Just as a suggestion, if you don't need to customize the get_user()
method then simply don't have a get_user() method in your custom
authentication class.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to djang
Sorry one more thing, the above filters my querysets but then comes
the get() method on each model. I use urls with pk's so a user could
just try to change the url to a pk that does not belong to them and
view it. To filter this out I run yet another function:
def relation_branch_validation(reques
Just so you have an idea what I am trying to do. :)
I have a custom middleware that adds a userBranchID variable to each
request according to the users branch in the User model.
Now in each view when I use any queryset I have to do the following:
def filter_branch(request, queryset):
if settin
Hi Shawn,
I use Managers often to limit my querysets and add additional fields
that I want dynamically calculated using sql. I just don't see how I
can get the request object to the models.Manager so it knows what to
filter by (user.uid). :(
I know I could do a filter in each view
queryset.object
On Feb 13, 2:23 am, paul wrote:
> On Feb 12, 5:03 pm, pbzRPA wrote:
>
> > The middleware looks good. Is your browser maybe not blocking cookies?
> > I have really though hard about it, but without code it's really
> > difficult to get a picture of where the p
The middleware looks good. Is your browser maybe not blocking cookies?
I have really though hard about it, but without code it's really
difficult to get a picture of where the problem may lie. You also said
you do custom authentication, then why is it that you printing out the
request in the django
Can you please add a dump of your MIDDLEWARE_CLASSES as it is in your
settings file.
--
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 t
It's going to be difficult to help you out if you using a custom
authentication.
Take a look at this comment from the django site and tell me if you
following these rules in your custom authentication.
"""
Calling authenticate() first
When you're manually logging a user in, you must call authent
Hi,
I don't actually have a problem but rather a need for a suggestion. I
am building a web application and in order to demo the site on one
database I have a need to secure the data for each user. I have a
field in each model that is a foreign key to a unique field on the
User model. The tricky p
Hi
Does anyone know if its possible to filter a queryset by the count of
it's foreignkey or manytomany set?
For example:
class Y(models.Model):
name = models.CharField(...)
class X(models.Model):
name = models.CharField(...)
y_rec = models.ManyToManyField(Y)
class Z(models.Model):
x =
o:django-
> > users+ow...@googlegroups.com] On Behalf Of pbzRPA
> > Sent: Tuesday, December 08, 2009 7:19 PM
> > To: Django users
> > Subject: Filtering queryset using two fields in one model
>
> > Hi,
>
> > I am not sure if this is a really stupid question but ho
Hi,
I am not sure if this is a really stupid question but how can you
filter a model by comparing two of it's own fields?
for example:
class X(models.Model):
id = models.IntegerField()
new_id = models.IntegerField()
now I want to say X.objects.filter(id = new_id)
Thanks
--
You received t
Thank you for your help. I guess I will have to create temp table etc
and do it that way. It's a pity django does not provide this kind of
functionality.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users"
I think my problem is both 1 and 2. What happens when you want to use
python modules to analyse the extra field?
For Example:
Database table History:
id | Ordered | Delivered | Invoiced |
1 10 15 5
2 553
c
Thanks for you reply Mikhail,
I do use model managers but more often to get a certain defined
queryset back. Could you maybe show me a simple example of how to
implement your suggestion?
I imagine it looking something like this.
class PersonManager(models.Manager):
def get_query_set(self):
Sorry I would also like to add that I would like to sort by this field
in generic views. So results = Person.objects.filter
(compare_to_others__gte = 1).order_by('compare_to_others')
--~--~-~--~~~---~--~~
You received this message because you are subscribed to th
Hi all,
I keep running into a problem. Often when creating models for existing
databases which you can not modify, I find myself in need of quite a
few model methods. That all works fine but then when I run a view I
would like to be able to use the object mapper to filter by the method
on a model
Hi,
I am not sure if truncating the data is a good solution as the user
will be under the impression that all the text was saved whereas only
the first 255 was really saved.
You can add a max_length to your form or modelform field which will
block the user from typing more then the max length.
Hi,
Could you provide the code of your model and why you would want to use
a custom sql instead of the django model object.
Regards
Pbzrpa
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users"
On May 4, 3:07 pm, pbzRPA wrote:
> On May 3, 6:52 pm, Malcolm Tredinnick
> wrote:
>
>
>
> > On Sun, 2009-05-03 at 09:03 -0700, Thierry wrote:
> > > I have the following model:
>
> > > class Person(models.Model):
> > > person = models.F
On May 3, 6:52 pm, Malcolm Tredinnick
wrote:
> On Sun, 2009-05-03 at 09:03 -0700, Thierry wrote:
> > I have the following model:
>
> > class Person(models.Model):
> > person = models.ForeignKey(User)
> > age = models.IntegerField()
>
> > How can I set the above foreign key to be my prim
On May 4, 1:24 pm, Masklinn wrote:
> On 4 May 2009, at 12:47 , pbzRPA wrote:
>
> > I would do the following.
>
> > from django.http import HttpResponseRedirect
> > from django.core.urlresolvers import reverse
>
> > def deleteItems(request, item):
>
>
I would do the following.
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
def deleteItems(request, item):
return HttpResponseRedirect(reverse('app.views.showItems'))
--~--~-~--~~~---~--~~
You received this message bec
I would like to know if anyone knows how to create custom operators
for querysets.
Currently you can do something like:
foo.objects.filter(myfield__icontains = x)
I would like to add my own operator so I can do something like:
foo.objects.filter(myfield__converttext = x)
where "converttext" w
Found a solution for my problem. There is a patch that you can
download so that you can reference other worksheets.
https://sourceforge.net/tracker/index.php?func=detail&aid=1687510&group_id=134081&atid=730645
Hope it helps.
PB
--~--~-~--~~~---~--~~
You receive
Good day,
I am getting an error when trying to parse a VLOOKUP formula to Excel.
ws1.write(row_num, 8, Formula("VLOOKUP(G2;Discounts!A2:B28;2;0)"))
It seems to have a problem with the exclamation mark. Any hint would
help.
Thank You
PB
--~--~-~--~~~---~--~~
Yo
45 matches
Mail list logo