I've defined a custom manager for some of my models (similar to, but not
exactly like filtering by settings.SITE_ID).
Unfortunately, the Model's manager doesn't seem to get used in the
admin interface?
from myapp.company.managers import CurrentCompanyManager
class Person(models.Model
Hi,
i have a class with an imagefield.
I'm trying to add the current logged in user to the path where the image
field is saved.
image = models.ImageField(upload_to="img/_USER_/icons/", blank=True )
_USER_ is a placeholder for the "real" user.
def add_icon(request):
IconForm = forms.models.f
I had an data import task for django application. Client moved data
from several databses into new one. All legacy databases had same
model, so there was proper django model created for them. And I had
problem with importing data from all those legacy system. I've sniffed
a bit and on the base of
Thank you Kai,
I really appreciate the time you put in to help me with that, it had
me puzzled because all this time I was looking for something wrong
with my fixture or result classes when it fact it had nothing to do
with them, it was due to my last class called SquadSelector as shown
below:
cl
Ooops I realise you can use a verbose name on a foreign key field you
must just use verbose_name="xxx"
e.g. Poll = models.ForeignKey(Poll, verbose_name="the related poll")
On Mar 5, 9:16 am, "DuncanM" <[EMAIL PROTECTED]> wrote:
> Thank you Kai,
> I really appreciate the time you put in to help me
Chris Moffitt schrieb:
> I've implemented a similar hierarchy for categories in Satchmo using
> elementtree. You can see my example here-
> http://www.satchmoproject.com/trac/browser/satchmo/trunk/satchmo/shop/templatetags/category_display.py
But you have html code in your programm. (The und
hi all,
sorry to bother u ppl for the second time in a day . in my application i
have foreign key relationship which is shown as a drop down list box. but in
my application it contains some 2000-3000 entries . so i tried to display in
other format . but it seems that a foreign could only be displa
On Mon, 2007-03-05 at 10:31 +0100, Jens Diemer wrote:
> Chris Moffitt schrieb:
> > I've implemented a similar hierarchy for categories in Satchmo using
> > elementtree. You can see my example here-
> > http://www.satchmoproject.com/trac/browser/satchmo/trunk/satchmo/shop/templatetags/category_di
On Monday 05 March 2007 09:42, Benedict Verheyen wrote:
> Hi,
>
> i have a class with an imagefield.
> I'm trying to add the current logged in user to the path where the image
> field is saved.
> image = models.ImageField(upload_to="img/_USER_/icons/", blank=True )
>
> _USER_ is a placeholder for t
We are developing a few Django projects. The development versions are
accessible in the local network under some directories of the local
server's IP (i.e. http://1.2.3.4/example/) and the published versions
are accessible under some domains directly (i.e. http://example.com/).
If you have a simi
It's not so hard to do recursion using templates as well as without them.
1. Write a template tag that takes one menu item as a parameter. I
don't have enough time to write the whole tag this time, but the
example usage should be like this:
{% load recursive_menu %}
{% menu root_category %}
2. It
Maybe this could help you:
http://www.djangosnippets.org/snippets/16/
Regards,
Aidas Bendoraitis [aka Archatas]
On 3/3/07, Patrick <[EMAIL PROTECTED]> wrote:
>
> Hi, I'd like to create a website log, similar to the log found in
> django.contrib.admin and was wondering if anyone has thought about
I have some classes related to football (soccer),
I have Player, Team, Fixture, Result, Squad, Squad Selector,
Appearance and Scorer classes. They way I have modelled it is that A
player belongs to a squad, and each team is picked from a squad (e.g.
a squad may consist of 30 players but a team wi
HOT PICS OF BOLLYWOOD ACTRESS
http://bollywoodactress.blogspot.com
--~--~-~--~~~---~--~~
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 unsubscrib
hi,
I have two models:
Child(models.Model):
name = CharField
Sponsorship(models.Model):
name = CharField
child = ForeignKey(Child)
...
how do i get a list of all children who are not in Sponsorship?
--
regards
kg
http://lawgon.livejournal.com
htt
Hi Duncan,
On 3/5/07, DuncanM <[EMAIL PROTECTED]> wrote:
> [Class description]
>
> The squad selector also has a foriegnkey on fixture, but also has 16
> other fields that are all foreignkeys on player.
>
> [SquadSelector class]
>
> Now I have a few queries/questions.
> 1.)As you can see from the
Hi,
* Patrick <[EMAIL PROTECTED]> wrote:
> Is there a way to take the logging features in admin app and customise
> them for my site, or is it coupled too tightly with the admin section to
> even take that route?
I think there's a full-history branch in the svn. But I don't
know if it's actively
Jarosław Świerad schreef:
> On Monday 05 March 2007 09:42, Benedict Verheyen wrote:
>> Hi,
>>
>> i have a class with an imagefield.
>> I'm trying to add the current logged in user to the path where the image
>> field is saved.
>> image = models.ImageField(upload_to="img/_USER_/icons/", blank=True
On 2/25/07, James Bennett <[EMAIL PROTECTED]> wrote:
If there's a bug that's been annoying the heck out of you and you want
> it fixed before the release, this would be the time to speak up about
> it. We have a fairly high concentration of Django developers all in
> one place with nothing to do
Hi all,
I've been trawling through django code and i'm beginning to hit a
brick wall on this one. I want to create a view to edit and create a
bunch of objects. Edit those which exist and (optionally) add those
that don't.
I have for the purposes of this discussion, four classes, Project,
Group,
I had the same issue in the past.
There's a bug in the django code and a ticket was already scheduled.
Before 0.96, that by the way seems to improve a lot the admin class
providing more hooks to customize It, you can add a row in your Admin
class code that says:
manager=myCustomManager()
Hope I
English
I need a help of a person whose mother tongue is English.
Would you please record the pronunciation of the following name and
send it to the following address?
[EMAIL PROTECTED]
Aaron (US)
Adie (Australian)
Archambault (US)
Argyll Robertson (Scottish)
Auer (US)
Ayre (US)
Branham (US)
Cim
> I have two models:
>
> Child(models.Model):
> name = CharField
>
>
> Sponsorship(models.Model):
> name = CharField
> child = ForeignKey(Child)
> ...
>
> how do i get a list of all children who are not in Sponsorship?
AFAIK, for any sort of efficiency,
Django Users:
I am just getting started with Django, and have worked through the
book and most of the documentation. So far, so good.
I recently started reading the daily change log on the Trac SVN wiki.
I probably shouldn't be doing that. It seems to me that Django is
about to undergo some sig
Cjl,
After playing with Django for the last month or so, I would sugest you just go
with trunk/. My Method of operation is syncing with trunk/ each time I make a
update to my website and run my tests. I have yet to see my site brake
because of updates to trunk. They are pretty careful not to b
On 3/5/07, cjl <[EMAIL PROTECTED]> wrote:
> After browsing through the Django Users and Django Developers groups,
> I started to wonder which branch I should be using as I learn.
I'd recommend starting on trunk and maybe sticking to 0.96 once it's
released. After 0.96 there will be some big chang
I've had issues as of lately with runserver hanging upon using it for
the dev server. I've been unable to diagnose this myself so here's my
plea :)
The issue seems to be on the system as a whole, and I've tried going
through the list of middleware and context processors and none of that
seemed to
Hi all,
I have a list of wiki pages, each one has a category.
I want to output them in a list, grouped by category.
So far I am looping through each page and putting them into a dict, so
the end result looks like this :
{'category_name': [page1,page2,page3],}
Now I want to loop round that in
Actually, after a nice strong cup of coffee, I figured I was doing this
completely the wrong way. I added a get_pages method to the category
which returns a queryset, then I supply the categories to the template
and let the template ask the category for the pages.
Mike
On 3/5/2007, "Mike H" <[E
To expand on this, sometimes the pages load as they would on our live
environment, but it randomly (and happens most of the time) hangs to
where it takes up to a couple minutes to load a page.
On Mar 5, 9:14 am, "David Cramer" <[EMAIL PROTECTED]> wrote:
> I've had issues as of lately with runserv
Sending out the probe: I'm currently involved in a new web startup and
we've decided to use Django as our development platform. Are there any
Swedish Django developers out there, preferably in the Stockholm-
region?
Please let me know by e-mail -- it would be more than interesting to
have a littl
You don't need to put each page into a dictionary.
Just loop through the categories in the template and then get all the
child pages for each category:
{% for category in categories %}
{{ category }}
{% for page in category.page_set.all %}
{{ page }}
{% endfor %}
> To expand on this, sometimes the pages load as they would on our live
> environment, but it randomly (and happens most of the time) hangs to
> where it takes up to a couple minutes to load a page.
If you disable CSS (or expand all of the collapsed sections of
the traceback), are you getting a
Hello, im very new to django and python, I've read the tutorials and
the django beta book, but there is one thing I dont see covered and I
need to know hot to do it for a project, any help is welcome.
The main problem is that I dont know how can I upload a file to the
server to be procesed using s
I riffed off those directions and the Zyon's code, but I found that the
Zyon's code really didn't help me that much - I think it was written to an
earlier version of the openID libraries from Janrain.
Anyway, I used the request.session and a store built in to Postgres for my
implementation. Determ
The traceback is only within the console and from broken pipe.. theres
no errors on the page :)
On Mar 5, 10:28 am, Tim Chase <[EMAIL PROTECTED]> wrote:
> > To expand on this, sometimes the pages load as they would on our live
> > environment, but it randomly (and happens most of the time) hangs
I ended up using an old fashioned form to post files with standard
python code (inside of a view though), because I didn't like the way
django handled them. I can post a sample of that if you
like .
On Mar 5, 2:06 pm, "Gerard M" <[EMAIL PROTECTED]> wrote:
> Hello, im very new to django a
You would create a custom change manipulator... and you could pass it
the main 'parent' object ... then in your flatten data routine, you
could extract all of the values for your related objects.
I don't really know what fields you have or anything..but here is some
sample code in the right direc
I would love to see that code Carole thanks a lot, and if you used
some kind of class definition to use it with the database and the view
you created I would love to have a look at that one too as well,
thanks
On 5 mar, 14:23, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> I ended up using an o
Well... I'm honestly just treating the file name in the database as a
varchar field ... because after I upload my files... I rename them
with a uniqueid, and move them to specific directories based on that
ID...but anyhow... below is the code for the basic idea... I've parsed
out some of my projec
Dear All,
I've upgraded to the svn code, but I'm still having problems with user
profiles.
I've got a method in views.py:
@login_required
def viewprofile(request):
uname = request.user.username
try:
profile = request.user.get_profile()
except User.DoesNotExist:
reque
Hello everyone,
I've run into the problem which I believe is a common use-case and is
already solved, but I can't seem to find the answer neither in
documentation, nor in django-users or django-developers.
Here it goes: how do I optimize a list query if I have null=True
foreign key in my entity?
I went with something along those lines so what I do now in my view
is (pseudo-code of course):
queryset = my_filter(SomeClass, a=a, b=b, c=c)
It's very strange to me that I need to do this, because I would
expect the creation and fetching to be symmetrical. The behavior of
"a=a" is radica
The problem with this is, when the foreignkey can be null the only way
to reference it properly is with a LEFT JOIN. Now, I'm not sure why it
isnt implemented in ORM, but I strongly encourage you to find a
differently solution, as LEFT JOINs can be VERY costly on system
resources.
On the same not
I am using jQuery to do the autocomplete. Autocomplete request
backend script like this: script_url?q=foo. But there is a problem
with django routing?
(r'^tag/autocomplete/?q=(?P\w+)/$',
'apps.tag.views.tag_autocomplete'),
Here is my error:
[05/Mar/2007 15:11:51] "GET /tag/autocomplete/?q=a
hello,
can a template invoke a method with parameters on a QuerySet object?
e.g. get(), filter(), etc.
or do i need a custom filter/tag for that?
thanks
konstantin
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
On 3/6/07, johnny <[EMAIL PROTECTED]> wrote:
>
> I am using jQuery to do the autocomplete. Autocomplete request
> backend script like this: script_url?q=foo. But there is a problem
> with django routing?
>
> (r'^tag/autocomplete/?q=(?P\w+)/$',
> 'apps.tag.views.tag_autocomplete'),
>
> Here is m
On 3/6/07, MattW <[EMAIL PROTECTED]> wrote:
>
> Dear All,
>
> I've upgraded to the svn code, but I'm still having problems with user
> profiles.
>
> I've got a method in views.py:
>
> @login_required
> def viewprofile(request):
> uname = request.user.username
> try:
> profile = req
You would want a custom tag (or filter) for that. I typically set it up to
process that through views, but most of our work is done in the views and
we've not expressed a huge amount of work in the custom tags.
-joe
On 3/5/07, akonsu <[EMAIL PROTECTED]> wrote:
>
>
> hello,
>
> can a template invo
On Mon, 2007-03-05 at 23:51 +, akonsu wrote:
> hello,
>
> can a template invoke a method with parameters on a QuerySet object?
> e.g. get(), filter(), etc.
>
> or do i need a custom filter/tag for that?
You won't be able to pass arguments to the method call if you just
called it in a templa
On Mon, 05 Mar 2007 12:33:09 +0100, Aidas Bendoraitis wrote:
> Maybe this could help you:
> http://www.djangosnippets.org/snippets/16/
>
> Regards,
> Aidas Bendoraitis [aka Archatas]
>
> On 3/3/07, Patrick <[EMAIL PROTECTED]> wrote:
>>
>> Hi, I'd like to create a website log, similar to the log
I think maybe you can hook the pre_save() signal to do this thing.
--
I like python!
UliPad <>: http://wiki.woodpecker.org.cn/moin/UliPad
My Blog: http://www.donews.net/limodou
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Goog
I'm building up menus in django, and wanted a construct like this:
{% for item in menu %}
{{item.label}}
but that doesn't work, because there's no view "item.view"
so point 1, looks like a shortcoming in the syntax of the URL tag.
With most tags, an unquoted item gets looked up, and a quoted it
My solution is this: I've ripped out some stuff
from the old admin code and written AppLogModel
with three methods:
def add(self, request):
def remove(self, request):
def update(self, request):
The add/update methods call save() and remove
calls delete(). Each method invokes a log
On Mon, 2007-03-05 at 18:29 -0800, yary wrote:
> I'm building up menus in django, and wanted a construct like this:
>
> {% for item in menu %}
> {{item.label}}
>
> but that doesn't work, because there's no view "item.view"
>
> so point 1, looks like a shortcoming in the syntax of the URL tag.
>
I think signals will be easier, if you also want to record delete
information of a record, you can also hook pre_delete, the pseudo code
is:
from django.db.models import signals
def pre_save(sender, instance, signal, *args, **kwargs):
if instance.id:#update
state = 'change'
I'm currently putting together my first calendar view for a website.
Initially, I thought that creating a basic "Event" model with a single
DateField would be good enough, but after thinking about it, realized
that without some basic "Repeat" functionality, it'll become useless
pretty quickly.
Fo
would work - but isnt there some djangoistic way of doing it?
On Mar 5, 5:42 pm, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote:
> hi,
>
> I have two models:
>
> Child(models.Model):
> name = CharField
>
>
> Sponsorship(models.Model):
> name = CharField
> child =
On Mon, 2007-03-05 at 18:12 +0530, Kenneth Gonsalves wrote:
> hi,
>
> I have two models:
>
> Child(models.Model):
> name = CharField
>
>
> Sponsorship(models.Model):
> name = CharField
> child = ForeignKey(Child)
> ...
>
> how do i get a list of all childr
You could try adding some javascript to your page to filter the drop
down based on specific criteria just a thought but when
something has that many entries (not sure what your app is) ... seems
like maybe they should be categorized...then have the person choose a
category first.
On Mar
HOT PICS OF INDIAN BABES
http://bollywoodactress.blogspot.com
--~--~-~--~~~---~--~~
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 fro
If the goal is to write the actions to a log file, limodou's
recommendation for using signals is easier to implement. I'm more or
less duplicating the admin approach in my application.
--
Jeff Bauer
Rubicon, Inc.
--~--~-~--~~~---~--~~
You received this message b
On 06-Mar-07, at 8:55 AM, Malcolm Tredinnick wrote:
>>
>> how do i get a list of all children who are not in Sponsorship?
>
> I'm pretty sure you can't do this at the moment with only the Django
> query functionality.
ok - anyway thanks, I thought I was losing my mind and was pretty
reluctant
Hi Filipe,
Tried to post a reply earlier but managed to screw it up. If that
never makes it, here it is again...
To configure PyScripter to debug Django interactively:
1) Install a version of PyScripter that supports remote debugging
(I'm using 1.8.0.0)
2) Select "Run->Python Engine->Remote"
Django's QuerySet objects are nice, but I always run into problem
where I need to write a real SQL query that they don't support. For
example, I wanted to sort by names in a left joined table. Sort()
won't work withou joining the table, but select_related() didn't do it
for me (since my ForeignK
Hello all
I have Problem with uploading file in Django. First time I want to use
python regular way of uploading file but it is not work by Django. As
I studied Django has "ImageField" and "FillField" but I don't really
know how I can use them, can any body help me?
Regards
Samia
--~--~-
On 3/6/07, samira <[EMAIL PROTECTED]> wrote:
>
> Hello all
> I have Problem with uploading file in Django. First time I want to use
> python regular way of uploading file but it is not work by Django. As
> I studied Django has "ImageField" and "FillField" but I don't really
> know how I can use th
On 06-Mar-07, at 1:21 PM, samira wrote:
> I have Problem with uploading file in Django. First time I want to use
> python regular way of uploading file but it is not work by Django. As
> I studied Django has "ImageField" and "FillField" but I don't really
> know how I can use them, can any body
68 matches
Mail list logo