Good point re: if I can upload it to tmp, surely I can delete it. I'll
give that another crack.
Kenneth,
It doesn't delete it from tmp by default in my case, which is why
they're on my back. Turned out there were 40,000 files in there, they
were a bit pissy.
My script that saves it where I defin
Yeh, understood. It's saving a copy of the file to the directory set
by "upload_to", which is where I'm getting the file to push toward S3.
But alongside this it seems to be storing a copy of the file in the
servers '/tmp' directory, this is the step I need to skip or similar.
I'm getting my ass ki
I can't get access to the servers own tmp path, only my own "/home/
72999/data/tmp" which the file isn't saving to.
Madness.
--
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
Forgot to mention, my files are all under 20k.
Very small JPGs.
Cheers,
Danny
--
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 to
d
Hey there,
Is there any way to skip saving a file to the /tmp directory on a
server?
I got in a lot of trouble from my host when they found 10,000 files
just sitting there from a Django script I'd been running to import
book covers from an API.
So far, the guts of my save code are:
Save the file
Heya,
I'm trying to modify the content-type of a page to play an MP3.
Basically, instead of pointing directly to an MP3, I'm pointing to a
view in Django to add some stats to the database etc, after all that
baloney is done, I want to go ahead and stream the track.
Is there a way to do this, I f
Any ideas anyone?
I'm completely stumped ...
On Oct 30, 12:59 pm, The Danny Bos wrote:
> If helpful, here's the table structure.
>
> class ItemOwned(models.Model):
> user = models.ForeignKey(User)
> item = models.ForeignKey(Item)
>
> class It
title = models.CharField(max_length=50, unique=True)
On Oct 30, 11:52 am, The Danny Bos wrote:
> Hey there, I've got the below query, generating the below JSON. But I
> want to group them by "setId", can I do this in my query or in
> views.py to create a JSON file like the
Hey there, I've got the below query, generating the below JSON. But I
want to group them by "setId", can I do this in my query or in
views.py to create a JSON file like the one at the bottom? Regroup in
a template would be great, but doesn't work in views ...
views.py:
items = ItemOwned.objects.f
Hey guys,
In a view, is there a way to check if a search/querystring has a
number in it?
If number in string:
do this
otherwise:
do this instead ...
Any ideas?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Grou
Actually, that's no good as it craps out if there's no matching
records in CollectionUser.
Back to the drawing board ... Any better ideas?
d
- - -
On Oct 22, 9:01 pm, The Danny Bos wrote:
> Hey there, I want to loop through all items in CollectionItem
> (models.py below),
'Test: %s - %s' % (item.title, useritems.grade)
On Oct 22, 9:01 pm, The Danny Bos wrote:
> Hey there, I want to loop through all items in CollectionItem
> (models.py below), build a list of the items, then get
> CollectionUser.grade if that exists where (user=request.use
Hey there, I want to loop through all items in CollectionItem
(models.py below), build a list of the items, then get
CollectionUser.grade if that exists where (user=request.user) and it's
associated with the item in CollectionItem list.
eg:
"Item 1" - ""
"Item 2" - "Grade = 89"
"Item 3" - ""
"It
APologies for my naivety, how would I do that.
Any examples you can point me toward?
Thanks for the fast reply,
d
On Oct 20, 10:38 am, Joshua Russo wrote:
> On Mon, Oct 19, 2009 at 10:28 PM, The Danny Bos wrote:
>
>
>
> > Hiya,
>
> > In the Django Admin for t
Hiya,
In the Django Admin for the DateField I only want to display the Year
and Month as select lists. I'll default the day to the 1st every time.
Is this possible?
I want to keep the dates very simple, as I'll be adding many items
from 1900 to now. So using the current DateField calendar in Dja
Will this display all CollectionTypes even if there is no record for a
user in CollectionUserPile?
As I'd want to set a default item if there isn't, but still loop
through all Types.
d
On Oct 20, 1:35 am, Javier Guerra wrote:
> On Mon, Oct 19, 2009 at 6:53 AM, The Dan
K, I've got one for ya.
I've created a new table to handle Users latest "owned" item, how
would I get this joined data up in my views.py where I'm currently
just looping through CollectionTypes. Tables and current Query is
below:
models.py
class CollectionType(models.Model):
title = mode
.append({'start': counter, 'end': counter_end,
'selected': selected})
counter += 50
counter_end += counter_end
On Oct 11, 8:18 pm, Sam Lai wrote:
> 2009/10/11 The Danny Bos :
>
>
>
> > I had a read of that, is good but s
have, basically the record count "132".
d
On Oct 11, 7:41 pm, Daniel Roseman wrote:
> On Oct 11, 9:22 am, The Danny Bos wrote:
>
>
>
>
>
> > Heya, thanks for all the help of late, I'm about four late nights from
> > finishing my first big app I'
Heya, thanks for all the help of late, I'm about four late nights from
finishing my first big app I'm guessing.
Anyway,
I'm working on paging in my app and am completely stuck (again),
here's what I'm trying for:
eg: http://www.domainname.com/card/pokemon/0-50/
Which would obviously dis
Good point.
Here's the models I'm talking about as they're slightly different than
your aforementioned solution.
class Collection(models.Model):
title = models.CharField(max_length=50, unique=True, help_text="eg:
Pokemon, Kiss, Baseball ...")
slug = models.SlugField(max_length=50
I had a feeling this was a pain in the ass.
I might try and work out another way around it, maybe a default image
for each 'trading card' set?
d
On Oct 9, 9:54 pm, The Danny Bos wrote:
> Hey there,
>
> I'm looping through an array of 'trading card' ti
Hey there,
I'm looping through an array of 'trading card' titles. For instance:
- Pokemon
- Kiss
- Baseball
Instead of showing just the title of the 'trading card', I'd like to
display an image of each instead.
But not all images are available for every card in a title, for
instance 'Pokemon
Thanks again Mike, this solved everything.
d
On Aug 24, 1:02 pm, Mike Ramirez wrote:
> On Sunday 23 August 2009 06:48:33 pm The Danny Bos wrote:
>
>
>
>
>
> > Hey, so I've got this code to quickly create thumbnail files, below.
> > When I give it a va
Hey, so I've got this code to quickly create thumbnail files, below.
When I give it a value, it squishes the image to those dimensions, I'm
hoping to keep the correct proportions of a book instead of cropping
to a square or squashing.
Mainly as books can be portrait, landscape or square. So keep
Much nicer.
Thanks so much Mike ...
d
On Aug 24, 12:17 pm, Mike Ramirez wrote:
> On Sunday 23 August 2009 05:36:13 pm The Danny Bos wrote:
>
>
>
>
>
> > Hey there, I've got the below code.
> > Can someone help me fill in the gaps to rename the image to t
w_filename)
old_filepath = os.path.join(settings.MEDIA_ROOT, self.cover.name)
shutil.move(old_filepath, new_filepath)
self.cover.name = os.path.join('p/', new_filename)
super(Book, self).save()
On Aug 24, 10:36 am, The Danny Bos wrote:
> Hey there, I'
Hey there, I've got the below code.
Can someone help me fill in the gaps to rename the image to the
'SLUG'?
In the end I'm hoping for images like so:
...com/books/book-title.jpg
...com/books/thumbs/book-title.jpg
Here's my save() definition from models.py:
def save(self):
super(Book,
How did you solve it?
I'm having the same issue.
d
On Jul 27, 12:09 pm, nixon66 wrote:
> problem solved. Type
>
> On Jul 26, 10:05 pm, nixon66 wrote:
>
>
>
> > ran into this error. Anyone familiar with it.
>
> > TemplateSyntaxError at /lobby/lobbytype/public-relations/
>
> > Caught an excep
dels.SlugField(max_length=50)
people = models.ManyToManyField(People, blank=True)
Does that all make sense, or have I got my tables set out quite badly?
Thanks gang, again I'm still wrapping my head around this ...
d
On Jul 28, 1:59 am, Daniel Roseman wrote:
> On Jul
Heya,
I'm currently displaying an 'Article' on a page, using the below. My
tables are Article, People, Book. I'm in the 'Article' table, trying
to get a list of 'Books' based on the person "selected" in Articles,
that person needs to be the Author of the 'Books'. Dig?
# views.py
def article_deta
could rely on raw SQL I
> suppose.http://docs.djangoproject.com/en/1.0/topics/db/sql/
>
> Sorry I couldn't be more helpful here.
>
> -- Andrew
>
> On Jul 20, 10:30 am, The Danny Bos wrote:
>
>
>
> > I'm not able to use anything over Django 1.
ck, you could rely on raw SQL I
> suppose.http://docs.djangoproject.com/en/1.0/topics/db/sql/
>
> Sorry I couldn't be more helpful here.
>
> -- Andrew
>
> On Jul 20, 10:30 am, The Danny Bos wrote:
>
>
>
> > I'm not able to use anything over
core = models.IntegerField(default=3)
> > book = models.ForeignKey(Book)
>
> > Try this:
>
> > from django.db.models import Sum
> > Book.objects.filter(rating__user__is_staff=True).annotate(score=Sum
> > ('rating__score')).order_by('-score')[0:10
Hey there,
I'm looking at getting a Top 10 of all Books on a site, but only where
rated by users of a certain Group.
Here's what I've got so far:
book = Book.objects.all()
Somewhat impressive, hey?
- So, my tables/models are Book, Rating, User.
- I save all ratings in Rating like so
Hey there,
I'm looking at getting a Top 10 of all Books on a site, but only where
rated by users of a certain Group.
Here's what I've got so far:
book = Book.objects.all()
Somewhat impressive, hey?
- So, my tables/models are Book, Rating, User.
- I save all ratings in Rating like so
Hey there, this should be easy, but my code just won't play along.
I've let a logged in user Rate a music record. I'm saving it like so
'rating | user | record'. (Rating model)
What I need to do is only display the Rating form if the logged in
user hasn't rated the record yet, know what I mean.
Heya,
If I wanted to get the Average of all ratings (in a Rating table) for
a single record.
Would I use something like this:
ratings_avg = Rating.objects.aggregate(Avg('rating'))
And where does this live? In models.py or views.py and how is it
called.
I've been reading a lot about it, but some
So, I'm guessing this is impossible.
Any ideas would be great ...
d
On Jul 16, 11:52 am, The Danny Bos wrote:
> Hopefully my last question on this,
> How do I get back to the page with the form, perhaps with a "Thank
> You" message, without having the POST st
h at /records/temp-record-name/
Reverse for 'record_detail' with arguments '(u'temp-record-name',)'
and keyword arguments '{}' not found.
And even if it does get passed back to the original page, how would I
have a "Thank You" message?
Thanks again,
Russ, this makes a lot of sense, thanks so much.
I'll give it a go now ...
d
On Jul 16, 10:49 am, Russell Keith-Magee
wrote:
> On Thu, Jul 16, 2009 at 8:36 AM, The Danny Bos wrote:
>
> > Any ideas on this one guys?
>
> > I gave up on it last night.
> > I fee
Any ideas on this one guys?
I gave up on it last night.
I feel way off ...
d
On Jul 15, 11:33 pm, The Danny Bos wrote:
> Agreed, I should get used to using Forms.
> So I gave it a go, the new problem I have is out of my three fields,
> two need to be hidden and have values auto
y.
>
> You have to coerce the record_id and user_id into int before assigning
> to the model fields, for it to save.
>
> On Tue, Jul 14, 2009 at 9:45 PM, The Danny Bos wrote:
>
>
>
>
>
>
>
> > Heya, am trying to simply save 3 values to a database, witho
Heya, am trying to simply save 3 values to a database, without using
Forms.
In the Template:
Rate This: {% for n in numbers %}{{ n }}{% endfor %}
In the View:
from mysite.rating.models import Rating
def critics_rating(request):
try:
Great idea.
Don't know why I didn't think of that ...
Thanks man,
d
On Jul 15, 12:48 am, Shawn Milochik wrote:
> On Jul 14, 2009, at 10:27 AM, The Danny Bos wrote:
>
>
>
> > Is there a way to create a simple list using Django to go from 1 to
> > 50.
>
Is there a way to create a simple list using Django to go from 1 to
50.
Eg:
1, 2, 3, 4, 5 ... 49, 50
I figured it'd be easy, but I can't get it.
I tried ...
{% for i = 1 in 10 %}
{{ i }},
{% endfor %}
No go.
--~--~-~--~~~---~--~~
You re
So the Author and Illustrator tables would stay as is.
How would the Interview table talk to both of those tables at once, to
allow me to assign an interview to who I'm interviewing. Whether it's
an Illustrator, Author or even down the track a Publisher.
Like so?
class Interview(models.Model):
Hey there, this may not be appropriate, but I'm building in Django so
here goes ...
I'm creating an Interviews app/table in my Django 'Books' (test)
project. Just wrapping my head around it before I start on my music
based website ... Anyway,
For my 'Interview' table, how would I assign an inter
ManyToMany?
d
- - -
On Jul 3, 12:13 am, Daniel Roseman wrote:
> On Jul 2, 2:55 pm, The Danny Bos wrote:
>
>
>
>
>
> > K, I think I have it.
>
> > Just having trouble getting the Author loop from within my Review
> > set.
> > Here's what I h
DR.
Bingo!!
Thanks man,
And thanks for the tip on "_set" being for ForeignKeys.
d
On Jul 3, 12:23 am, Daniel Roseman wrote:
> On Jul 2, 3:20 pm, The Danny Bos wrote:> Daniel,
>
> > {% for author in review.item.author_set.all %}
> > Is what I've been u
Jul 1, 1:34 pm, TiNo wrote:
>
>
>
> > On Wed, Jul 1, 2009 at 16:59, The Danny Bos wrote:
>
> > > Hi there,
>
> > > Seems easy, but I'm having an ass of a time. I think once I wrap my
> > > head around how to do this, I'll be rolling thr
Hi there,
Seems easy, but I'm having an ass of a time. I think once I wrap my
head around how to do this, I'll be rolling through Django like it's
building sprites on a Commodore 64.
So, I have four tables. Book, Publisher, Author and Review. A classic
scenario.
I want to display a loop on the h
52 matches
Mail list logo