Hi,
I'm wondering if there is an efficient way to look-up the index of a given
object in a query-set? I'm using now the following approach:
def get_index (id):
bids = BID.objects.filter (..)
obj2idx = dict (zip (bids, xrange (bids.count ()))
bid = BID.objects.get (id=ID)
return obj2idx (bid)
Hello,
I'm curious as to how to correctly store user uploaded files to a
database in Django. I was able to do this once in my django code, but
I replicated this in another section and it doesn't work. Basically, I
have added a new field in my model: img =
models.ImageField(upload_to='folder/').
The depth of your generosity is overwhelming.
Thank you for your help. Crisis averted!
Tim
--
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,
On Sat, Mar 6, 2010 at 7:46 PM, Ilya Braude wrote:
> So perhaps a section in the documentation that talks about known quirks of
> the various DB backends could help many people.
>
http://docs.djangoproject.com/en/1.1/ref/databases/#ref-databases
Alternatively, there are
I managed to reproduce it even when the JPG is saved locally, so it is
something to do with the JPG format.
Google tells me this -
"the reason that two images don't show in IE is that they have been
saved in CYMK format instead of RGB format."
Hudar wrote:
Hello, I am new to django and still go through the tutorial. Just made
a simple registration form using django and found this error :
http://dpaste.com/168746/
Below are the register function I wrote :
def register(request):
if request.method == "POST":
form =
Hey thanks Sam,
the full URL is:
http://media.bluecaravan.net/bluecaravan/view-cart.jpg
I'm testing it on IE7, and this URL just brings up a red cross.
Cheers,
Tim
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send
On 7 March 2010 12:17, timdude wrote:
> Yoyo,
>
> Why would IE not be able to see images served from templates that use
> img src="{{ MEDIA_URL }}buttons/home.png" ...when they are visible in
> other browsers...other than the fact that IE is crap.
>
> .but seriously,
Yoyo,
Why would IE not be able to see images served from templates that use
img src="{{ MEDIA_URL }}buttons/home.png" ...when they are visible in
other browsers...other than the fact that IE is crap.
.but seriously, why would this be happening?
Cheers,
Tim
--
You received this message
Masklinn wrote:
On 6 Mar 2010, at 05:43 , Ilya Braude wrote:
Karen Tracey wrote:
I'm guessing you are using MySQL That's just how it behaves, by default. See:
http://dev.mysql.com/doc/refman/5.1/en/server-session-variables.html#sysvar_sql_auto_is_null
Wow, thanks. I now see
Ok, thanks for the reply. I had wondered along those lines myself, and
changed the code to;
class elements(models.Model):
name=models.CharField(max_length=21)
elementgroup=models.ForeignKey(grouping)
class grouping(models.Model):
name=models.CharField(max_length=48)
Though now when
Hello, I am new to django and still go through the tutorial. Just made
a simple registration form using django and found this error :
http://dpaste.com/168746/
Below are the register function I wrote :
def register(request):
if request.method == "POST":
form =
url:
url(r'top25/(?P\d{1})/$', views.top25_test, name='top25_test'),
view:
def top25_test(request, poll):
entry = Poll.objects.filter(poll_id=poll)
model:
class Poll(models.Model):
PUBLISHED_STATUS = 1
DARK_STATUS = 2
STATUS_CHOICES = (
I want to find how many Resources in my dataset have no Widgets associated with
them. Resources and Widgets have a ManyToMany relationship:
class Resource(models.Model):
widgets = models.ManyToManyField(Widget, null=True, blank=True)
I finally settled on the code below, but I was wondering
Hi all,
I have some ModelForms.. This ModelForms based some ForeignKey
included models. When i want to create a ModelForm I got these
ForeignKey fields something like (in a dropdown menu) "BlaBla object".
But i want to get in that dropdown menus something like "Linus
Torvalds". I mean how can I
Hi all,
I have some ModelForms.. This ModelForms based some ForeignKey
included models. When i want to create a ModelForm I got these
ForeignKey fields something like (in a dropdown menu) "BlaBla object".
But i want to get in that dropdown menus something like "Linus
Torvalds". I mean how can I
Hi everyone, I've got few questions that my experience can't answer...
I'm not sure the best way to proceed.
I'm piggy-backing using the admin interface as a sort-of glorified
spreadsheet (accessible to everyone). I've created a model that
contains information about drivers licenses. Name,
On Mar 6, 2010, at 10:37 AM, Matthew Warren wrote:
Hi,
I have a model like the following;
class elements(models.Model):
name=models.CharField(max_length=21)
class grouping(models.Model):
name=models.CharField(max_length=48)
elementgroup=models.ForeignKey(elements)
I'm
>From what you've written, my best guess would be something like,
select car.id where car.id in (Select CarOperation.id_car where
CarOperation.status='exact') and car.id not in (select CarReservation.id_car
where GIVEN_DATE > CarReservation.ariv_date and GIVEN_DATE <
CarReservation.dep_date)
Hi,
I have a model like the following;
class elements(models.Model):
name=models.CharField(max_length=21)
class grouping(models.Model):
name=models.CharField(max_length=48)
elementgroup=models.ForeignKey(elements)
I'm assuming this means that a grouping may relate to multiple
Hello!
I have four tables:
Car(id, manufacturer, kind)
CarReservation(id, id_car, dep_date,ariv_date)
CarOperation(id, id_car, id_parking, status...)
Parking(id, street, gps)
Now I need to select cars, which are on exact parking and are not
reserved for given date..
I am totally hopelles..
On Sat, Mar 6, 2010 at 11:53 AM, Brian Neal wrote:
> Thanks Karen. Yes, I'm using Ubuntu, and running with --noreload
> allows me to see the PendingDeprecationWarning. Is this worthy of a
> bug report?
>
Sure. Just please don't put it in the 1.2 milestone; it's not a release
On Mar 6, 10:29 am, Karen Tracey wrote:
> This appears to be due to the way runserver reloads the process when
> monitoring for source code changes. If you specify --noreload on runserver
> I bet you will see the warnings. The behavior appears to be OS-specific: I
> can
On Fri, Mar 5, 2010 at 9:28 PM, Brian Neal wrote:
> Any ideas? Can anyone else try this and report back? Just insert the
> code below into a view function and start the dev. server with "python
> -Wall manage.py runserver". Thanks.
>
This appears to be due to the way runserver
On Mar 6, 2:28 am, Brian Neal wrote:
> Any ideas? Can anyone else try this and report back? Just insert the
> code below into a view function and start the dev. server with "python
> -Wall manage.py runserver". Thanks.
Hi,
Just to confirm I tried it and can't see them either,
Thanks for your answers, I don't understand why there is no id getter
or property while it is important for javascript. I think i'll
override the render method like you Sam. Thanks again !
On 4 mar, 12:17, Sam Lai wrote:
> On 25 February 2010 07:05, leoz01
I guess the aim of documaentation is to be helpful and assist the end user.
While it makes no sense to document mysql within Django, wouldn't it make
sense to document specific interactions between Django and it's supported
back-end DB's that are likely to catch people out? - maybe just as
AND THE ANSWER IS :
[...]
if formset.is_valid():
# do something with the formset.cleaned_data
cd = formset.cleaned_data
for i in range(len(cd)):
cd[i]['answer'] = cd[i]['x'] + cd[i]['y']
formset = ArticleFormSet(initial=cd)
[...]
--
You received this message because
On 6 Mar 2010, at 05:43 , Ilya Braude wrote:
>
> Karen Tracey wrote:
>> I'm guessing you are using MySQL That's just how it behaves, by default. See:
>>
>> http://dev.mysql.com/doc/refman/5.1/en/server-session-variables.html#sysvar_sql_auto_is_null
>
> Wow, thanks. I now see that this has been
Hello everyone,
I am trying to use datetime picker from django.contrib.admin
I am succesful, but my picker has no style. I see only numbers, but no
border, background..
html(shortened)
Find parking
{% block stylesheet_extra %}{% endblock %}
30 matches
Mail list logo