hello again. thanks for all the help that everyone has offered me
here.
I have a generic django application called categories and it serves to
provide categories for various apps suchas a weblog or an articles
application. So a weblog and article app both have a M2M relation to
the catergories ap
My model is something like this,
class Job(models.Model):
name = models.CharField(...)
class Entry(models.Model):
job = models.ForeignKey(Job)
hrs_worked = models.IntegerField()
Now I want to get the sum of the hours worked in a job which I can get
by summing Entries for that job.
somet
my purpose is to cache the whole site for anonymous and cache serveral
view for registered user also.
first, i set these in per-site cache in settings.py:
CACHE_BACKEND = 'memcached://100.13.192.7:11211/'
CACHE_MIDDLEWARE_SECONDS = 600
CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True
this means only cache
ModelChoiceField. Currently not documented, but here's example code.
Use your browser's find for "ModelChoiceField".
http://www.djangoproject.com/documentation/models/model_forms/
On Jan 24, 9:47 pm, shabda <[EMAIL PROTECTED]> wrote:
> I want to use the ChoiceField to show choices depending on
I want to use the ChoiceField to show choices depending on a query
set. For exmple the ChoiceField must get all active Users and them
show them in a drop down, something like what happens in Admin. How
can I do that?
--~--~-~--~~~---~--~~
You received this message b
This is more likely a Python thing. Few understand the design decisions
behindf Python or the effects they have on deployment. For example, if
you use CherryPy which is threaded, you can borrow a lot of trouble by
trying to use ZEO with it if you do it at the wrong level. Python process
with 10
Greetings group!
I've been trying to get this code to work:
http://www.djangosnippets.org/snippets/282/
I created a templatetags folder in my app, and added __init__.py and
usertags.py. I pasted the code from the snippets site into my
usertags.py. I have a view define like this:
@login_require
1. do not want to cache the whole site
2. do not want to cache only anounymous user with this in settings.py:
CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True
so can i use:
1. @cache_page(60 * 15)
def slashdot_this(request):
to cache pages for all user
2. use this in BASE.html to cache all page for a
I'm using the urllib module to do some backend transactions. I'm
integrating paypal, and some other tools.
In using the name-value-pairs of the paypal API's express checkout, I
need to send some params to an API url.
I do it like this within a function called by a view, where nvp is a
dict of al
> Can you include the code for your CustomManager.open() method?
class OpenEntries(models.Manager):
def open(self):
now = datetime.now()
entries = super(OpenEntries,
self).get_query_set().filter(dispDate__lte=now).filter(isOpen=True)
return entries
datetime is importe
On 24-Jan-08, at 10:59 PM, Dennis wrote:
> Kenneth, that definitely wasn't my intention.
I was just kidding - obviously you wouldn't have been so grateful as
to send 10 thanks yous ;-)
--
regards
kg
http://lawgon.livejournal.com
http://nrcfosshelpline.in/web/
Foss Conference for the common
On Jan 25, 2008 6:20 AM, Javier Rojas <[EMAIL PROTECTED]> wrote:
> Hi list,
>
> I wrote a form field (newforms) that can "replicate" itself (source
> attached). Is similar to the "add attachment" field on GMail; it works
> with many django's newform fields (even ChoiceField, or IntegerField),
> an
I recieve the following error very *occasionally* from a couple of
different django apps running against Postgres (some backtrace
included for context):
File "/opt/django/trunk/django/db/models/query.py", line 188, in
iterator
cursor = connection.cursor()
File "/opt/django/trunk/django/db/b
Ok, to sum up my monologue, I've rewritten my view to something like
this (a short version):
def show_entries_for_user(request, submitted_to):
user = User.objects.get(username__exact=submitted_to)
entries = user.submitted_by.all()
for entry in entries:
entry.entry = mark_safe
Hmm, it's late now and I'm quite sleepy so I forgot to write that I
changed my view to:
def show_entries_for_user(request, submitted_to):
user_id = User.objects.get(username=submitted_to)
entries = Entry.objects.filter(submitted_to=user_id)
for entry in entries:
entry.entry =
I solved this. I was passing a string instead of number (id of the
user in user table) to submitted_to. Does anyone know if there is a
better way of doing this, like passing a username to the foreignfield?
Thanks,
Matic
On Jan 24, 2008 11:03 PM, Matic Žgur <[EMAIL PROTECTED]> wrote:
> Hello ever
Hello everybody,
I'm getting an error trying to get a QuerySet object. I've just
started to work on a small ToDo list but I can't move on since I keep
on getting "Truncated incorrect DOUBLE value: 'matic'" error.
My model for the entry looks like this:
class Entry(models.Model):
submitted_b
Hi list,
I wrote a form field (newforms) that can "replicate" itself (source
attached). Is similar to the "add attachment" field on GMail; it works
with many django's newform fields (even ChoiceField, or IntegerField),
and has an almost-decent error handling (it there is a validation error,
the va
Hmmm, now the question is, is that intended for databases that can handle
a temporary null in a foreign key? What DB are you using? I see that
Postgres gives me no grief about null=True, since it sets up as
CREATE TABLE licensing_server
(
id int4 NOT NULL DEFAULT nextval('licensing_server_id_
Hi Eric,
> Is this possible, or should I just add a layer of filtering? And can
> someone tell me where in the source code all this is going on? I tried
> tracing the progress of the query set manager myself, to very little
> avail.
Can you include the code for your CustomManager.open() method?
Hi !! How are you ? myLoveZone is a new social networking site
designed for all the people around the world. Please support us by
visiting our site.
Visit Us @ Visit http://my.lovezone.ro
Thank you very much.
--~--~-~--~~~---~--~~
You received this message because
Hmmm,
Several manufacturers, including Dell, are offering XP again. XP is to
windows as democracy is to government, very bad, but all other forms are
so much worse.
Different "flavors" of Vista have different levels of security, so it is
not surprising tht you are having a problem and someone e
> Would you be so kind to help me to solve some problems? I have some
> questions.
Good questions, as these are (I think) common problems and finding
answers in documentation is not obvious (or not even possible
sometimes).
> 1. How may I use my own field DateField (I mean not forms.DateField)
>
Hi Dennis,
On Jan 23, 2008 9:19 PM, Dennis <[EMAIL PROTECTED]> wrote:
> follow up here though. Once this is implemented you end up with the
> redirect URL looking something like this:
>
> http://mygreatwebsite.com/django_app/process/?newcontext=22
>
> Which seems okay, but I also have a couple o
Hello!
Would you be so kind to help me to solve some problems? I have some
questions.
#There is Currency and Payment classes.
class Currency(models.Model):
name = models.CharField(max_length=100)
short_name = models.CharField(max_length=3)
sign = models.CharField(max_length=1)
def
Kenneth, that definitely wasn't my intention. Google groups put up an
orange exception when I hit "send" yesterday and raised a message that
stated that my response couldn't be posted due to a system error. I
tried a couple extra times & even logged out/back in and was still
seeing the same resp
iGame2.com is a leading social network of video game culture, for
gamers to post their gaming history, favorite games, accomplishments,
blogs, news and more! Join a gamer community, create gamer profiles,
and share gamertags. Listen to the iGame2 Podcast, read game reviews,
win tournaments, and ge
> No, it is not the case that null=True is disallowed for FKs, but it
> probably should be.
I've just been reading the code in django.db.models.fields.related,
and there's a pretty clear indication that the Django developers
explicitly wanted ForeignKeys to be nullable. In the RelatedManager
cla
I thought I had understood this, but I guess not...
I've got a simple multi-user blog setup, where blog entries might have
a future publish date, or be marked "don't publish", in which case I
don't want them coming out on the site. I've done this by replacing
the 'objects' manager with a custom m
Hello, I need some help to set up an apache+lighthttpd server.
Now I have an apache server serving everything, including the media,
but I'd like to follow the suggestions of the documentation and serve
the media throught lighthttpd.
I only have one server so I must run apache and lighthttpd in the
Hi xunSir,
Personally, I can't understand your question.
You will have to get some help with english speaking because what you
wrote there is merely understandable.
Thank you,
--
David
On 24-Jan-08, at 12:04 AM, xunSir wrote:
class Person(models.Model):
PIN = models.CharField(maxleng
Hi all i use django 0.96.1 version and i'm trying to upload file to server.
Actually that is not the problem here my dropdown menus gone crazy :)
I got an error that i have not entered a valid choice ! I have did that
operation hundred times i can not understand whats wron!
Here is my code htt
Thank you very much!
On 24 Січ, 15:58, "Russell Keith-Magee" <[EMAIL PROTECTED]>
wrote:
> On Jan 24, 2008 9:57 PM, sector119 <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi All!
>
> > I get a trouble when I try to serialize object with many-to-many
> > relationship. All related objects have no values in
can anyone give me a hint on how to add a rule to make the subdirectory
redirect to a different directory under apache?
where django mod_python using the same directory.
suppose i have a dir "/dj" and have a subdir "/Web/js",
my template's js src value is "js/myscript.js",
I want the dir "/dj/js/
On Jan 24, 2008 9:57 PM, sector119 <[EMAIL PROTECTED]> wrote:
>
> Hi All!
>
> I get a trouble when I try to serialize object with many-to-many
> relationship. All related objects have no values in xml, in db
> everything is ok, why?
>
>rel="ManyToManyRel">
>
> # HERE IS NO VALUES IN OBJECTS, W
or maybe you can define a {% block customURL %} {% endblock %} in base
and define the URL later. This would be better approach over hard-coding
that in base template.
On Jan 24, 2008 6:48 PM, Nader <[EMAIL PROTECTED]> wrote:
>
> Thank you! You are right, I have to copy some templates as the
> "ba
Thank you! You are right, I have to copy some templates as the
"base.html" and the "base_site.html" which are in "django/contrib/
admin" directory to my project directory. Then I can add this link to
the "base.html" or "base_site.html" template, I don't know which one.
But I have tried it for even
Am Donnerstag, 24. Januar 2008 13:08 schrieb Tim Sawyer:
> Hi Folks,
>
> I'm just evaluating django for use on a project. I have a multiuser
> application where many users can be changing data at once.
>
> What's the status of hibernate style optimistic locking, where each object
> has a version
Am Donnerstag, 24. Januar 2008 05:02 schrieb xunSir:
> class Person(models.Model):
> PIN = models.CharField(maxlength=20, primary_key=True)
> Name = models.CharField(maxlength=20)
>
> class Burse(models.Model):
> PIN = models.ForeignKey(Person)
> Cash = models.IntegerField()
>
Hi James,
> I have hit a wall with newforms-admin, which seems obvious but I can't
> find mention of a solution anywhere.
>
> As I understand it, part of core=True was defining when the related
> object was created or deleted.
>
> eg: "The related model being edited inline must specify one or mor
Hi.
In Windows XP my python part is "C:\Python25\" and "django-admin.py"
after installation in "C:\Python25\Lib\site-packages\django\bin\".
In CMD write "cd \Python25\Lib\site-packages\django\bin\" and then
write "django-admin.py startproject mysite"
Folder "mysite" will be creat in "C:\Python25\L
Hi All!
I get a trouble when I try to serialize object with many-to-many
relationship. All related objects have no values in xml, in db
everything is ok, why?
132132
1
2008-01-24 14:51:32
# HERE IS NO VALUES IN OBJECTS, WHY?
Thanks!
--~--~-~
>
> But I would like to
> make a link in Admin page to go to other page directly.
> So I want to go the page which I want for example with the next
> statement:
>
> Go back to the Production page
>
> Where do I have to write this statement such that I can see it in
> Admin page?
>
you can do cop
Hi Folks,
I'm just evaluating django for use on a project. I have a multiuser
application where many users can be changing data at once.
What's the status of hibernate style optimistic locking, where each object has
a version and update/deletes are prevented if the last saved version of that
Never mind this, I run xml.sax.saxutils.unescape() on the appropriate
parts before putting them into the model. That seems to work.
-Björn
On Jan 24, 12:05 pm, bjornkri <[EMAIL PROTECTED]> wrote:
> I'm working on a project that reads feeds from tumblr.com and displays
> on my page. The api is a
I'm working on a project that reads feeds from tumblr.com and displays
on my page. The api is a simple xml file (http://beertje.tumblr.com/
api/read/), which I process with BeautifulSoup.
Here's a sample tumblr post:
http://beertje.tumblr.com/post/24484315";
type="quote" date="Wed, 23 Jan 2008 1
This probably isn't of much help, but I'm running vista here, I did
django-admin.py startproject testproject without any issues, certainly knows
py as executable, I'm running python 2.5.
Hope this helps,
Mat
From: django-users@googlegroups.com [mailto:[EMAIL PROTECTED]
On Behalf Of Denis
Hi All,
I have hit a wall with newforms-admin, which seems obvious but I can't
find mention of a solution anywhere.
As I understand it, part of core=True was defining when the related
object was created or deleted.
eg: "The related model being edited inline must specify one or more
"core" field
Hi,
I think Windows does noch have this feature on the command-line.
Type "python django-admin.py startproject testproject".
If your Python-installation is in the path, it will run.
On Jan 24, 2008 9:46 AM, mtnpaul <[EMAIL PROTECTED]> wrote:
>
> Well I got a new laptop that has vista on it (no
Hallo,
I have a question, maybe the answer is very easy but I don't know how
I can solve that.
I have a project which has some applications. I have used the "Admin"
class in each application to do the "CURD" easily. But I would like to
make a link in Admin page to go to other page directly.
So I
Well I got a new laptop that has vista on it (not my choice). I'm
trying to install django, but keep getting the same strange message
when I try to create a project
C:\>django-admin.py startproject testproject
results in the following
Type 'django-admin.py help' for usage.
I've tried both pytho
51 matches
Mail list logo