I have the following code in model manager
class SpotMessageManager(models.Manager):
def for_user(self, user, start = 0, end = None, friends ):
messages = self.filter(user = user).order_by
('date_added').reverse()
...
friends is a list of users, and I want the
heya,
I've got a small project involving an ordering system web application.
One of the requirements is offline functionality (i.e. it will
function without a direct internet connection, at least on a limited
scale - e.g. they can search their previous orders, and submit orders,
with a cached
Thanks for replying, Joost,
I tried changing my settings to mirror the settings of someone else in
a previous tiny mce post:
So I moved the files. In the "mycode" directory, which contains my
project "mysite" dir, as well as one I created called "static_media"
which has js/tiny_mce, etc. in
Hi ,
I have 2 separate django websites/projects. They also have some common
reusable django apps. I would like to "bridge" these 2 websites so as
one is the maindomain.com and the other appears as a
subdomain.maindomain.com. In main domain there will be a href and
hence redirected to
Problem description:
Suppose there is an ExercisePlan record (set=3, reps=12), which means
that this exercise should be done with 3 sets and the trainer suggests
to repeat the exercise about 12 times in each set. Here is the
ExercisePlan table data in db:
id | sets | reps
I think this is what you need:
http://docs.djangoproject.com/en/dev/ref/models/querysets/#only-fields
On Aug 22, 1:43 pm, Hanpan wrote:
> Am I right in saying that .values() won't span across joins though? I
> have a many-to-many field which I would like to retrieve
Well...I don't know what happened but I have put my loop back in and
now it works. I cannot get the problem to reproduce. I must have had
something out of place but I don't know what, but it works now which
is what I need.
So again thanks for your help.
Andrew
On Aug 22, 7:27 pm, Andew Gee
So I'm trying to get my head around making my small, tightly focused
apps reusable. I've done this, but right now still have
"dependencies" between one another, that I'd like to remove. For
simplicity sake, I have an Articles, Events, and Photos app.
Right now each Article has a photos.photo
Hi,
while translating a site, I wonder if there is something that keeps
care of all national formats and encodeings like:
- money symbol ( pre or post sign)
- number format
- date format
- etc.
-- Hinnack
--~--~-~--~~~---~--~~
You received this message because
Done. thanks Heather and all of you who helped me achive when I was
looking for..
Thanks a ton..
On Aug 22, 6:44 am, Heather wrote:
> I think this is what you're looking for then...
>
> in your httpd.conf or httpd-vhosts.conf or wherever you set up django
> in apache:
>
>
>
cursor.execute("SELECT a,b,c FROM Table_Name WHERE a = %s AND b = %s ",
[string1],[string2])
gives me the following error:
TypeError: execute() takes at most 3 arguments (4 given)
Where did i go wrong?
--~--~-~--~~~---~--~~
You received this message because you
I have experienced this same issue, and that link didn't really help.
I am trying to hook into a legacy database using "inspectdb", and I
can't index the tables.
class Character(models.Model):
guid = models.IntegerField(primary_key=True)
name = models.CharField()
...
...
For reference:
http://google-ctemplate.googlecode.com/svn/trunk/doc/auto_escape.html
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to
On Aug 22, 7:35 pm, Robb Bossley wrote:
> Daniel,
>
> I appreciate the time you took to answer.
>
> I could do this, but I have a number of views that the user will have the
> option of selecting on this resulting page, so I would have to keep passing
> it as a GET
On Aug 22, 8:29 pm, justin jools wrote:
> key is used in replacement of 'id' in Google app engine (patch)
> Essentially this doesnt matter, assume it is id in normal django.
> I would just like to know how to do a list, list, detail query. When I
> pass the id from
Alright, thanks
Vitaly Babiy
On Sat, Aug 22, 2009 at 12:31 PM, Andy McKay wrote:
>
>
> On 22-Aug-09, at 7:50 AM, Vitaly Babiy wrote:
>
> > Hey,
> > I am working on a site that part of it must be behind HTTPS, is
> > there any I can run this using the test server?
>
> The
Can anyone give a method/example for doing drill down category
queries: list, list, list detail
I'm writing car database. With make, type, model as seperate tables.
model containing all the details.
essentially
1st choice could be: make: Audi, BMW, Ford
2nd BMW: 200 series, 300 series...
3rd
key is used in replacement of 'id' in Google app engine (patch)
Essentially this doesnt matter, assume it is id in normal django.
I would just like to know how to do a list, list, detail query. When I
pass the id from first list to query a second list in a different
table: i.e. first list/table
Agreed, not sure my suggestion will help you. You can have a look at
turning off transaction, that might make your code faster but I'm
really not sure.
( Check-out those
from django.db import transaction
@transaction.commit_manually
)
- Benjamin
On Thu, Aug 20, 2009 at 9:58 PM, Doug
Daniel,
I appreciate the time you took to answer.
I could do this, but I have a number of views that the user will have the
option of selecting on this resulting page, so I would have to keep passing
it as a GET variable on subsequent requests.
Any other thoughts? (I may end up doing this if I
On Aug 22, 6:55 pm, Robb Bossley wrote:
> I have one more question to ask of all of you Django gurus - I hope it is
> simple, though I think I have pulled most of my hair out trying to get this
> down in my mind
>
> I have a form that displays four lookup values. I would
On Aug 22, 6:08 pm, justin jools wrote:
> how can I show a list then pass the id to next list lookup then
> detail?
>
> basically I'm writing a car product database with make, type and model
> tables:
>
> so first list is Audi, BMW, Ford... the next list is e.g. Audi
I have one more question to ask of all of you Django gurus - I hope it is
simple, though I think I have pulled most of my hair out trying to get this
down in my mind
I have a form that displays four lookup values. I would like to append
these values to the url (versus setting these variables as
On 22 Aug 2009, at 19:26 , Robb Bossley wrote:
> Thank you all - I had not realized I could use the __gt feature.
>
> And I believe that you are right, Andy.
>
Also, note that you don't *have* to chain the `filter` calls: a single
filter can take multiple arguments
I figured it out:
#MEDIA_URL = 'http://localhost:8000/testproject/site_media/'
MEDIA_URL = '/site_media/'
On Aug 22, 8:57 am, robinne wrote:
> I'm new to Django and I cannot seem to get all the settings correct to
> allow me to view images in the development
Thank you all - I had not realized I could use the __gt feature.
And I believe that you are right, Andy.
Thanks again!
Robb
On Sat, Aug 22, 2009 at 12:30 PM, Andy McKay wrote:
>
> On 22-Aug-09, at 9:20 AM, Matthias Kestenholz wrote:
>
> Some.object.filter(id =
how can I show a list then pass the id to next list lookup then
detail?
basically I'm writing a car product database with make, type and model
tables:
so first list is Audi, BMW, Ford... the next list is e.g. Audi models:
T100, Quattro, then last selection is detail.
I used this view model and
On 22-Aug-09, at 7:50 AM, Vitaly Babiy wrote:
> Hey,
> I am working on a site that part of it must be behind HTTPS, is
> there any I can run this using the test server?
The built in django server does not do HTTPS. Use Apache or some other
server to serve HTTPS
--
Andy McKay
On 22-Aug-09, at 9:20 AM, Matthias Kestenholz wrote:
>> Some.object.filter(id = var1).filter(value =
>> var2).extra(where=['Cost>%s'], params=['var4'])
Follow Matthias advice, below.
But for the record you've put 'var4', instead of var4, so you are
passing a string which MS SQL doesn't
Robb,
On Sat, Aug 22, 2009 at 6:06 PM, Robb Bossley wrote:
> In the course of writing this program, I have run into a challenge with
> regard to the way that things are retrieved and displayed. The problem is
> as follows:
>
> #"var3" is passed in from the following
>
Has anyone here ever written an application that needed to be able to
take a date field where the month or day was sometimes but not always
known? How would you handle this? Using separate day/month/year
fields instead of a DateField seems to sacrifice a lot of convenience
and usability.
All,
First of all, I would like to thank the developers of Django - this piece of
software is truly genius!
I am in the process of using Django to create a web portal for the
international company that I work with. If accepted, it will mean that open
source technologies are beginning to be
I'm new to Django and I cannot seem to get all the settings correct to
allow me to view images in the development environment. Here is what I
know (I'm developing on Vista):
For internal server to serve images, you have to configure django
settings, so here is what I've done.
[My actual path to
heya,
Yeah, I figured it was leveraging on django-tagging - awesome to hear
they just made a new release as well =). I thought the project had
stagnated or something...lol.
However, I assume there's a bit more to his app - both in the entry
side of things, as well as in the way it's
Hey,I am working on a site that part of it must be behind HTTPS, is there
any I can run this using the test server?
Thanks,
Vitaly Babiy
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post
If you need it only for one particular form, you can also override
clean_():
---
import Image # PIL
class UserProfileForm(ModelForm):
class Meta:
model = UserProfile
# Model UserProfile has an ImageField named avatar.
def clean_avatar(self):
Am I right in saying that .values() won't span across joins though? I
have a many-to-many field which I would like to retrieve somehow.
On Aug 22, 12:18 pm, Tim Chase wrote:
> > How do I tell Django which fields to select from my database? It seems
> > to always
How to make it with nice way?
I do override with stupid way:
http://dpaste.com/83943/
Anyone have better idea?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email
http://docs.djangoproject.com/en/dev/topics/forms/modelforms/#using-a-subset-of-fields-on-the-form
Good luck!
-ld
On Aug 21, 3:49 pm, goobee wrote:
> hi there
>
> I'm in dire need of a good idea. django drives me crazy with its
> foreignkey-resolver.
>
> class
> How do I tell Django which fields to select from my database? It seems
> to always use SELECT * FROM, which isn't ideal since I don't need all
> the extra data for my project listing page, just the 'title' and
> 'slug' field.
read up on the .values() method.
-tkc
I know this is probably really simple, but I have lost hours trying to
figure it out.
How do I tell Django which fields to select from my database? It seems
to always use SELECT * FROM, which isn't ideal since I don't need all
the extra data for my project listing page, just the 'title' and
I believe it wa the last of your suggestions, I was wrinting out the
fields of the main form individually and somehow they must of been
overwriting the inlineforms fields. I removed the loop that was doing
the main form and just used the form object and it worked. So i need
to go back and look
Thank you!
I will youse TiNo's solutions. The resize feature is huge!
On Aug 21, 6:10 pm, Alex Gaynor wrote:
> On Fri, Aug 21, 2009 at 3:50 AM, TiNo wrote:
> > On Fri, Aug 21, 2009 at 10:40, Léon Dignòn wrote:
>
> >> Hello,
>
> >>
2009/8/22 Jan Hülsbergen :
>
> The root directory of your Django project should be in sys.path
> anyway, so a simple 'import local_cms_settings' should just work. Even
> if not, putting the directory into sys.path is much less evil/hacky
> than using exec/eval.
my project is on
On Sat, Aug 22, 2009 at 7:53 AM, Andew Gee wrote:
>
> Thank you for your help.
>
> I have managed to get the inlineforms to reproduce on my page, however
> when I submit the form the extra inlines are ignored. I have printed
> the formset when it hits the view and the new
Thank you for your help.
I have managed to get the inlineforms to reproduce on my page, however
when I submit the form the extra inlines are ignored. I have printed
the formset when it hits the view and the new lines that I have added
have no values in them, the values that I enter in are not
46 matches
Mail list logo