mplate.
Alfredo
2012/2/19 Stanwin Siow <stanwin.kts...@gmail.com>
> Hi Alfredo,
>
> My apologies for not making my question clear.
>
> I want to pass two different querysets into the url pattern. Is it
> possible?
>
> Best Regards,
>
> Stanwin Siow
>
Hi,
I'm not sure that I've understand your question:
url(r'^profile/(?P\d+)/(?P\d+)$', ..)
and now you can use the variable var_1 and var_2 in your function.
Alfredo
2012/2/18 Stanwin Siow
> Hello,
>
> I want to find out if there is anyway to pass two
On Wed, Nov 9, 2011 at 9:27 PM, Alfredo Alessandrini <alfreal...@gmail.com>
> wrote:
>>
>> Hi,
>>
>> I'm running a script to make a query with django.
>>
>> I need to run it in crontab.
>>
>> When I run it I get this error:
>>
>>
> Can you show us your script and how you launch it ?
>
> On Wed, Nov 9, 2011 at 9:27 PM, Alfredo Alessandrini <alfreal...@gmail.com>
> wrote:
>>
>> Hi,
>>
>> I'm running a script to make a query with django.
>>
>> I need to run it in cron
Hi,
I'm running a script to make a query with django.
I need to run it in crontab.
When I run it I get this error:
ImportError: No module named profiles
I'm using a virtualenv.
Thanks,
Alfredo
--
You received this message because you are subscribed to the Google Groups
"Django users"
Hi,
I'm trying to import a big database in the django project by phpmyadmin.
The import process is successful. The database by phpmyadmin and mysql
admin is ok.
If I try to make some query by python shell it work.
But the problem is that the database isn't showed in the admin panel.
(I've
Hi,
I've a model testDB with a foreignkey "country" related to another database.
I need to retrieve the unique value of country.common_name.
With this
country_list = testDB.objects.values('country').distinct
I can retrieve the unique value, but only the ID.
In [63]:
Hi,
I've this model:
class Pubblicazioni(models.Model):
anno = models.DateField(blank=True, null=True,default=datetime.date.today)
autori = models.CharField(max_length=500)
titolo = models.CharField(max_length=500)
autori_daf = models.ManyToManyField(User)
I need to ordering
Hi,
I'm trying to upload a file by a formset.
model.py:
---
class Person(models.Model):
user = models.ForeignKey(User)
course = models.TextField(blank=True, null=True)
project = models.TextField(blank=True, null=True)
CV_ENG = models.FileField(upload_to='upload/CV/',
Hi,
I've this model:
class Persone(models.Model):
CV = models.TextField()
Can I change the name "CV" when I display it in a formset?
Thanks,
Alfredo
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email
Hi,
I've this views.py:
I need to save the model of current user. But this don't work. What's wrong?
@login_required
def profilo(request):
from daf.Persone.models import Persone
PersoneFormSet = modelformset_factory(Persone, fields=('curriculum_studi'),)
utente =
scr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>
--
--
Alfredo Alessandrini, Dr.
PhD
Department of Environment and Forest
Hi,
I've a problem with the apache configuration:
I'm trying to set www.example.com/ and www.example.com/test, but if I
try this, work only the first site:
WSGIScriptAlias / /home/alfreale/.
WSGIScriptAlias /test /home/alfreale/.
thanks,
Alfredo
--
You received
Hi,
I've this model:
class Person(models.Model):
user = models.ForeignKey(User)
courses = models.TextField(blank=True, null=True)
research_statement = models.TextField(blank=True, null=True)
..
I will let to save the form only when the user is making
Hi,
I've this model:
--
class Person(models.Model):
user = models.ForeignKey(User)
Can I display the user.email or user.first_name in the admin site
administration?
I try this:
---
def __unicode__(self):
return u"%s %s" %
Hi,
I've this admin.py:
from chessemail.GAME.models import Game
from django.contrib import admin
class GameAdmin(admin.ModelAdmin):
list_display = ('id', 'white', 'black', 'time_days_W',
'time_days_B', 'move_game', 'last_move_W', 'last_move_B', 'is_active')
Hi,
I'm write a model for a post.
Can I access to id of current user on admin site?
I'm trying with:
author = models.ForeignKey(User, default=User.id, blank=True, null=True)
But don' work...
Thanks,
Alfredo
--
from django.db import models
from
Hi,
can I use two form in the same view function?
if request.method == 'POST':
form = FORM_1(request.POST)
if form.is_valid():
.
form = FORM_2(request.POST)
if form.is_valid():
.
It's
> Sorry but your question is not clear. Are 'min_rating' and
> 'max_rating' fields of the game object ? If yes:
Yes
It's better:
game_list = game.objects.filter(Q(max_rating__gt = player.rating) &
Q(min_rating__lt = player.rating))
or
game_list =
> On Sun, 2008-12-14 at 00:46 +0100, Alfredo Alessandrini wrote:
>> Hi,
>>
>> It's possible call a query with max or min value?:
>>
>> like this:
>>
>> game_list = game.objects.filter(Q(max_rating > player.rating) &
>> Q(min_rating <
Hi,
can I remove an objects from the queryset:
In [138]: from CHALLENGE.models import start_game
In [139]: start_game.objects.all()
Out[139]: [, , ]
In [140]: games = start_game.objects.all()
In [142]: games
Out[142]: [, , ]
can I delete the objects with id = 27, for obtain this:
In
Hi,
It's possible call a query with max or min value?:
like this:
game_list = game.objects.filter(Q(max_rating > player.rating) &
Q(min_rating < player.rating))
Thanks in advance,
Alfredo
--~--~-~--~~~---~--~~
You received this message because you are
Hi,
I've this form:
class PlayerForm(forms.Form):
challengeable = forms.BooleanField(required=False)
show_name = forms.BooleanField(required=False)
message_move = forms.BooleanField(required=False)
message_confirm = forms.BooleanField(required=False)
country =
Hi,
I've this variable in my template: {{ challenger.rating }}
It'a a number...
Can I calculate a sum like this:
{{ challenger.rating }} + 200 ??
I must write a custom tag?
Alfredo
--~--~-~--~~~---~--~~
You received this message because you are
Hi,
I've set the player form with:
class PlayerForm(forms.Form):
challengeable = forms.BooleanField(required=False)
show_name = forms.BooleanField(required=False)
country = forms.ModelMultipleChoiceField(queryset=Country.objects.all())
and the template with:
I've a problem to
Hi,
I've this model:
class Player(models.Model):
user = models.ForeignKey(User, blank=True, null=True)
country = models.ForeignKey(Country)
If I try to ordering Player by "user", don' work:
Player.objects.order_by("user")
I want ordering Player by user.username
Alfredo
Hi,
I've this template:
And this View:
class MoveGameForm(forms.Form):
resign = forms.BooleanField(required=False)
draw = forms.BooleanField(required=False)
move = forms.BooleanField(required=False)
I'm writing the view, with:
Hi,
I've this model:
from django.contrib.auth.models import User
class Player(models.Model):
first_name = models.CharField(max_length=30)
last_name = models.CharField(max_length=40)
email = models.EmailField()
user = models.ForeignKey(User, blank=True, null=True)
I try to set
There is a method for write this, without write a loop:
{% ifequal apple.number <20 %}
..
{% endifequal %}
Alfredo
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To
rib.auth.
>
> Erik
>
>
> On 27.10.2008, at 12:52, Alfredo Alessandrini wrote:
>
>>
>> I've solve whit this:
>>
>> http://wolfram.kriesing.de/blog/index.php/2008/customize-admin-for-user-model
>>
>>
>> Alfredo
>>
>> 2008/10/27 Alf
I've solve whit this:
http://wolfram.kriesing.de/blog/index.php/2008/customize-admin-for-user-model
Alfredo
2008/10/27 Alfredo Alessandrini <[EMAIL PROTECTED]>:
> Can I customize the auth.users list of the site administration? I need
> to display also the active status in the list
Can I customize the auth.users list of the site administration? I need
to display also the active status in the list.
Thanks,
Alfredo
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post
I've a new error :-) :
File "./mysite/views.py", line 26, in setup_player
return render_to_response('player_form.html', {'form': form})
UnboundLocalError: local variable 'form' referenced before assignment
2008/10/14 Daniel Roseman <[EMAIL PROTECTED]>:
>
> On Oct
else:
form = ContactForm() # An unbound form
return render_to_response('contact.html', {
'form': form,
})
--
I don't understand where is the difference...
Alfredo
2008/10/14 Steve Holden <[EMAIL PROTECTED]>:
>
I've setup a form from a model:
class PlayerForm(ModelForm):
class Meta:
model = Player
I've setup a view function for save the data inserted in the form:
def setup_player(request):
if request.method == 'POST':
form = PlayerForm(request.POST)
if form.is_valid():
ok...it's work.
but If I want customize the url by url.py?
Alfredo
2008/10/13 Daniel Roseman <[EMAIL PROTECTED]>:
>
> On Oct 13, 12:12 pm, "Alfredo Alessandrini" <[EMAIL PROTECTED]>
> wrote:
>> > First of all, why don't you just point the browser a
> First of all, why don't you just point the browser at the URL of the
> commands.html file in the first place?
at the URL?
In urls.py?
Alfredo
>> 2008/10/8 Alfredo Alessandrini <[EMAIL PROTECTED]>:
>>> Hi,
>>>
>>> I'm trying to sho
:
>
> class Game(Model):
> # ...
> time_days_W = CharField(max_length=128, verbose_name="time")
>
> 2008/10/10 Alfredo Alessandrini <[EMAIL PROTECTED]>
>>
>> Hi,
>>
>> I've create a model form by:
>>
>> class GameForm(ModelForm):
Hi,
I've create a model form by:
class GameForm(ModelForm):
class Meta:
model = Game
fields = ('white', 'black', 'time_days_W', 'inc_time')
and the form template:
{{ form.as_p }}
The view function is ok, but I want to change the label of a field.
I want to change
I've solved it with:
def list_commands(request):
commands = open('home/.../commands.html')
return HttpResponse(commands)
commands.close()
2008/10/8 Alfredo Alessandrini <[EMAIL PROTECTED]>:
> Hi,
>
> I'm trying to show a static html page...
>
> The html
Hi,
I'm trying to show a static html page...
The html page is in the /media folder.
I've some problem with view funcition:
def list_commands(request):
commands =
return HttpResponse(commands)
How can I load the html page?
Regards,
Alfredo
solved...
from GAME.models import Game
p = Game.objects.get(id=1)
p.name = '2'
p.save()
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to
I've a simple a question...
How can I update a single value of database??
I've try this:
from GAME.models import Game
Game.objects.filter(id=1)
p.name='2'
but don't update...It's add a row.
thanks in advance,
Alfredo
--~--~-~--~~~---~--~~
You received
I must select a column from my database.
I've try with:
from PLAYER.models import Player
player = Player.objects.all()
email = Player.objects.values('email')
ok, work fine, but in the Django Book I read:
"This method is useful when you know you're only going to need values
from a small number
Hi,
How can I update or delete a model?
Alfredo
--~--~-~--~~~---~--~~
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
Hi,
I'm a beginner about django. I've a doubt.
How I can verify if an hosting web can support django?
If it support python is sure that django work?
thanks,
Alfredo
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
I'm a newby..:-)
Is Django good for make a web site like this?
http://www.ficgs.com/
http://www.chessmail.org/
These are a web site for playing correspondence chess.
The moves are stored with a database, with information about the players,
tournament, rating, ecc..
Alfredo
47 matches
Mail list logo