I've got a real stumper. Well, a stumper for me; I'm hoping someone
has some insight. Here's the view I'm calling:
def season_schedule_month(request, league_slug, year, month):
"""Given a league slug, retrieve the season's schedule
month by month.
return date_based.archive_month(
> b = Book.objects.get(id=1) #new book
> request.user.get_profile().shelf1.add(b) #add book to shelf1
> request.user.shelf1.remove(b) #remove from shelf1
> request.user.shelf2.add(b) #add to shelf2
Looks like you're trying to add the foreignkey to the User model
instead of the
What is the error message you are receiving?
R.
--
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
If the file can be parsed you could setup a script to read the file
and use the get_or_create query to add new entries.
R.
On Nov 12, 10:31 am, bowlby wrote:
> Is there a way to periodically import content to Django by means of
> uploading a file of some sort?
>
> The use
Is your form variable the problem? Based on using f.is_valid() the
code prior to this should be:
f = *YourFormObject*(request.POST)
R.
On May 23, 12:07 am, Rex <rex.eastbou...@gmail.com> wrote:
> On May 22, 4:33 pm, "R. Gorman" <r.m.gor...@gmail.com> wrote:
>
You are correct in your understand that .is_valid() returns False if
the data is invalid. Are you sure you are not processing data
irrespective of whether the data validated or not? A little more
detail on how your processing your data might provide some insight.
R.
On May 21, 10:48 pm, Rex
As the previous post mentioned, I'm assuming that is a unix timestamp.
The module you want to use is datetime.
import datetime
mysql_date = datetime.datetime.fromtimestamp(1219848914)
mysql_date can be save directly to a datetime model field. However, if
you are wanting the date formatted as
You can control database connections and transactions using
transaction management:
http://docs.djangoproject.com/en/dev/topics/db/transactions/
On May 22, 7:41 am, "m...@nysv.org"
wrote:
> Hi!
>
> I'm using python-processing to run things in parallell based
> on
I do not see any reason why the models you have provided would behave
in that manner. I would suggest posting the view you are using to
return the records.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django
Treebeard is another option.
http://code.google.com/p/django-treebeard/
I'm sure between mptt or treebeard, you'll find something suitable.
R.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
There's also Google visualizations (http://code.google.com/apis/
visualization/). They have a python library that can easily interact
with Django (http://code.google.com/apis/visualization/documentation/
dev/gviz_api_lib.html).
--~--~-~--~~~---~--~~
You received
Your likelihood in resolving this issue would be much higher if you
include your code (urls.py, form html, etc.)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email
If it's for the admin interface the admin option ordering (http://
docs.djangoproject.com/en/dev/ref/contrib/admin/#ordering) might do
the trick.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
The easiest answer is your foreignkey is pointing the wrong way. With
your current model definitions you could do
MediaAndContainer.objects.select_related('name'). To go in the
opposite direction you need to use _set (http://docs.djangoproject.com/
If that's an exact copy, you have a typo in your URL variable; you're
missing a / after CSserver.
R.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to
Just an idea, but what about using a user profile and then using the
get_profile function?
ex.
{% if user.get_profile.customer %} customer block {% endif %}
R.
On Feb 9, 11:01 am, Alfonso wrote:
> I'm wondering, I can easily add a if statement to detect whether a
>
You're likely going to need to need to run to urlencode function
within the view that processes your ajax request. Should be able to
import using 'from urllib import urlencode' and then 'urlencode(*your
string variable*)'.
R.
--~--~-~--~~~---~--~~
You received
I ran into the same issue, but different encoding. I found that
adding a special comment line to the beginning of the python file
allowed for the desired encoding (source: 2.2.3 from
http://www.python.org/doc/2.5.2/tut/node4.html).
Hope that helps,
R.
It is also possible to use a cronjob to initiate a script to send an e-
mail.
--~--~-~--~~~---~--~~
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
The request data is available in your views as a dictionary. For
example:
def memberView(request):
if request.method == 'POST':
request.POST['foo']
...
R.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django
The request object is accessed in your view.
def memberView(request):
--~--~-~--~~~---~--~~
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
Here's a third option that I've found useful when wanting to run a
cron job:
http://blog.capstrat.com/articles/making-django-environmentally-friendly/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users"
Oh the weight of various risks...
If you're just looking to execute a command and the response is quick
an os.system command in a view might work. If it's a longer running
process you might want to look at subprocess.
R.
--~--~-~--~~~---~--~~
You received this
You would probably be better off writing a custom template tag (http://
docs.djangoproject.com/en/dev/howto/custom-template-tags/#howto-custom-
template-tags).
R.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
You could use {{ for obj in A.a_set.all }} and print out the
{{ obj }}.
R.
--~--~-~--~~~---~--~~
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
The is a view I have to search some of my models:
def search(request):
query = request.GET.get("s", "")
q = Q()
for term in query.split():
q |= Q(abstract__icontains=term) | Q(next_field__icontains=term)
results = [i for i in
If it only happens some of the time it often indicates you need to
restart your http server.
R.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to
Post your template code as well.
R.
--~--~-~--~~~---~--~~
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 from this group, send email
get_or_create
http://docs.djangoproject.com/en/dev/ref/models/querysets/#get-or-create-kwargs
R.
On Sep 22, 7:55 pm, John M <[EMAIL PROTECTED]> wrote:
> Is there a method I can call in a view that given a key, it checks to
> see if that object exists and if it does returns that object, or if
I'm not 100% sure I understand your question, but I believe you're
asking how to pass the model object to the view that will verify if
the request was made by a certain user. If so, you should look at
using the url template tags (http://docs.djangoproject.com/en/dev/ref/
As you guessed, the abstraction layer can take care of *most* code.
Because it is possible to write custom SQL commands it would be
possible to have code not compatible with all database types. Beyond
that exception though, you should be fine.
R.
<[EMAIL PROTECTED]> wrote:
> On Sep 17, 4:54 pm, "R. Gorman" <[EMAIL PROTECTED]> wrote:
>
> > Glad to hear you have some of your setup up and running.
>
> > Your comment on defining fields in the models surprised me though.
> > All the fields
If there is data you would like available to every template you want
to look into context processors. There's a good tutorial for it here:
http://www.b-list.org/weblog/2006/jun/14/django-tips-template-context-processors/
R.
--~--~-~--~~~---~--~~
You received this
Glad to hear you have some of your setup up and running.
Your comment on defining fields in the models surprised me though.
All the fields for your models in Django should start with model,
followed by the field-type, as the documentation states. Are you sure
you have models module being
"@login_required(redirect_field_name='next')" statement in views.py
>
> I'm very confused.
>
> What can I try?
> There is any documentation about an entire site under access control?
>
> Thanks
> Mirto
>
> R. Gorman ha scritto:
>
>
>
> >
What is in your urls.py file? That's where your urlpatterns should be
stored.
R.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to
Ah, I see. I didn't see that on the first read through - I think I
need a nap. Your URLs are lacking the /djmsb/ because that's how you
currently have your url.py patterns setup. You just need to add
'djmsb/' to the front of your urls:
from django.conf.urls.defaults import *
from
>
> > try:
> > return
> > self.system_pictures.filter(image_category__name='Header_Pic')[0]
> > except IndexError:
> > pass
>
Make sure you have the indentation set correctly. The second and
third line of the posted code should actually be one line. I think
the formatting was changed
> > try:
> > return
> > self.system_pictures.filter(image_category__name='Header_Pic')[0]
> > except IndexError:
> > pass
>
> > which will always get the first related image in that category, and
> > silently swallows the error that's thrown if there's no such picture.
>
> Can't seem to
On Sep 16, 11:32 am, Mirto Silvio Busico <[EMAIL PROTECTED]> wrote:
>
> DJMSB.VIEWS--
>
> from django.shortcuts import render_to_response
> from django.contrib.auth.decorators import login_required
> from
Why do you need a method other than get_or_create? Could you not try
to retrieve the object using get_or_create and then update the object
if retrieved?
R.
On Jul 18, 5:57 am, leppy <[EMAIL PROTECTED]> wrote:
> hi everyone,
>
> Can anyone tell me a method similar to django model's
41 matches
Mail list logo