Help! I begginer...

2022-04-26 Thread Ricardo Pereira de Azevedo
Error:

  File 
"C:\Users\tecnico.ricardo\PycharmProjects\pythonProject01\venv01\lib\site-packages\django\db\models\sql\query.py",
 
line 11, in 
from collections import Counter, Iterator, Mapping, OrderedDict
ImportError: cannot import name 'Iterator' from 'collections' 
(C:\Users\tecnico.ricardo\AppData\Local\Programs\Python\Python310\lib\collections\__init__.py)
(venv01) PS C:\Users\tecnico.ricardo> 


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/78d15bc6-f58b-43e1-baaa-4e255e974dd1n%40googlegroups.com.


Re: django.db.models.signals

2020-09-20 Thread Ricardo Daniel Quiroga
Hi
pre_save, post_save solved this problem with created flag [1]

# If you check only update in you
if not created:
   pass

[1] https://docs.djangoproject.com/en/dev/ref/signals/#post-save



El sáb., 19 sept. 2020 a las 12:14, Mohammad hassan Tahery (<
mo.ha.ta.1.2.1.mo.ha...@gmail.com>) escribió:

> It would be cool to have pre_update and post_update in set of built-in
> signals.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/df4b7a32-4c81-4d37-aeca-bc12dfd79602n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/df4b7a32-4c81-4d37-aeca-bc12dfd79602n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 

Ricardo Daniel Quiroga

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO2-wHasnZPiXT2vENkZsOWoM9dUJXYcmBtD-6_21NLuDAM4aQ%40mail.gmail.com.


Re: Django queryset result and mysql query are wrong after updating from 3.0.2 to 3.0.3

2020-02-19 Thread Ricardo H
Hi Simon, 

It was ok on 2.2.6, only on 3.0.3 it fails.

I use BigIntegerField because I use it for some calculations after that, 
but even if I try with DurationField it doens't assert right.

Definitely must be caused by this patch, if I can't find another solution, 
where and how should I report this ?.

Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0c714166-b3ec-4b58-b574-0effc0fd7f37%40googlegroups.com.


Django queryset result and mysql query are wrong after updating from 3.0.2 to 3.0.3

2020-02-19 Thread Ricardo H
Hello,  after I updated django from 3.0.2 to 3.0.3 the result of the 
following code has changed when using a MySQL database. It produces a wrong 
sql query and also the wrong result for "*end_total_time"* attribute.
Is this a bug ? also is there any other way to get the wright result using 
3.0.3 ?

Thank you.

*models.py*
from datetime import datetime
import pytz


from django.db import models
from django.db.models.functions import Cast


class PhaseQueryset(models.QuerySet):


def with_duration(self,):
base_date = datetime(2000, 1, 3, 0, tzinfo=pytz.utc)


# When I use base_date to do the end_total_time math in 3.0.3 
together
# with ended_at annotated, it creates a wrong query
qs = self.annotate(
ended_at=models.Case(
models.When(
models.Q(type='TYPEONE'),
then=models.functions.Now()
),
default=models.F('started_at'),
output_field=models.DateTimeField(),
),
base_date=models.functions.Cast(
models.Value(base_date),
output_field=models.DateTimeField()
),
end_total_time=models.ExpressionWrapper(
models.F('ended_at') - models.F('base_date'),
output_field=models.fields.BigIntegerField()
)
)


return qs


# Create your models here.
class Phase(models.Model):
objects = PhaseQueryset().as_manager()
started_at = models.DateTimeField()
type = models.CharField(max_length=40)



*tests.py*
from datetime import datetime, timedelta
import pytz


from django.test import TestCase
from daterror.models import Phase
# Create your tests here.


class TestDateProblem(TestCase):


def setUp(self,):
past = datetime.now(tz=pytz.UTC) - timedelta(days=30)
Phase.objects.create(started_at=past, type='TYPEONE')
past = datetime.now(tz=pytz.UTC) - timedelta(days=33)
Phase.objects.create(started_at=past, type='TYPETWO')
past = datetime.now(tz=pytz.UTC) - timedelta(days=34)
Phase.objects.create(started_at=past, type='TYPETHREE')




def test_timedifference_not_none(self,):
phases = Phase.objects.all().with_duration()
print(phases[0].end_total_time)
print(phases[1].end_total_time)
print(phases[2].end_total_time)
self.assertNotEqual(None, phases[0].end_total_time)
self.assertNotEqual(None, phases[1].end_total_time)
self.assertNotEqual(None, phases[2].end_total_time)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7b25cb7d-f213-486b-95b5-15d438277d01%40googlegroups.com.


Re: Display ManyToManyField value or a select_related query in an html object list

2019-06-24 Thread Ricardo Daniel Quiroga
Hi,

model.many_to_many_atribute.all()
model.many_to_many_atribute.find(name="carl")


El lun., 24 jun. 2019 a las 19:18, Charlotte Wood (<
charlotte.w...@epiccharterschools.org>) escribió:

> HELP!
>
> Do ManyToManyFields just not print?
>
> I see them in my form selection.
>
> Everything works fine, but when I try to put the linked item on a list
> form, i get:  project.model.none for the value.  I cannot figure out how to
> make all the values print.  HELP!  PLEASE!!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/ec36b6b0-dc7a-4534-9af3-ae0a173fa493%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/ec36b6b0-dc7a-4534-9af3-ae0a173fa493%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 

Ricardo Daniel Quiroga

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO2-wHbGHpgzBdqzsvj%3DVuC-AF3%2BXKGkVpmnKhTtoV-5irSYjQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Trying to filter out choices in a form based on the logged in user.

2019-02-09 Thread Ricardo Cataldi
You van create this property on your model, andam the init would bem
applied to your form

Em sáb, 9 de fev de 2019 13:15, GavinB841  Hi Ricardo,
>
> Really appreciate your reply, I am struggling to understand where I would
> create this property as I am quite new to Django and haven't worked with
> these before.
>
> Is it included in the model/view/form and under which model for the club,
> user or team.
>
> Thanks for your help.
>
> Gavin
>
> On Saturday, 9 February 2019 13:40:09 UTC, Ricardo Cataldi wrote:
>>
>> Hello there Galvin,
>>
>>
>>
>> You can create properties on the users and filter the queryset
>> conditioning to the user. It depends on how many categories of user you
>> have and how these users are supposed to be filtered by those teams.
>>
>>
>>
>> For example, if you have a spatial selection based on user location, you
>> create a property called ‘location_filter’ and set the separation rule on
>> this property, like:
>>
>>
>>
>> @property
>>
>> def location_filter(self):
>>
>> location = self.location
>>
>> filter_rule = 5miles
>>
>> return [self.location - filter_rule, self.location +
>> filter_rule]
>>
>>
>>
>> and in your form you set a init argument to query those filter rules, in
>> the fashion that you want:
>>
>>
>>
>> def __init__(self, *args, **kwargs):
>>
>> user = kwargs.pop(‘user’, None)
>>
>> self.fields[‘club_id’].queryset =
>> Club.objects.filter(place__lte=user.location_filter[1],
>> place__gte=user.location_filter[0])
>>
>>
>>
>> I have not tested this solution, but with some minor code changes it
>> should work like a charm in filtering the club queryset.
>>
>>
>>
>> *From:* django...@googlegroups.com  *On
>> Behalf Of *GavinB841
>> *Sent:* sábado, 9 de fevereiro de 2019 11:24
>> *To:* Django users 
>> *Subject:* Trying to filter out choices in a form based on the logged in
>> user.
>>
>>
>>
>> Hi all,
>>
>>
>>
>> If anyone could help or point me in the direction of some documentation
>> for the below problem I am having I would really appreciate it.
>>
>>
>>
>> Just to explain quickly:
>>
>>1. I have a model called "Team" which contains a foreign key to
>>another model called "Club"
>>2. The "Club" model contains a foreign key to the "User" model.
>>3. I have a form for the "Team" model which takes in "club_id",
>>currently it lists all the club_id for all users and I want to restrict
>>this.
>>4. I am looking to find out how I can auto-populate this field
>>"club_id" based on the logged in user, which I will then hide in the form.
>>
>> Below is my forms.py
>>
>>
>>
>> class ClubInfoForm(forms.ModelForm):
>> club_address2 = forms.CharField(required=False)
>> club_address3 = forms.CharField(required=False)
>>
>> class Meta():
>> model = ClubInfo
>> fields = ('club_name', 'club_logo', 'club_address1', 'club_address2',
>>   'club_address3', 'club_town', 'club_county', 
>> 'club_country',)
>>
>> def clean_club_name(self):
>> club_name = self.cleaned_data['club_name']
>> if ClubInfo.objects.filter(club_name=club_name).exists():
>> raise ValidationError(_("Club already exists"))
>> return club_name
>>
>>
>> class TeamForm(forms.ModelForm):
>>
>> class Meta():
>> model = Team
>> fields = ('club_id', 'team_name', 'manager_name')
>>
>> def __init__(self, *args, **kwargs):
>> super(TeamForm, self).__init__(*args, **kwargs)
>>
>>
>>
>>
>>
>> models.py
>>
>>
>>
>> class ClubInfo(models.Model):
>>
>> user = models.OneToOneField(User, on_delete=models.CASCADE)
>> club_name = models.CharField(max_length=50, default='', unique=True)
>> club_logo = models.ImageField(upload_to='profile_pics', blank=True)
>> club_address1 = models.CharField(max_length=30)
>> club_address2 = models.CharField(max_length=30, default='')
>

RE: E-commerce with Django framework

2019-02-09 Thread Ricardo Cataldi
Regarding your first question, try the Oscar e-commerce app and see if it suits 
you.

 

From: django-users@googlegroups.com  On Behalf 
Of kibirige Gerald Joseph
Sent: sábado, 9 de fevereiro de 2019 11:58
To: django-users@googlegroups.com
Subject: Re: E-commerce with Django framework

 

 

I deleted the pgadmin4.db located on path C:\Users\\AppData\Roaming\pgAdmin.

That's when it worked.

 

On Sat, Feb 2, 2019 at 5:36 PM Khushal Kumar mailto:kkhushal1...@gmail.com> > wrote:

you're welcome. Did it work?

 

On Sat, Feb 2, 2019 at 7:55 PM Khushal Kumar mailto:kkhushal1...@gmail.com> > wrote:

Right click on pgadmin and troubleshoot it.

 

On Sat, Feb 2, 2019 at 6:48 PM kibirige Gerald Joseph mailto:geraldjose...@gmail.com> > wrote:

Hello

I have problem running PostgreSQL  pg admin on windows 10. whenever I start the 
application it brings out this error:

"Fatal error: the application server could not be contacted."

 

What could be the problem? What should I do?

 

Thanks,

Gerald.

 

 

 

 

On Sun, Jan 20, 2019 at 10:40 AM kibirige Gerald Joseph 
mailto:geraldjose...@gmail.com> > wrote:

Hello!

I started learning Django framework last month. Django is great!
Well,  is  it plausible to build an e-commerce website with Django?

If so, what resources and information do I need to make an e-commerce website 
in Django a reality?

Thank you

Gerald

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com 
 .
To post to this group, send email to django-users@googlegroups.com 
 .
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CANNqTcM-58h8-0pEokw1SaPwAYj8mCLw-be8%2BYQnuKz9Rast2w%40mail.gmail.com
 

 .
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com 
 .
To post to this group, send email to django-users@googlegroups.com 
 .
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAKOftJiudo4AyUn6iNWfzHxd9PrWFjGEEVFC3tUpAkzyPpRdOQ%40mail.gmail.com
 

 .
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com 
 .
To post to this group, send email to django-users@googlegroups.com 
 .
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CANNqTcMro0yktLaQ_nwmVxqoHJjgW8tqQDTNHYGD8P4cgi9Rcg%40mail.gmail.com
 

 .
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/007301d4c080%243a331480%24ae993d80%24%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


RE: Trying to filter out choices in a form based on the logged in user.

2019-02-09 Thread Ricardo Cataldi
Hello there Galvin,

 

You can create properties on the users and filter the queryset conditioning to 
the user. It depends on how many categories of user you have and how these 
users are supposed to be filtered by those teams.

 

For example, if you have a spatial selection based on user location, you create 
a property called ‘location_filter’ and set the separation rule on this 
property, like:

 

@property

def location_filter(self):

location = self.location

filter_rule = 5miles

return [self.location - filter_rule, self.location + 
filter_rule]

 

and in your form you set a init argument to query those filter rules, in the 
fashion that you want:

 

def __init__(self, *args, **kwargs):

user = kwargs.pop(‘user’, None)

self.fields[‘club_id’].queryset = 
Club.objects.filter(place__lte=user.location_filter[1], 
place__gte=user.location_filter[0])

 

I have not tested this solution, but with some minor code changes it should 
work like a charm in filtering the club queryset.

 

From: django-users@googlegroups.com  On Behalf 
Of GavinB841
Sent: sábado, 9 de fevereiro de 2019 11:24
To: Django users 
Subject: Trying to filter out choices in a form based on the logged in user.

 

Hi all,

 

If anyone could help or point me in the direction of some documentation for the 
below problem I am having I would really appreciate it.

 

Just to explain quickly:

1.  I have a model called "Team" which contains a foreign key to another 
model called "Club"
2.  The "Club" model contains a foreign key to the "User" model.
3.  I have a form for the "Team" model which takes in "club_id", currently 
it lists all the club_id for all users and I want to restrict this.
4.  I am looking to find out how I can auto-populate this field "club_id" 
based on the logged in user, which I will then hide in the form. 

Below is my forms.py

 

class ClubInfoForm(forms.ModelForm):
club_address2 = forms.CharField(required=False)
club_address3 = forms.CharField(required=False)

class Meta():
model = ClubInfo
fields = ('club_name', 'club_logo', 'club_address1', 'club_address2',
  'club_address3', 'club_town', 'club_county', 'club_country',)

def clean_club_name(self):
club_name = self.cleaned_data['club_name']
if ClubInfo.objects.filter(club_name=club_name).exists():
raise ValidationError(_("Club already exists"))
return club_name


class TeamForm(forms.ModelForm):

class Meta():
model = Team
fields = ('club_id', 'team_name', 'manager_name')

def __init__(self, *args, **kwargs):
super(TeamForm, self).__init__(*args, **kwargs)
 
 
models.py
 
class ClubInfo(models.Model):

user = models.OneToOneField(User, on_delete=models.CASCADE)
club_name = models.CharField(max_length=50, default='', unique=True)
club_logo = models.ImageField(upload_to='profile_pics', blank=True)
club_address1 = models.CharField(max_length=30)
club_address2 = models.CharField(max_length=30, default='')
club_address3 = models.CharField(max_length=30, default='')
club_town = models.CharField(max_length=30)
club_county = models.CharField(max_length=30)
club_country = models.CharField(max_length=30)
created_date = models.DateTimeField(default=timezone.now)

def __str__(self):
return self.club_name
 
class Team(models.Model):

club_id = models.ForeignKey(ClubInfo, on_delete=models.CASCADE)
team_name = models.CharField(max_length=30)
manager_name = models.CharField(max_length=20)


def __str__(self):
return self.team_name

 

Séanadh Ríomhphoist/

Email Disclaimer

Tá an ríomhphost seo agus aon chomhad a sheoltar leis faoi rún agus is lena 
úsáid ag an seolaí agus sin amháin é. Is féidir tuilleadh a léamh anseo. 
  
  

This e-mail and any files transmitted with it are confidential and are intended 
solely for use by the addressee. Read more here. 
  

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com 
 .
To post to this group, send email to django-users@googlegroups.com 
 .
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8188ff6e-bf56-4010-9caf-90d8a294a187%40googlegroups.com
 

 .
For more options, visit https://g

Loading Django views inside template with JQuery

2019-01-22 Thread Ricardo Cataldi
Hy guys, you all right?

I have a problem that it seems not to be any answer in Stack Overflow.

I need to load three views inside a template, and i decided to do that 
based on html tags and JQuery. The bellow image shows how the front end 
will look like:

[image: imagem_tab.png]

What happens is that the tabs should load a view separately, I've searched 
on ways of doing that with JQuery but i didn't found any that would work...

Can anyone tell me how exactly I can load a view with JQuery inside a html 
tab? In case it is not possible, can you give me an alternative?

The html following:

{% block header %}


{% trans "Gerenciamento de 
Produtos" %}




list
Listar Produtos




view_list
Listar Opções




add_box
Adicionar Opções






{% endblock header %}

{% block content %}





{% block productlist %}

{% endblock %}










{% block listtoptions %}

{% endblock %}










{% block createoptions %}

{% endblock %}





{% endblock content %}


I want to load the views inside all those blocks.

Thanks in advance!!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/55f946c1-53de-4c2d-984e-5d9e774e03b2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: PROBLEM 2

2018-12-04 Thread Ricardo Daniel Quiroga
Hi
edit your urls.py and add polls view inside

El mar., 4 dic. 2018 a las 8:44, David Figueroa (<
davidfigueroalaf...@gmail.com>) escribió:

>
>
> Em segunda-feira, 3 de dezembro de 2018 21:30:40 UTC-3, David Figueroa
> escreveu:
>>
>> in the process of creating my first views I am having this problem when I
>> will check if everything is working well on the page
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/6ac1daf3-59d8-4971-ba15-5214ed3cfbb7%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/6ac1daf3-59d8-4971-ba15-5214ed3cfbb7%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 

Ricardo Daniel Quiroga

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO2-wHZVoXed%2BKKaQGFU-fksaCSxFTVxfB2vgXZFD09p36svhA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: username on URL with Class Based Views

2018-09-13 Thread Ricardo Cataldi
Nice! Thanks a lot!

On Thu, Sep 13, 2018 at 8:45 AM Jason  wrote:

> return redirect('settings:profile')
>
>
> The issue is this.  you're telling Django to hit up that URL, but you
> don't specify the username for that.
>
> Something like this would be required:  return
> redirect('settings:profile', args=(username,))
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/805978e9-ff92-4acb-b536-f1d1efa29f30%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAKfhJYkf8h1V%2B7P0QHixRZyaH0DNXGFDvY9%3DdL35_j3HZN83AQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Start Gunicorn on boot

2017-10-20 Thread Ricardo Daniel Quiroga
Use supervisor to start gunicorn on init

see this guide
http://michal.karzynski.pl/blog/2013/06/09/django-nginx-gunicorn-virtualenv-supervisor/


gunicorn_start.bash
#!/bin/bash
NAME="hello_app" # Name of the application
DJANGODIR=/webapps/hello_django/hello # Django project directory
SOCKFILE=/webapps/hello_django/run/gunicorn.sock # we will communicte using
this unix socket
USER=hello # the user to run as
GROUP=webapps # the group to run as
NUM_WORKERS=3 # how many worker processes should Gunicorn spawn
DJANGO_SETTINGS_MODULE=hello.settings # which settings file should Django
use
DJANGO_WSGI_MODULE=hello.wsgi # WSGI module name
echo "Starting $NAME as `whoami`"
# Activate the virtual environment
cd $DJANGODIR
source ../bin/activate
export DJANGO_SETTINGS_MODULE=$DJANGO_SETTINGS_MODULE
export PYTHONPATH=$DJANGODIR:$PYTHONPATH
# Create the run directory if it doesn't exist
RUNDIR=$(dirname $SOCKFILE)
test -d $RUNDIR || mkdir -p $RUNDIR
# Start your Django Unicorn
# Programs meant to be run under supervisor should not daemonize themselves
(do not use --daemon)
exec ../bin/gunicorn ${DJANGO_WSGI_MODULE}:application \
--name $NAME \
--workers $NUM_WORKERS \
--user=$USER --group=$GROUP \
--bind=unix:$SOCKFILE \
--log-level=debug \
--log-file=-

2017-10-20 6:23 GMT-03:00 Nonverbis M :

> Antonis, thank you.
> Yes, this is upstart. I'll try it with systemd as you suggested.
>
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/c8308c91-bce1-4bb0-9cdb-16ce326d4e13%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/c8308c91-bce1-4bb0-9cdb-16ce326d4e13%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Ricardo Daniel Quiroga

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO2-wHYH26Jo6tWmtc%2BNhrmZfpnfdAebUr%2B2UQEYMrQsDwzhow%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: setup virtualhost right way

2016-11-16 Thread Ricardo Prado
Apache2 processes uses 98 or 99% CPU Usage


Em quarta-feira, 16 de novembro de 2016 08:00:09 UTC-2, Antonis 
Christofides escreveu:
>
> Also note that the WSGI* directives should probably go inside the 
>  block.
>
> Antonis Christofideshttp://djangodeployment.com
>
> On 2016-11-16 11:11, Ricardo Prado wrote:
>
> Hi! 
>
> After many google searchs and forum I can't get a real idea about 
> virtualhost setup for django apps.
> I'm using this setup above but my CPU Usage is 99% very high. Please 
> someone can explain to me the right way setup vhost?
>
> I'm using Linux Ubuntu 14.04
>
>
>
>
> WSGIDaemonProcess framework 
> python-path=/mnt/g/Python/osvaldo/framework/:/mnt/g/Python/osvaldo/framework/lib/python2.7/site-packages
> WSGIProcessGroup framework
> WSGIScriptAlias / /mnt/g/Python/osvaldo/framework/framework/wsgi.py
>
>
> 
> ServerName 127.0.0.2
> ServerAlias ahora.local
>
>
> Alias /static /mnt/g/Python/osvaldo/framework/static
> Alias /media /mnt/g/Python/osvaldo/framework/media
>
> 
> 
> Require all granted
> 
> 
>
>
> 
> Require all granted
> 
>
> 
> Require all granted
> 
>
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users...@googlegroups.com .
> To post to this group, send email to django...@googlegroups.com 
> .
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/141a0037-4a6a-41a6-aea0-44828fb3fc8d%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/django-users/141a0037-4a6a-41a6-aea0-44828fb3fc8d%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f10ca836-bc6e-44a4-bee9-f41addf77240%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: setup virtualhost right way

2016-11-16 Thread Ricardo Prado
If I put inside vistualhost the results are the same


Em quarta-feira, 16 de novembro de 2016 08:00:09 UTC-2, Antonis 
Christofides escreveu:
>
> Also note that the WSGI* directives should probably go inside the 
>  block.
>
> Antonis Christofideshttp://djangodeployment.com
>
> On 2016-11-16 11:11, Ricardo Prado wrote:
>
> Hi! 
>
> After many google searchs and forum I can't get a real idea about 
> virtualhost setup for django apps.
> I'm using this setup above but my CPU Usage is 99% very high. Please 
> someone can explain to me the right way setup vhost?
>
> I'm using Linux Ubuntu 14.04
>
>
>
>
> WSGIDaemonProcess framework 
> python-path=/mnt/g/Python/osvaldo/framework/:/mnt/g/Python/osvaldo/framework/lib/python2.7/site-packages
> WSGIProcessGroup framework
> WSGIScriptAlias / /mnt/g/Python/osvaldo/framework/framework/wsgi.py
>
>
> 
> ServerName 127.0.0.2
> ServerAlias ahora.local
>
>
> Alias /static /mnt/g/Python/osvaldo/framework/static
> Alias /media /mnt/g/Python/osvaldo/framework/media
>
> 
> 
> Require all granted
> 
> 
>
>
> 
> Require all granted
> 
>
> 
> Require all granted
> 
>
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users...@googlegroups.com .
> To post to this group, send email to django...@googlegroups.com 
> .
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/141a0037-4a6a-41a6-aea0-44828fb3fc8d%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/django-users/141a0037-4a6a-41a6-aea0-44828fb3fc8d%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b1b0e8df-ea14-4bb6-9da1-3d64f2da9f20%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Basic configuration for running under Apache

2016-11-16 Thread Ricardo Prado
sample configuration

WSGIDaemonProcess framework 
python-path=/mnt/g/Python/osvaldo/framework/:/mnt/g/Python/osvaldo/framework/lib/python2.7/site-packages
WSGIProcessGroup framework
WSGIScriptAlias / /mnt/g/Python/osvaldo/framework/framework/wsgi.py


ServerName 127.0.0.2
ServerAlias ahora.local
   #DocumentRoot /mnt/g/Python
   #ErrorLog /mnt/g/Python/logs/error.log
   #CustomLog /mnt/g/Python/logs/access.log combined

Alias /static /mnt/g/Python/osvaldo/framework/static
Alias /media /mnt/g/Python/osvaldo/framework/media



Require all granted





Require all granted



Require all granted






Em segunda-feira, 14 de novembro de 2016 17:36:44 UTC-2, bob gailer 
escreveu:
>
> https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/modwsgi/ 
>
> This page offers: 
>
> WSGIScriptAlias  //path/to/mysite.com/mysite/wsgi.py 
> WSGIPythonPath  /path/to/mysite.com 
>
>  
>
> In my setup this becomes c:\Users\myname\mysite\mysite\wsgi.py 
>
> I am puzzled by the .com in the example. Can you explain? 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/dc21c5d6-305a-44bc-bc9d-7bb9a5ef7571%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


setup virtualhost right way

2016-11-16 Thread Ricardo Prado
Hi!

After many google searchs and forum I can't get a real idea about 
virtualhost setup for django apps.
I'm using this setup above but my CPU Usage is 99% very high. Please 
someone can explain to me the right way setup vhost?

I'm using Linux Ubuntu 14.04




WSGIDaemonProcess framework 
python-path=/mnt/g/Python/osvaldo/framework/:/mnt/g/Python/osvaldo/framework/lib/python2.7/site-packages
WSGIProcessGroup framework
WSGIScriptAlias / /mnt/g/Python/osvaldo/framework/framework/wsgi.py



ServerName 127.0.0.2
ServerAlias ahora.local


Alias /static /mnt/g/Python/osvaldo/framework/static
Alias /media /mnt/g/Python/osvaldo/framework/media



Require all granted





Require all granted



Require all granted




-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/141a0037-4a6a-41a6-aea0-44828fb3fc8d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Forbidden fix

2016-10-14 Thread Ricardo Prado
Hi Mike!

Are you using SSL certificate?
What's your SO? Ubuntu, Debian, Win?
Please get apache log, you can found this in typing:

cat /etc/var/log/apache2/error.log (if ubuntu or debian)

and type this an copy and past the permission:

stat -c "%n %a" /substance/wsds/7291

check in octal permissions,

I'm waiting you reply



Em quinta-feira, 13 de outubro de 2016 04:47:58 UTC-3, Mike Dewhirst 
escreveu:
>
> I have two similar servers behaving differently. This is the staging 
> server ... 
>
> You don't have permission to access /substance/wsds/7291/ on this server. 
>
> The production server is fine running Ubuntu 14.04 and Apache 2.2. The 
> difference is that I have just upgraded staging to Ubuntu 16.04 and 
> Apache 2.4. 
>
> The new problem resulting from the upgrade was that the Apache redirect 
> from http on port 80 to https on port 443 was failing occasionally. 
>
> That occasion was in the Django Admin when clicking (View on site) 
>
> The fix is to adjust get_absolute_url() so it always specifies https 
>
> Hope this helps someone. 
>
> Cheers 
>
> Mike 
>
>
>
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4a0c878d-adc2-4f2b-9401-9de04f868217%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django 1.10.2 mysql 5.6.34 which connector?

2016-10-13 Thread Ricardo Prado
First you can install python tools and other librarys

If you using Ubuntu or Debian, check this steps

sudo apt-get install python-setuptools apache2 libapache2-mod-wsgi

sudo apt-get install python-pip

sudo apt-get install *python-dev libmysqlclient-dev*

Don't use
 'ENGINE': 'mysql.connector.django',

USE
 'ENGINE': 'django.db.backends.mysql',

I hope help you



Em quinta-feira, 13 de outubro de 2016 19:47:02 UTC-3, Andres Marin 
escreveu:
>
> Dear all,
>
> I'm trying to learn about django, follow the documentation, in my first:
>
> python manage.py migrate
>
>
> all time get this error:
>
>
> File 
> "/usr/local/lib/python3.5/site-packages/mysql/connector/django/operations.py",
>  
> line 223, in bulk_insert_sql
>
> return "VALUES " + ", ".join([items_sql] * num_values)
>
> TypeError: can't multiply sequence by non-int of type 'tuple'
>
>
> I'm ussing mysql-connector-python-2.1.4 to connect to mysql:
>
>
> settings.py:
>
> ...
>
> 'default': {
>
>   'NAME': 'firstapp',
>
>   'ENGINE': 'mysql.connector.django',
>
> ...
>
> Python 3.5.2
>
> django 1.10.2
>
> mysql  5.6.34
>
>
> Do you know which connector I can to use?
>
>
> I was tried 'pip install mysql-python' to install MySQL-python-1.2.5 but 
> is not possible, regarding with some google results, this version is not 
> supported by python 3.
>
>
> Any help, will be appreciated.
>
>
> PD: learning django, I'm new user.
>
>
> Thanks!
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/59a06282-0644-4d3e-ace9-f3c11f2cb968%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Slow first request django

2016-10-13 Thread Ricardo Prado
Hi Guys

Someone can explain me the right way do create a virtualhost with threads 
and proccess? my first request is very slow between 5 to 10 seconds.

I'm using ubuntu 14.04 with apache 2.4

Thanks

ServerName 127.0.0.2
ServerAlias ahora.local

WSGIDaemonProcess framework processes=5 threads=1 
python-path=/mnt/g/Python/osvaldo/framework/:/mnt/g/Python/osvaldo/framework/lib/python2.7/site-packages
WSGIProcessGroup framework
WSGIScriptAlias / /mnt/g/Python/osvaldo/framework/framework/wsgi.py


#DocumentRoot /mnt/g/Python
#ErrorLog /mnt/g/Python/logs/error.log
#CustomLog /mnt/g/Python/logs/access.log combined

Alias /static /mnt/g/Python/osvaldo/framework/static
Alias /media /mnt/g/Python/osvaldo/framework/media




Require all granted





Require all granted



Require all granted





-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/745f9cc4-da3c-48ce-910b-5a7ebcc7eeed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Forbidden fix

2016-10-13 Thread Ricardo Prado
Can You send an image or log about this problem?


Check virtualhost,
APACHE 2.2 - use in dir "Allow All"
APACHE 2.4 - use "Require All Grant"




Em quinta-feira, 13 de outubro de 2016 04:47:58 UTC-3, Mike Dewhirst 
escreveu:
>
> I have two similar servers behaving differently. This is the staging 
> server ... 
>
> You don't have permission to access /substance/wsds/7291/ on this server. 
>
> The production server is fine running Ubuntu 14.04 and Apache 2.2. The 
> difference is that I have just upgraded staging to Ubuntu 16.04 and 
> Apache 2.4. 
>
> The new problem resulting from the upgrade was that the Apache redirect 
> from http on port 80 to https on port 443 was failing occasionally. 
>
> That occasion was in the Django Admin when clicking (View on site) 
>
> The fix is to adjust get_absolute_url() so it always specifies https 
>
> Hope this helps someone. 
>
> Cheers 
>
> Mike 
>
>
>
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2da7c070-82f4-44c2-ad5e-d3353a556a79%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


quasi-distributed system sharing data in django

2016-10-05 Thread Ricardo Pascal
Hello folks,

I have two django projects, (let call them A and B) they are independent
applications (with different django versions), I'm in need to sync some
data/models from A to B.

My plan is to use the post_save signal to start a celery task that will
post a subset of data from A to B using the B API.

This new data will be stored in models at B and be used in relationships
with data in B. (To make things easier, those data will never(probably) be
created or updated from B application)

I'm seeing the necessity to keep the primary key on both
applications synchronized too.

My questions is: should I keep using the auto-increment id from django, or
instead use some uuid as pk?

Also, any better idea on how to implement this? Tips, unforeseen problems
or any rant about that matter will be appreciated.

Thanks in advance,

--
Att.
Ricardo Pascal

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJ5FqeoypDP0520sNcpxC82NHAy-wbWbWs8RWXktPzyhDOXUFg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django-admin commands, diango 1.10 with python 2 & python 3 on windows installed

2016-09-27 Thread Ricardo Daniel Quiroga
Hi, Use and  create a virtualenv to work with your specific python version
> virtualenv -p  
alternative create a python2.bat and add to the path for call python,
remove the secundary python from path
> python2



2016-09-26 16:16 GMT-03:00 anton :

> Hi,
>
> I am using django 1.10.1 with the following configuration:
>
> - windows 7 64bit
> - python 2.7.12 32 bit
>
> Now I am switching to python 3 so I installed additionally
> python 3.5.2 64 bit.
>
> I still need to keep python 2 because I have
> also trac (https://trac.edgewall.org) with mercurial
> (https://www.mercurial-scm.org) installed both still needing python2.
>
> Now my question:
>
>  The windows PATH env variable contains python35 and python/scrips
>  paths.
>
>  With python 2.7 allone I could call on the console django
>  admin-commands like:
>
> >> manage.py showmigrations
> or simply
> >> manage.py
> to see all commands
>
> Now woth both pythons installed
> >> manage.py
> shows me all commands
>
> But if I try to execute one command like
>
> >> manage.py showmigrations
>
> it does ... nothing, no error ... nothing.
>
> If I call python like
>
> >> python
>
> on the command line the python 3.5.2 shell starts
>
> The only way to make the django-admin commands work
> is to call them like this:
>
> >> py -3 manage.py showmigrations
>
> Now it works.
> ( of course prepending the full python exe path works too
> like
>  >> c:\python35\python manage.py showmigrations )
>
> Does somebody know the trick to use python 3.5 without the
> need to use "py -3"?
>
> Or is a simultanuously installation of python 2 and python 3 on windows
> a no-go?
>
> Thanks for a hint
>
>  Anton
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/nsbs5n%24sdk%241%40blaine.gmane.org.
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Ricardo Daniel Quiroga

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO2-wHaS0QedpDFqGT3OBTuG8ZtHhGhxE2yh4n72jj_EXuRn-w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Hello - need help on accessing current user in django forms.

2016-09-27 Thread Ricardo Daniel Quiroga
HttpRequest.user¶
<https://docs.djangoproject.com/es/1.10/ref/request-response/#django.http.HttpRequest.user>

return the autenticated user in django

def miview(request):
 login_user = request.user
 ...
in case you have not logged in return None





2016-09-23 9:44 GMT-03:00 Tim Graham :

> Try a web search for "django passing request to a form".
>
> Here's the first result: http://stackoverflow.com/
> questions/6325681/passing-a-user-request-to-forms
>
> On Friday, September 23, 2016 at 7:17:32 AM UTC-4, Naresh Kumar wrote:
>>
>> Hello,
>>
>> I need filter a queryset based on current user in Django forms.
>>
>> kindly help me if you find any.
>>
>> Thanks,
>>
>> Naresh
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/f98a65ca-57da-4ec7-a2f4-d2a79f3929d2%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/f98a65ca-57da-4ec7-a2f4-d2a79f3929d2%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Ricardo Daniel Quiroga

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO2-wHZSEK3YO9Tnj6vEetL0D19sSnd8OH5XOp6dZYj3rkDRvQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Package a virtualenv to deploy across multiple systems?

2016-09-22 Thread Ricardo Daniel Quiroga
create a docker image alternative?

2016-09-22 11:20 GMT-03:00 Saeon Tao :

> i just been learning about openstack... which i think uses a lot of
> docker... the idea is to make all apps independent of OS
>
> On Thursday, September 22, 2016 at 3:25:48 AM UTC+2, Abraham Varricatt
> wrote:
>>
>> Hello,
>>
>> Do we have any standard/recommended way to distribute the python
>> virtualenv used in a django application across multiple servers?
>>
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/3b6363bb-f34e-4470-bfc1-548c27ac3ca4%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/3b6363bb-f34e-4470-bfc1-548c27ac3ca4%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Ricardo Daniel Quiroga

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO2-wHYhTKCHd%2BoimbSBVKTgETXiKm_aszbV4-OD3pq0kiVuFA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: error in installing django[argon2] -regarding

2016-08-30 Thread Ricardo Daniel Quiroga
ggs
> replace_conflicting=True,
>   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py",
> line 826, in resolve
> dist = best[req.key] = env.best_match(req, ws, installer)
>   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py",
> line 1092, in best_match
> return self.obtain(req, installer)
>   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py",
> line 1104, in obtain
> return installer(requirement)
>   File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 380,
> in fetch_build_egg
> return cmd.easy_install(req)
>   File 
> "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py",
> line 663, in easy_install
> return self.install_item(spec, dist.location, tmpdir, deps)
>   File 
> "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py",
> line 693, in install_item
> dists = self.install_eggs(spec, download, tmpdir)
>   File 
> "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py",
> line 873, in install_eggs
> return self.build_and_install(setup_script, setup_base)
>   File 
> "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py",
> line 1101, in build_and_install
> self.run_setup(setup_script, setup_base, args)
>   File 
> "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py",
> line 1089, in run_setup
> raise DistutilsError("Setup script exited with %s" % (v.args[0],))
> distutils.errors.DistutilsError: Setup script exited with error:
> command 'x86_64-linux-gnu-gcc' failed with exit status 1
>
> 
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/024e6290-a37c-4b72-80db-cd3b3a5832ea%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/024e6290-a37c-4b72-80db-cd3b3a5832ea%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Ricardo Daniel Quiroga

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO2-wHbDin%2BBB%3DYEMmL2HKLUxpQfyx2HdhX8aU4OzJQEJt5juQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Curl PUT Request With JWT Authorization Header

2016-08-23 Thread Ricardo Daniel Quiroga
I using Postman, is a plugin of chrome for test xhr petitions

2016-08-22 23:42 GMT-03:00 Peter Boyles :

> I am still getting a hang of using curl for testing API request from the
> terminal. I have a particular issue with formatting because the API request
> I am attempting requires a JWT Token to be passed with every call. The
> request I am attempting to pass is PUT request and my question is where to
> place the header for the JWT token authorization. I have tried the
> following format and I get a error Could not resolve host: —H curl: (6)
> Could not resolve host: Authorization:
>
>
> curl -X PUT -H "Authorization: JWT " -d "field=value" 
> "https://url/update_record//"
>
>
> Any ideas?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/676040dc-a7fc-4ca8-96ce-8fd09559ab87%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/676040dc-a7fc-4ca8-96ce-8fd09559ab87%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Ricardo Daniel Quiroga

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO2-wHbxedWu%3DmzqPUhCvxo93-tr_fFP9aKk7Qov%2BzRtkzucQw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How do I fetch table values in pdf using django?

2016-07-13 Thread Ricardo Daniel Quiroga
http://stackoverflow.com/questions/25665/python-module-for-converting-pdf-to-text



2016-07-12 10:19 GMT-03:00 Derek :

> Here's a good tutorial:
>
>
> https://assist-software.net/blog/how-create-pdf-files-python-django-application-using-reportlab
>
>
> On Tuesday, 12 July 2016 13:29:00 UTC+2, Aslam Sha wrote:
>>
>>
>> How do I fetch table values in pdf using django?
>>
>> ** I AM USING REPORTLAB FOR PDP*
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/b6c6c51e-c8c5-4c53-9d2b-39d6c3adf37d%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/b6c6c51e-c8c5-4c53-9d2b-39d6c3adf37d%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Ricardo Daniel Quiroga

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO2-wHYtxDz4_qWz5wRNcd1EvKVmUA98TRY0vd1497oUHMtYpg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How can i add my django project to Bitbucket ?

2016-07-05 Thread Ricardo Daniel Quiroga
correction

$ git remote add  origin g...@bitbucket.org:[MyUSER]/[ProyectName].git

2016-07-05 10:38 GMT-03:00 Ricardo Daniel Quiroga :

>
> $ cd myproject
> $ git init
> $ touch README.md
> $ git add .
> $ git commit -m 'first commit'
> $ git remote add g...@bitbucket.org:[MyUSER]/[ProyectName].git
> $ git push origin master
>
>
>
>
> 2016-07-05 9:12 GMT-03:00 Fred Stluka :
>
>> Deepak,
>>
>> Bitbucket has pretty good documentation, including a Getting Started
>> section.  Should tell you all you need to know.  See:
>> - https://www.google.com/search?q=bitbucket+getting+started
>>
>> --Fred
>> --
>> Fred Stluka -- mailto:f...@bristle.com  --
>> http://bristle.com/~fred/
>> Bristle Software, Inc -- http://bristle.com -- Glad to be of service!
>> Open Source: Without walls and fences, we need no Windows or Gates.
>> --
>>
>> On 7/5/16 7:18 AM, Deepak Sharma wrote:
>>
>> I have created a simple django project and i have created a simple app in
>> it . Now i want to use Bitbucket for code development since we are working
>> in a team how could i possibly do that ?
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> <https://groups.google.com/d/msgid/django-users/2a4952bd-bf36-42d9-a479-68e95b623ae2%40googlegroups.com?utm_medium=email&utm_source=footer>
>> https://groups.google.com/d/msgid/django-users/2a4952bd-bf36-42d9-a479-68e95b623ae2%40googlegroups.com
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/4018e03a-c861-fde2-3ed0-60c34d01c55c%40bristle.com
>> <https://groups.google.com/d/msgid/django-users/4018e03a-c861-fde2-3ed0-60c34d01c55c%40bristle.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
>
> Ricardo Daniel Quiroga
>
>


-- 

Ricardo Daniel Quiroga

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO2-wHZG%3DD0sUGAqU30SPBh%2B1ATjQt0Vvi_LZc89R73osyk5RA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How can i add my django project to Bitbucket ?

2016-07-05 Thread Ricardo Daniel Quiroga
$ cd myproject
$ git init
$ touch README.md
$ git add .
$ git commit -m 'first commit'
$ git remote add g...@bitbucket.org:[MyUSER]/[ProyectName].git
$ git push origin master




2016-07-05 9:12 GMT-03:00 Fred Stluka :

> Deepak,
>
> Bitbucket has pretty good documentation, including a Getting Started
> section.  Should tell you all you need to know.  See:
> - https://www.google.com/search?q=bitbucket+getting+started
>
> --Fred
> --
> Fred Stluka -- mailto:f...@bristle.com  --
> http://bristle.com/~fred/
> Bristle Software, Inc -- http://bristle.com -- Glad to be of service!
> Open Source: Without walls and fences, we need no Windows or Gates.
> --
>
> On 7/5/16 7:18 AM, Deepak Sharma wrote:
>
> I have created a simple django project and i have created a simple app in
> it . Now i want to use Bitbucket for code development since we are working
> in a team how could i possibly do that ?
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> <https://groups.google.com/d/msgid/django-users/2a4952bd-bf36-42d9-a479-68e95b623ae2%40googlegroups.com?utm_medium=email&utm_source=footer>
> https://groups.google.com/d/msgid/django-users/2a4952bd-bf36-42d9-a479-68e95b623ae2%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/4018e03a-c861-fde2-3ed0-60c34d01c55c%40bristle.com
> <https://groups.google.com/d/msgid/django-users/4018e03a-c861-fde2-3ed0-60c34d01c55c%40bristle.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Ricardo Daniel Quiroga

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO2-wHYCMKzB5TZe-kf4vOi9%3DB_TdjL_BF_1ft1tZEBSydtBxQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


the Django test client - https://docs.djangoproject.com/en/1.9/intro/tutorial05/#the-django-test-client

2016-07-02 Thread Ricardo Valério


*I'm following the official tutorial...number 5 about testing... *

*https://docs.djangoproject.com/en/1.9/intro/tutorial05/#the-django-test-client 
*


*What am I doing wrong here? *

*Thanks for the help in advance...*





-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/39ecd5ef-04e9-4f89-aab8-823db9f71b74%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Contribute to Django - Python 3 or Python 2

2016-06-30 Thread Ricardo Daniel Quiroga
the next django releases don't suport python 2.x. if you want to use python
2.x in django use the 1.8 LTS

http://stackoverflow.com/questions/28908401/does-django-have-any-plans-to-drop-support-for-python-2-in-the-near-future
https://www.djangoproject.com/weblog/2015/jun/25/roadmap/

2016-06-28 22:13 GMT-03:00 Tim Graham :

> You can use either, but use Python 3. You can rely on the continuous
> integration server to test your pull request on Python 2 and debug any
> issues
>
> Can you given an example of "most places python2 is used"? In fact, the
> tutorial says, "This tutorial assumes you are using Python 3."
>
> On Tuesday, June 28, 2016 at 7:45:02 PM UTC-4, premdjango wrote:
>>
>> Hello,
>> Im trying to contribute to Django project and started with this document.
>>
>> https://docs.djangoproject.com/en/dev/intro/contributing/
>>
>> Here in couple of places I see Python3 is being used but in most places
>> python2 is used.
>>
>> Should I use Python 3 or Python 2?
>>
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/a0539448-0019-40a2-b732-e2c44799877b%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/a0539448-0019-40a2-b732-e2c44799877b%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Ricardo Daniel Quiroga

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO2-wHa0Onh2Ng03sHUDOJAcz3BkLGASkWAkDcJkkF7U884GoA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Real time change color website

2016-06-30 Thread Ricardo Daniel Quiroga
Hi
this site use many overlaping layers in a canvas to generate the image.
This is a Javascript cambas problem not django.


2016-06-30 5:59 GMT-03:00 Akhil Lawrence :

> Hi,
>
> Your requirement has nothing to do with django. The images should be
> combined using JS/CSS. Its a pure front end tweak.
>
> If your question is regarding the backend. Definitely django can do the
> job. What I mean is, you can build API's using django which will server
> layers of images requested and using JS/CSS you have to combine all those
> layers to get the actual picture.
>
>
> http://stackoverflow.com/questions/18235709/css-placing-one-image-on-top-of-another
> may help you to arrange the images..
>
>
>
> On Thursday, 30 June 2016 12:30:51 UTC+5:30, Arshpreet Singh wrote:
>>
>> Hey guys, Anyone  aware of example/project developed in Django that can
>> make functionality of website like this:
>> https://www.msistone.com/kitchen-visualizer.aspx#?id=main_image5
>> Where I can change object colors in real time, as I see from this image
>> https://www.msistone.com/VisualizerResponsive/images/kitchen51/VS0029FL.png
>> multiple images being loaded.
>>
>> Is such technique possible using Django?
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/59825349-ba60-4274-8a58-22e3c883e1f3%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/59825349-ba60-4274-8a58-22e3c883e1f3%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Ricardo Daniel Quiroga

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO2-wHZoa4O-Yo_S1i2P4sJ%2Bkb%2B44dVPDVrbXY59DZ69xwhVMQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django suit and Static files not working in Django 1.6

2016-06-06 Thread Ricardo Daniel Quiroga
The current version for django 1.6 is obsolete... please upgrade to 1.9

2016-06-01 15:34 GMT-03:00 Roger Lanoue jr :

> Hello All.
>
> I learning my first Django experience and I am making some headway. I am
> stuck on my test server and Django suit admin.
>
> I my goal is to get the new admin from Django suit to work.
>
> *Server setup*
> Ubuntu 14.04 ( A Digital Ocean VPS with one click install )
> Django Version 1.6
> Python: 2.7
> Nginx
> Postgres
>
> *Test server *
> http://162.243.201.237/
>
> *Admin (with django suit installed ) *
> http://django-suit.readthedocs.io/en/develop/
> http://162.243.201.237/admin/
>
> User: Demo
> password: Demo
>
> The css is being applied to the djando suit .
>
> *Ran command:*
> python manage.py collectstatic
>
> Results: 0 static files copied, 116 unmodified.
>
>
> *My setting.py basics*
>
> DEBUG = False
>
> TEMPLATE_DEBUG = False
>
> STATIC_URL = '/static/'
>
> STATICFILES_DIRS = [
> os.path.join(BASE_DIR, "static"),
> '/home/django/django_project/static/',
>
> When I look in to the static directory. nothing had been copied.
>
> Thank your for taking time to look at this and also sharing with me any
> clues on how to fix this.
>
> Roger
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/ee2b40b1-0716-4f5b-b4f1-8f35a60d54f6%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/ee2b40b1-0716-4f5b-b4f1-8f35a60d54f6%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Ricardo Daniel Quiroga

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO2-wHbWvj4haOuRaBDKmE0NOkCr7fni6%3DN5wiTEYEg47ZUxgQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: how to upload file with pjango

2016-06-01 Thread Ricardo Daniel Quiroga
I suggest redefining the form

class UploadFileForm(forms.Form):
title = forms.CharField(max_length=50)
file2 = forms.FileField()
MAX_FILE_SIZE = forms.CharField(widget=forms.HiddenInput(), initial =
1)


and in template upload.html you tried this?


 Title  {{ form.title }} 
Choose a file to upload: {{ form.file2 }} 
{{ form.MAX_FILE_SIZE }} 






2016-05-31 22:53 GMT-03:00 meInvent bbird :

> after following the web,
>
> it only run one time first time the function in views.py
> but after press button, it do not run post method because console did not
> show POST.
>
> where is wrong?
>
>
> https://drive.google.com/file/d/0Bxs_ao6uuBDUdGpUX3p0TjZrRGM/view?usp=sharing
>
>
>
> On Friday, May 27, 2016 at 9:50:29 PM UTC+8, Wyrven no L2Radamanthys wrote:
>>
>> Hello,
>>
>> add enctype="multipart/form-data" param in you html form
>>
>> see more info
>>
>> https://docs.djangoproject.com/es/1.9/topics/http/file-uploads/
>>
>>
>>
>> 2016-05-27 6:45 GMT-03:00 meInvent bbird :
>>
>>> how to upload file with pjango ?
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users...@googlegroups.com.
>>> To post to this group, send email to django...@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/f68770a9-58ae-4cf3-9893-c8793b192fa1%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/f68770a9-58ae-4cf3-9893-c8793b192fa1%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>>
>> Ricardo Daniel Quiroga
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/8dbb457f-07b7-4839-aa5b-757348a2b266%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/8dbb457f-07b7-4839-aa5b-757348a2b266%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Ricardo Daniel Quiroga

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO2-wHb5tHm7AE6m-%2B3DCn86WKm6f%2BipL0y%2B2FAF5scEPaC%3D9A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: UpdateView not saved

2016-05-27 Thread Ricardo Daniel Quiroga
add enctype="multipart/form-data" param in you html form tag :)

2016-05-27 11:29 GMT-03:00 Dariusz Mysior :

> I try update my photo in avatar field but it not save changes, please look
> on it
>
> update_form.html
>
> {% extends 'base.html' %}
> {% block title %}Edycja profilu{% endblock %}
>
>
> {% if user.is_authenticated %}
> {% block top_menu %}
> {{ user.username }}
> Wyloguj się
> {% endblock %}
>
> {% block content %}
> 
> {% csrf_token %}
> {{ form.as_p }}
> 
> 
> {% endblock %}
> {% else %}
>
> {% endif %}
>
>
> views.py
>
> from django.shortcuts import render
> from django.views.generic import TemplateView, UpdateView
> from users.models import MysiteUser
>
> class ProfileView(TemplateView):
> template_name = 'profile.html'
>
> class EditView(UpdateView):
> model = MysiteUser
> fields = ['avatar']
> pk_url_kwarg = 'pk'
> template_name = 'update_form.html'
> success_url = '/myprofile/'
>
> def form_valid(self, form):
> self.object = form.save()
> return super(EditView,self).form_valid(form)
>
>
> models.py
>
> from django.db import models
> from django.contrib.auth.models import AbstractUser
>
> ##
>
> class MysiteUser(AbstractUser):
> avatar = models.ImageField(upload_to="avatar")
>
> def __str__(self):
> return self.username
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/968faf01-3b6b-43d8-8c98-d1555d48ee4d%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/968faf01-3b6b-43d8-8c98-d1555d48ee4d%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Ricardo Daniel Quiroga

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO2-wHYQSaBy0oUXNpvSvm%3D9SYi%2BheVANwDnMdGLOhY3GFQPSA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: how to upload file with pjango

2016-05-27 Thread Ricardo Daniel Quiroga
Hello,

add enctype="multipart/form-data" param in you html form

see more info

https://docs.djangoproject.com/es/1.9/topics/http/file-uploads/



2016-05-27 6:45 GMT-03:00 meInvent bbird :

> how to upload file with pjango ?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/f68770a9-58ae-4cf3-9893-c8793b192fa1%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/f68770a9-58ae-4cf3-9893-c8793b192fa1%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Ricardo Daniel Quiroga

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO2-wHatRpoNWkkcd4rJpCni1qCGbnHpJj4HCnf%2BJZRLstUG8A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: multi-select the items from drop down list and save them in database.

2016-05-10 Thread Ricardo Daniel Quiroga
Hi,
I can think of many ideas,but you could try

https://pypi.python.org/pypi/django-select-multiple-field/0.3.1

2016-05-10 3:06 GMT-03:00 Nikita Jadhav :

> hii everyone,
> I want to multi-select the items from drop down list and save them in
> database. how it can be achieved?. by using simple code in django
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/691507a3-c3e8-4f69-b8d3-c6dad72a09dc%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/691507a3-c3e8-4f69-b8d3-c6dad72a09dc%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Ricardo Daniel Quiroga

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO2-wHY0Q-Kfi1u%2BzD0OqAKw5OXSbNEzN%2B40%2BZ3pSNJp1E9GjA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to access selected options from a select list to show them in a table ?

2016-05-06 Thread Ricardo Daniel Quiroga
Hello,
What you must do is to use Javascript and AJAX, to have the desired
behavior, I guess would be for onchange event. By the way it is therefore
desirable to handle the tables in the following format


   

   
   
   


regards

2016-05-03 8:06 GMT-03:00 :

> So i have a select list and a table,and i want to show only the data that
> corresponds the selected item.
>
> This is my index.html file
>
> 
> Owners
> ---
> {% for owner in owners %}
>  {{ owner.person_id }} {{ owner.first_name }} 
> {{ owner.last_name }}
> {% endfor %}
> 
>  
> 
> 
> Id
> Space
> City
> Street
> Price
> Purpose
> 
>
>
> {% for info in information %}
>
> 
> {{ info.owner_id }}
> {{ info.space }}
> {{ info.city }}
> {{ info.street }}
> {{ info.price }}
> {{ info.get_purpose }}
> {% endfor %}
>
> 
>
> 
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/e3502e4e-c58b-46e7-8201-9b07edcca7dc%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/e3502e4e-c58b-46e7-8201-9b07edcca7dc%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Ricardo Daniel Quiroga

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO2-wHaaGX5LTa%3D_WteSoB8-tpTxvvUWVCjHUcBrutf79WOAXg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


CKEditor

2016-04-11 Thread Ricardo Felipe Ríos Higueras
Buenas.

Estoy usando ckeditor en django. 
Todo bien, lo instalé bien y por parte del admin funciona excelente.

Lo que quiero es llevar esa herramienta a un form. Crear un formulario que 
contenga ckeditor.

Espero me entiendan y puedan ayudarme, ya que, he intentado de muchas 
formas y nada me resulta.

Muchas gracias!
Saludos.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d10cda1c-176b-4667-8f7c-72ce6578519c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Help me! Error in Django. Migrate mysql, datetime and more.

2016-03-28 Thread Ricardo Felipe Ríos Higueras


Hi.

I am learning Django, but, I have major problems because I don´t know much 
about python/Django.

Here this problem:

*problem one : the databases backend does not accept 0 as a ' valueError: 
The databases backend does not accept 0 as value for AutoField.*
*problem two: TypeError: int() argument must be a string or a number, not 
'datetime.datetime'*

Here my models.py


*from __future__ import unicode_literals*
*from django.db import models*
*from django.contrib import admin*
*from django.contrib import **
*from tinymce import models as tinymce_models*
*from PIL import Image*
*from django.contrib.auth.models import User*


*ESTADO_VISIBLE = [1,2]*

*class ManejadorPost(models.Manager):*
* def get_query_set(self):*
* default_queryset = super(ManejadorPost, self).get_query_set()*
* return default_queryset.filter(status__in=ESTADO_VISIBLE)*

*class Categorias(models.Model):*
* nombre = models.CharField(max_length=50)*
* slug = models.SlugField(max_length=50, unique=True, default='slug')*
* descripcion = models.TextField()*

* creada_en = models.DateTimeField(auto_now_add=True)*
* actualizada_al = models.DateTimeField(auto_now=True)*


*class Meta:*
* db_table = 'categorias'*
* verbose_name_plural = 'Categorias'*

*def __unicode__(self):*
* return self.nombre*


*class BlogPost(models.Model):*
* ESTADOS=((1,"Publicado"), (2, 'Archivado'), (3,'Nesecita editarse'), 
(4,'Nesecita aprobacion'))*
* status = models.IntegerField(choices=ESTADOS,default=4)*
* objetos_panel = models.Manager()*
* objects = ManejadorPost()*
* title=models.CharField(max_length=150)*
* author = models.ForeignKey(User)*
* time = models.DateTimeField(auto_now=True)*
* categorias_post = models.ManyToManyField(Categorias)*
* body = tinymce_models.HTMLField()*
* imagen = models.ImageField(upload_to = "photos")*

*class Meta:*
* db_table = 'entradas'*
* verbose_name_plural = 'Posts'*

*def __unicode__(self):*
* return self.title*

*def __unicode__(self):*
* return self.body*



I hope you will join me. 
Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c4825eb7-ab86-4835-88a3-d24ed14495a0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
from django.contrib import admin
from django.contrib import *
from tinymce import models as tinymce_models
from PIL import Image
from django.contrib.auth.models import User
import time
from datetime import date

# Create your models here.

ESTADO_VISIBLE = [1,2]

class ManejadorPost(models.Manager):
	def get_query_set(self):
		default_queryset = super(ManejadorPost, self).get_query_set()
		return default_queryset.filter(status__in=ESTADO_VISIBLE)

class Categorias(models.Model):
	nombre = models.CharField(max_length=50)
	slug = models.SlugField(max_length=50, unique=True, default='slug')
	descripcion = models.TextField()

	creada_en = date.today()
	actualizada_al = date.today()


class Meta:
	db_table = 'categorias'
	verbose_name_plural = 'Categorias'

def __unicode__(self):
	return self.nombre


class BlogPost(models.Model):
	ESTADOS=((1,"Publicado"), (2, 'Archivado'), (3,'Nesecita editarse'), (4,'Nesecita aprobacion'))
	status = models.IntegerField(choices=ESTADOS,default=4)
	objetos_panel = models.Manager()
	objects = ManejadorPost()
	title=models.CharField(max_length=150)
	author = models.ForeignKey(User)
	time = date.today()
	categorias_post = models.ManyToManyField(Categorias)
	body = tinymce_models.HTMLField()
	imagen = models.ImageField(upload_to = "photos")

class Meta:
	db_table = 'entradas'
	verbose_name_plural = 'Posts'

def __unicode__(self):
	return self.title

def __unicode__(self):
	return self.body













RE: How to install Django on Windows article

2016-01-29 Thread Ricardo Daniel Quiroga
Install python and add to path 
In cmd 
> pip install django.


-Mensaje original-
De: Carlos Andre
Enviado: 29/01/2016 11:36
Para: django-users@googlegroups.com
Asunto: Re: How to install Django on Windows article




1º download a version django (admint who python intaled);

2º unzip the django in your prefer path;
3º acess that path with cmd;
4º insert:   setup.py install




2016-01-29 8:29 GMT-03:00 Rafael E. Ferrero :




Never occur to me in Win8.1 ... why not install VirtualBox with an Ubuntu or 
other flavor of linux ? (if you need your windows)

It's more easy for django and... it's recommended.

Cheers !!








Rafael E. Ferrero



 

2016-01-29 3:17 GMT-03:00 Руслан Ломагин :


Hello, i have some issues that is occured while i was installing Django on my 
Windows 10.
I'm new in using Django framework and also python on windows.




To the article:





Install Python




I installed python as it was said:


Downloaded python 3.5.1 for windows.

Installed using option: create system variable.

Checked version.



Install virtualenv and virtualenvwrapper¶




Then i tried to instal virtualenv and virtualenvwrapper as it is said:

pip install virtualenvwrapper-winbut the command freezes (or hangs) widows 
command prompt.After some search i found "python -m pip install virtualenv" and 
"python -m pip install virtualenvwrapper" that worked well.And now i'm 
stuck.mkvirtualenv myproject is not working.As i investigated: mkvirtualenv is 
a batch file, that executes virtualenv.exe in python's Script folder.This 
executable file hangs my command prompt, every time i type mkvirtualenv 
myproject or executing "virtualenv.exe myproject" directly.I don't know what to 
do, but what i do know - those pip.exe, virtualenv.exe and other .exe files in 
%PYTHONHOME%\Scripts are hanging my commandprompt.If Anyone has any ideas with 
my problem, please help me.
-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
 To unsubscribe from this group and stop receiving emails from it, send an 
email to django-users+unsubscr...@googlegroups.com.
 To post to this group, send email to django-users@googlegroups.com.
 Visit this group at https://groups.google.com/group/django-users.
 To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b86b3abf-7c66-414b-9bff-691a54868d88%40googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.
 



-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
 To unsubscribe from this group and stop receiving emails from it, send an 
email to django-users+unsubscr...@googlegroups.com.
 To post to this group, send email to django-users@googlegroups.com.
 Visit this group at https://groups.google.com/group/django-users.
 To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJJc_8X-FSzetbzvx4M%2BK6pbwDHe%2B4_u6%3DL2BPZqpckGvFU9LA%40mail.gmail.com.


 For more options, visit https://groups.google.com/d/optout.
 


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
 To unsubscribe from this group and stop receiving emails from it, send an 
email to django-users+unsubscr...@googlegroups.com.
 To post to this group, send email to django-users@googlegroups.com.
 Visit this group at https://groups.google.com/group/django-users.
 To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA8yBMyrnC9rxOK9z-xv_DZGWTAR2wYBPq2x9A9%3DynDVuafX4Q%40mail.gmail.com.
 For more options, visit https://groups.google.com/d/optout.
 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/56a5.56a78c0a.25b37.0e75%40mx.google.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django 1.9.1/python3.4 install errors

2016-01-09 Thread Ricardo Daniel Quiroga
pip unistall django
pip install django

2016-01-09 19:26 GMT-03:00 Simon Charette :

> Hi Nicholas,
>
> These warnings should be safe to ignore.
>
> See 1.9 release notes
> <https://docs.djangoproject.com/en/1.9/releases/1.9/#syntaxerror-when-installing-django-setuptools-5-5-x>
> for more details.
>
> Simon
>
>
> Le samedi 9 janvier 2016 16:30:14 UTC-5, Nicholas Geovanis a écrit :
>>
>> Hi all -
>> Received these messages when installing Django 1.9.1 with python 3.4 on
>> Centos 7. Wondering if they are of concern, since pip stated "Succesfully
>> installed Django" (see below, also apparently succesful import of django in
>> python follows below): Thanks
>>
>> [root@localhost ~]# pip3.4 install Django==1.9.1
>> Downloading/unpacking Django==1.9.1
>>   Downloading Django-1.9.1-py2.py3-none-any.whl (6.6MB): 6.6MB downloaded
>> Installing collected packages: Django
>> *** Error compiling
>> '/tmp/pip_build_root/Django/django/conf/app_template/apps.py'...
>>   File "/tmp/pip_build_root/Django/django/conf/app_template/apps.py",
>> line 1
>> {{ unicode_literals }}from django.apps import AppConfig
>>  ^
>> SyntaxError: invalid syntax
>>
>> *** Error compiling
>> '/tmp/pip_build_root/Django/django/conf/app_template/models.py'...
>>   File "/tmp/pip_build_root/Django/django/conf/app_template/models.py",
>> line 1
>> {{ unicode_literals }}from django.db import models
>>  ^
>> SyntaxError: invalid syntax
>>
>> Successfully installed Django
>> Cleaning up...
>> [root@localhost ~]# exit
>> logout
>> [ngeo@localhost src]$ python3
>> Python 3.4.2 (default, Dec 20 2014, 13:53:33)
>> [GCC 4.8.2 20140120 (Red Hat 4.8.2-16)] on linux
>> Type "help", "copyright", "credits" or "license" for more information.
>> >>> import django
>> >>> print(django.get_version())
>> 1.9.1
>> >>>
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/b002fab6-9d62-45e0-8a69-a5a8a51d1711%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/b002fab6-9d62-45e0-8a69-a5a8a51d1711%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Ricardo Daniel Quiroga

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO2-wHazCrW%3DnLN5HZO6UD3VMVx_hKY6Wvj46Qwqk0rDrFGCCQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Foreign key in sqlite3

2015-10-02 Thread Ricardo Daniel Quiroga
add foreign key in model, not in database, but it can cause conflicts with
django.
anyway if you even want to do it reviews the documentation SQLite

2015-09-30 13:12 GMT-03:00 Gergely Polonkai :

> Assuming you are using Django and it's ORM, the same way as in any other
> database:
>
> fieldname = models.ForeignKey(AnotherModel)
> On 30 Sep 2015 15:18, "Bhanu Kathuria" <001kathuriabh...@gmail.com> wrote:
>
>> I am using sqlite3 database.
>> How can I add foreign key between two tables.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/56c957c9-6b03-4c19-9566-9a63cdbf8319%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/56c957c9-6b03-4c19-9566-9a63cdbf8319%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CACczBUKyATKexddYKEMhKyg4SpywuyZ7uMxDK5HMXxadQV7vLg%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CACczBUKyATKexddYKEMhKyg4SpywuyZ7uMxDK5HMXxadQV7vLg%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Ricardo Daniel Quiroga

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO2-wHabpERhmoJGGRYJWxOee%2BWpKNQUpEn9ciBJ59AfJezRGg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


RE: django on Windows

2015-10-01 Thread Ricardo Daniel Quiroga
The Best way is install activepython use 32bits for more compatibility with any 
modules and open cmd.exe 

 pip install -upgrade pip
 pip install django 

sorry for bad english . I speak spanish :(


-Mensaje original-
De: Robin Lery
Enviado: 01/10/2015 09:23
Para: django-users@googlegroups.com
Asunto: Re: django on Windows

Did you install python? And is it in your environmental variable? If both the 
answers yes then you could try all the commands using cmd prompt in windows. 

On 1 Oct 2015 17:51, "Антон Заровский"  wrote:


How use concole commands at windows?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
 To unsubscribe from this group and stop receiving emails from it, send an 
email to django-users+unsubscr...@googlegroups.com.
 To post to this group, send email to django-users@googlegroups.com.
 Visit this group at http://groups.google.com/group/django-users.
 To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d9d6d648-f9cd-4f37-8214-9d0d0927c75d%40googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.
 
-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
 To unsubscribe from this group and stop receiving emails from it, send an 
email to django-users+unsubscr...@googlegroups.com.
 To post to this group, send email to django-users@googlegroups.com.
 Visit this group at http://groups.google.com/group/django-users.
 To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2B4-nGqTnJ9iTeDwoZBjU%2BcJ3H2Vcs-8VUtsKbbR1NXP8tm7wQ%40mail.gmail.com.
 For more options, visit https://groups.google.com/d/optout.
 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/560d8a49.d0ed8c0a.b1ab9.0e25%40mx.google.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django and Wiki

2015-09-03 Thread Ricardo Vitorino
Tom is 
right: https://builtwith.com/?https%3a%2f%2fcode.djangoproject.com%2fwiki

Best regards
Ricardo Vitorino

On Thursday, 3 September 2015 13:04:39 UTC+1, Tom Evans wrote:
>
> On Thu, Sep 3, 2015 at 12:01 PM, Нина Белявская  > wrote: 
> > Is anywhere in the Web examples of Wiki projects on Django? 
>
> https://www.djangopackages.com/grids/g/wikis/ 
>
> > Which wiki-engine is used on https://code.djangoproject.com/wiki/? 
>
> That is not a django site, it is a Trac instance: 
>
> http://trac.edgewall.org/ 
>
> Cheers 
>
> Tom 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1f29d3d2-03e3-4371-bfe3-401ec3636bd0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


RE: Necesito ayuda para poner a funcionar django el tutorial no loentiendo

2015-02-17 Thread Ricardo Daniel Quiroga
Primero creas un proyecto en un directorio con el comando (abri la consola 
seleciona el directorio donde trabajar y) ejecuta django-admin startproject 
miproyecto se crea una carpeta con lo necesario para tu proyecto django en la 
carpeta ejecutas python manage.py runserver y abres el navegador en 
127.0.0.1:8000 veras un felicidades django esta corriendo luego es crear una 
aplicación, defines los modelos escribes los controladores y diseñas las 
vistas, por ultimo haces deploy, en el tutorial de django esta bastante 
explicado como se trabaja no entiendo que parte te pierdes. 

-Mensaje original-
De: Charly Román
Enviado: 17/02/2015 14:47
Para: django-users@googlegroups.com
Asunto: Re: Necesito ayuda para poner a funcionar django el tutorial no 
loentiendo

este grupo es de habla inglesa, te recomiendo: 
https://groups.google.com/forum/#!forum/django-es Y definitivamente debes 
proveer más información.



2015-02-17 9:41 GMT-06:00 Anibal Manuel Solorzano Nuñez 
:


alguieme puede colaborar sobre como iniciar a trabajar con django apenas lo 
tengo instalado
y no que archivo ejecutar y no entiendo como es que hay que trabajar con python




-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
 To unsubscribe from this group and stop receiving emails from it, send an 
email to django-users+unsubscr...@googlegroups.com.
 To post to this group, send email to django-users@googlegroups.com.
 Visit this group at http://groups.google.com/group/django-users.
 To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/97683752-e920-4b4a-a203-85432bbbe9a9%40googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.
 




-- 


Charly Román
Software Developer
http://croman.mx
 
-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
 To unsubscribe from this group and stop receiving emails from it, send an 
email to django-users+unsubscr...@googlegroups.com.
 To post to this group, send email to django-users@googlegroups.com.
 Visit this group at http://groups.google.com/group/django-users.
 To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CABeWMUYHvBEtAGEeKOHckOEMNE1ZywU%2BDp8d6_aLCV0cP%2BjwqA%40mail.gmail.com.
 For more options, visit https://groups.google.com/d/optout.
 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/54e3acf7.0858e00a.17ff.a8de%40mx.google.com.
For more options, visit https://groups.google.com/d/optout.


Re: Implementing a grammar checker on the web

2015-02-16 Thread Ricardo Daniel Quiroga
security disable CORS, and add CSRF tokken verification..
if only going to implement the grammar interpreter is way too django uses
something simpler like bottle or flask

2015-02-16 16:02 GMT-03:00 Ricardo Daniel Quiroga :

> Hi
>
> html + textarea + javascript +  AJAX?
>
>
>
> 2015-02-16 9:58 GMT-03:00 Kelvin Nyota :
>
> I have built a grammar checker in Python. It works well in the terminal,
>> but i don't know how to implement it on the web. How can I implement a
>> grammar checker on the web, like Grammarly or spellcheckerplus? I could not
>> find any article that talked about that at all.Most of it was errelevant.
>> Infact, what I have done with Javascript for my grammarchecker
>> <http://researchpaperstobuy.com/grammarchecker.html> interface is
>> better. Please help guys.
>>
>> I will not need a database because I have a text file for replacing
>> words. What I don't know is if I will need some sort of a server to
>> communicate back and forth for reading, checking, and retrieving. The link
>> on the grammar checker button should also be protected to prevent people
>> from using my code to do their grammar checking functionality on their
>> websites.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/b7817512-cdad-460d-b0b9-a643e303d490%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/b7817512-cdad-460d-b0b9-a643e303d490%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
>
> Ricardo Daniel Quiroga
>
>


-- 

Ricardo Daniel Quiroga

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO2-wHYCgf0aw-NuL3yNKRnrzUZLca6nJgfzn4n-zzVrcH%3D2Ag%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Implementing a grammar checker on the web

2015-02-16 Thread Ricardo Daniel Quiroga
Hi

html + textarea + javascript +  AJAX?



2015-02-16 9:58 GMT-03:00 Kelvin Nyota :

> I have built a grammar checker in Python. It works well in the terminal,
> but i don't know how to implement it on the web. How can I implement a
> grammar checker on the web, like Grammarly or spellcheckerplus? I could not
> find any article that talked about that at all.Most of it was errelevant.
> Infact, what I have done with Javascript for my grammarchecker
> <http://researchpaperstobuy.com/grammarchecker.html> interface is better.
> Please help guys.
>
> I will not need a database because I have a text file for replacing words.
> What I don't know is if I will need some sort of a server to communicate
> back and forth for reading, checking, and retrieving. The link on the
> grammar checker button should also be protected to prevent people from
> using my code to do their grammar checking functionality on their websites.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/b7817512-cdad-460d-b0b9-a643e303d490%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/b7817512-cdad-460d-b0b9-a643e303d490%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Ricardo Daniel Quiroga

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO2-wHZTSdZSv0yPw27eNuXFi5UyyyRX9r33UXyrkYFGfrdb5A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: 求解答 说是找不到'hello', 我看Python的搜索path 也对啊 附件是程序 我是第一次接触Django

2014-11-11 Thread Ricardo L. Dani
actually, or use 'mysite.viess.hello' on the second argument of your url
definition

2014-11-11 13:07 GMT-02:00 Ricardo L. Dani :

> missing
>
> from .views import hello
>
> on urls.py
>
> or use 'hello' as string
>
> 2014-11-11 11:54 GMT-02:00 tkdchen :
>
> 这不是Django的问题。你先把Python搞明白。
>>
>> On Sunday, November 9, 2014 11:29:58 PM UTC+8, zhoumin...@gmail.com
>> wrote:
>>
>>> NameError at /
>>>
>>> name 'hello' is not defined
>>>
>>>   Request Method: GET Request URL: http://127.0.0.1:8000/ Django
>>> Version: 1.7.1 Exception Type: NameError Exception Value:
>>>
>>> name 'hello' is not defined
>>>
>>>  Exception Location: E:\djcode\mysite\mysite\urls.py in , line 5 
>>> Python
>>> Executable: C:\Python27\python.exe Python Version: 2.7.6 Python Path:
>>>
>>> ['E:\\djcode\\mysite',
>>>  'C:\\Python27\\lib\\site-packages\\setuptools-1.1.4-py2.7.egg',
>>>  'C:\\Python27\\lib\\site-packages\\swampy-2.1.7-py2.7.egg',
>>>  'C:\\Python27\\lib\\site-packages\\django-1.7.1-py2.7.egg',
>>>  'C:\\windows\\system32\\python27.zip',
>>>  'C:\\Python27\\DLLs',
>>>  'C:\\Python27\\lib',
>>>  'C:\\Python27\\lib\\plat-win',
>>>  'C:\\Python27\\lib\\lib-tk',
>>>  'C:\\Python27',
>>>  'C:\\Python27\\lib\\site-packages']
>>>
>>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/8cf2f5d7-2906-4dad-88ab-0d6bd290008c%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/8cf2f5d7-2906-4dad-88ab-0d6bd290008c%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> []`s
> Ricardo L. Dani
> http://about.me/ricardodani
>



-- 
[]`s
Ricardo L. Dani
http://about.me/ricardodani

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEq3mei4Hd_t%3DZPaL23Q7yhQohPpm9VTAda5V8SPtrqyMZ-G6Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: 求解答 说是找不到'hello', 我看Python的搜索path 也对啊 附件是程序 我是第一次接触Django

2014-11-11 Thread Ricardo L. Dani
missing

from .views import hello

on urls.py

or use 'hello' as string

2014-11-11 11:54 GMT-02:00 tkdchen :

> 这不是Django的问题。你先把Python搞明白。
>
> On Sunday, November 9, 2014 11:29:58 PM UTC+8, zhoumin...@gmail.com wrote:
>
>> NameError at /
>>
>> name 'hello' is not defined
>>
>>   Request Method: GET Request URL: http://127.0.0.1:8000/ Django Version:
>> 1.7.1 Exception Type: NameError Exception Value:
>>
>> name 'hello' is not defined
>>
>>  Exception Location: E:\djcode\mysite\mysite\urls.py in , line 5 
>> Python
>> Executable: C:\Python27\python.exe Python Version: 2.7.6 Python Path:
>>
>> ['E:\\djcode\\mysite',
>>  'C:\\Python27\\lib\\site-packages\\setuptools-1.1.4-py2.7.egg',
>>  'C:\\Python27\\lib\\site-packages\\swampy-2.1.7-py2.7.egg',
>>  'C:\\Python27\\lib\\site-packages\\django-1.7.1-py2.7.egg',
>>  'C:\\windows\\system32\\python27.zip',
>>  'C:\\Python27\\DLLs',
>>  'C:\\Python27\\lib',
>>  'C:\\Python27\\lib\\plat-win',
>>  'C:\\Python27\\lib\\lib-tk',
>>  'C:\\Python27',
>>  'C:\\Python27\\lib\\site-packages']
>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/8cf2f5d7-2906-4dad-88ab-0d6bd290008c%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/8cf2f5d7-2906-4dad-88ab-0d6bd290008c%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
[]`s
Ricardo L. Dani
http://about.me/ricardodani

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEq3mejPbmcyXb5enbxOYBQNSSPt5HW9zMr_ZSkbQoV68WX%3DzA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: update() on queryset django 1.7.1 not functional

2014-11-10 Thread Ricardo L. Dani
Hello Biola,

When you do a update in a queryset, the objects of the Session that already
instantiated need to be updated.
If you do in your test:
self.assertEqual(Session.objects.get(id=result.id).price, Decimal('700'))
The assertion will be ok


2014-11-10 8:21 GMT-02:00 Biola Oyeniyi :

> I have atttempted updating a model based on using the update() method as
> described in the docs
> https://docs.djangoproject.com/en/dev/ref/models/querysets/ ,
> I have used both sqlite and postgres but still end up with the model not
> being updated.
>
> My code is shown below.
>
>def create_session(self, email='devito@gmailcom',
> date=datetime.datetime.now(),
>duration=datetime.timedelta(hours=1)):
> new_user = UserFactory(email=email)
> sf = TutorSessionFactory(tutor_with_skill=self.ts, buyer=new_user,
> date=date,duration=duration)
> return sf
>
>
> def test_can_update_ehen_udated(self):
> result = self.create_session()
> *Session.objects.filter(id=result.id
> <http://result.id>).update(price=Decimal('700'))*
> self.assertEqual(result.price,Decimal('700'))
>
>
> And the error message
>
> Failure
> Traceback (most recent call last):
>   File "C:\Python27\Lib\unittest\case.py", line 329, in run
> testMethod()
>   File
> "F:\work-projects\python\django-projects\Tuteria\tuteria\tutor_sessions\tests\test_model.py",
> line 24, in test_can_update_ehen_udated
> self.assertEqual(result.price,Decimal('700'))
>   File "C:\Python27\Lib\unittest\case.py", line 513, in assertEqual
> assertion_func(first, second, msg=msg)
>   File "C:\Python27\Lib\unittest\case.py", line 506, in _baseAssertEqual
> raise self.failureException(msg)
> AssertionError: Decimal(500) != Decimal('700')
>
> Any confirmation on the above error would be appreciated
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/83c6c0e3-592e-4357-8556-797eff6e261d%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/83c6c0e3-592e-4357-8556-797eff6e261d%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
[]`s
Ricardo L. Dani
http://about.me/ricardodani

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEq3mejytVqAJDtLdeO_sBmk08OERVF9mwfpfgm2%3D8GpdrJF7Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: static files in Django 1.7 ; Anything was change?

2014-09-15 Thread Ricardo Daniel Quiroga
hi

in you setings.py add

in INSTALLED_APPS  add   'django.contrib.staticfiles',


STATIC_URL = '/media/'


STATICFILES_DIRS = (
os.path.join(BASE_DIR, "media"), #you template path
)




2014-09-15 14:27 GMT-03:00 Fellipe Henrique :

> I in development mode, DEBUG = True. using the django server.
>
> I already run './manage.py collectstatic'  they create all my static in my
> path.. but don't work...
>
> T.·.F.·.A.·. S+F
> *Fellipe Henrique P. Soares*
>
> e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \
> 's/(.)/chr(ord($1)-2*3)/ge'
> *Blog: http://fhbash.wordpress.com/ <http://fhbash.wordpress.com/>*
> *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>*
> *Twitter: @fh_bash*
>
> 2014-09-15 8:41 GMT-03:00 Vladimir Chukharev  >:
>
>> Yes,  there are some changes, see release notes. In particular, you
>> probably need to run 'django-admin collectstatic'.
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Django users" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/django-users/ExbIrYMBKhs/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/ff527a78-0c27-4b99-89bc-34059132855a%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/ff527a78-0c27-4b99-89bc-34059132855a%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAF1jwZEsN8_fWq_SjhWZ-yTt-%2BXnQKZ1gTqgSJnoGw7EseXGgQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAF1jwZEsN8_fWq_SjhWZ-yTt-%2BXnQKZ1gTqgSJnoGw7EseXGgQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Ricardo Daniel Quiroga - L2Radamanthys

   Msn: l2radamant...@gmail.com
   ricardo_q...@hotmail.com

   Email: l2radamant...@gmail.com
   l2radamant...@saltalug.org.ar
   ricardoquiroga@gmail.com

   sitio Web: http://www.l2radamanthys.com.ar
   http://github.com/L2Radamanthys

   Facebook: http://es-la.facebook.com/L2Radamanthys
   Twitter:@l2Radamanthys
-

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO2-wHa9cV2pv1makDKGv3RYsf2z%2Bv18NyKuFKwAs7M3p5dYcw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Problem in the Tutorial 01

2014-07-27 Thread Ricardo Daniel Quiroga
get() si no existe coincidencia te tira error asi de simple.


2014-07-24 11:41 GMT-03:00 Daniel Roseman :

> On Thursday, 24 July 2014 13:53:54 UTC+1, Fabian Zentner wrote:
>
>> Hey guys,
>>
>> I'm new with Django and Python as well. I'm doing the tutorial 1 on the
>> website (https://docs.djangoproject.com/en/1.6/intro/tutorial01/).
>> I'm using Python27 (C:\Python27)
>> In C:\Python27\Scripts\ I have the project mysite and polls like in the
>> tutorial
>>
>> In the part "Playing with the API"
>>
>>
>> **
>>
>
>
>>
>>
>>
>>
>>
>> *>>> p.choice_set.all() [, > object>, , , > object>, ] >>> p.choice_set.count() 6 *
>> I get always Poll: Poll object or Choice: Choice object instead of the
>> defined text. Also I have problems with the part of
>>
>>
>>
>> * p = Poll.objects.get(pk=1) >>> p.was_published_recently() *
>> Could somebody help me please? Before I start with the tutorial number
>> 2...
>>
>> Thanks a lot.
>>
>> Fabian
>>
>
>
> After you make changes to the code,  you need to reload it: the easiest
> way is exit your shell and go back in.
> --
> DR.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/d80dc547-6194-4398-81d9-e93db01ca9cf%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/d80dc547-6194-4398-81d9-e93db01ca9cf%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Ricardo Daniel Quiroga - L2Radamanthys

   Msn: l2radamant...@gmail.com
   ricardo_q...@hotmail.com

   Email: l2radamant...@gmail.com
   l2radamant...@saltalug.org.ar
   ricardoquiroga@gmail.com

   sitio Web: http://www.l2radamanthys.com.ar
   http://github.com/L2Radamanthys

   Facebook: http://es-la.facebook.com/L2Radamanthys
   Twitter:@l2Radamanthys
-

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO2-wHZs4Zh2B2RgS%2BSfrDZLLHSUZ00tD37nFEFB-Ou1%3DB1swA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: OO in Django

2014-06-23 Thread Ricardo Daniel Quiroga
Hi
 I think I would do as follows :P

#models.py code

class Customer(model.Model):
***

class Transation(model.Model):
 ***
 customer = models.ForeignKey(Customer)


class Person(Customer):
  ***

class Corporation(Customer):
  ***

*** you object atributes


2014-06-23 11:18 GMT-03:00 Eduardo Basílio :

> Hello,
> Can you help me on a question OO in Django?
>
> How the Transaction class can reference Person or Corporation?
> * Customer is an abstract class
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/26474e7c-f79e-416b-8569-9edb689dc191%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/26474e7c-f79e-416b-8569-9edb689dc191%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Ricardo Daniel Quiroga - L2Radamanthys

   Msn: l2radamant...@gmail.com
   ricardo_q...@hotmail.com

   Email: l2radamant...@gmail.com
   l2radamant...@saltalug.org.ar
   ricardoquiroga@gmail.com

   sitio Web: http://www.l2radamanthys.com.ar
   http://github.com/L2Radamanthys

   Facebook: http://es-la.facebook.com/L2Radamanthys
   Twitter:@l2Radamanthys
-

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO2-wHa%3Da6%3Drz%3DXFoK%3DwCcqK8HPRhstDc3Mo2Dps0TpnNhgq2A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Different user login after session was closed redirects to previous user last page

2013-12-12 Thread Ricardo Tubio-Pardavila
 

 
  
I am currently developing a Django website and I am using 
django.contrib.auth and django-security-session for closing user sessions 
automatically. 

In case a user leaves its session open and a new user arrives at the same 
navigator after that session expired, if the new user attempts to use that 
same session, the session will be automatically closed. However, if now 
this new user logs in again, he is redirected to the last page where the 
previous user was.

I have taken a look at the code from django-security-session and I found 
the following at middleware.py "process_request":

from django.contrib.auth import logout...def process_request(self, 
request):
...
delta = now - get_last_activity(request.session)
if delta.seconds >= EXPIRE_AFTER:
logout(request)
...

So it seems that django-security-session relies on django.contrib.auth for 
closing the session. This logout flushes the current session and removes 
user id's from the request. However, the current page for the user that has 
just being logged out is still preserved for redirection after the 
following login. This login, in my case, is performed by the decorator 
@login_required, which relies on method 
"django.contrib.auth.views.redirect_to_login":

def redirect_to_login(next, login_url=None, \
redirect_field_name=REDIRECT_FIELD_NAME):
...
resolved_url = resolve_url(login_url or settings.LOGIN_URL)
login_url_parts = list(urlparse(resolved_url))
if redirect_field_name:

querystring = QueryDict(login_url_parts[4], mutable=True)
*querystring**[redirect_field_name] =** next*
login_url_parts[4] = querystring.urlencode(safe='/')

   return HttpResponseRedirect(urlunparse(login_url_parts))

... where the page for redirection is generated utilizing the url from the 
last user that is already logged out and that might not be the same as the 
one that is logging in right now.

Before starting patching and freaking out around the code, is there 
anything I am missing? Is there anyway in which I can instruct 
django.contrib.auth not to do this and, in case a different user logs in, 
just redirect the new user to its home page?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9f7abd93-bd10-4ce1-8dc6-eedf9943b1ab%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Does not generate the password hash my User

2013-12-09 Thread Ricardo Kamada
Thanks for the reply Jérôme.
Know what it says but said if I just edit the save of the form () i lose
the login form because the save () the model User.objects.create_user
(self.email, self.email, self.password)

Ricardo

Ricardo


2013/12/9 Jérôme Thiard 

> The problem is  that you have a `password` field in your `Cliente` model.
> So the `ClienteForm` save the readable value of the password in the Cliente
> model.
>
> You should not have this field in the model. Instead override the save
> method of your `ClientForm` to create the user in the form and not in the
> model.
> That way the password will be stored only hashed, and only in the User
> model.
>
> cheers,
>
> Jérôme
>
>
> 2013/12/6 Ricardo 
>
>> Ok
>>
>>
>> Em quinta-feira, 5 de dezembro de 2013 17h54min44s UTC-2, Ricardo
>> escreveu:
>>
>>> I have a model "Cliente" and in it a field "password".
>>> In forms.py file, I am using ModelForm, but put in the password field
>>> Password = forms.CharField (widget = forms.PasswordInput (render_value =
>>> True))
>>> It turns out that the admin password field appears readable, and I do
>>> not want that to happen.
>>> I tried to put in set_password. Models but did not succeed.
>>> Now if I put in the admin:
>>> form = FormCliente
>>> Displays the password field and confirm password type password.
>>> But I will not so I want to appear only the password hash.
>>>
>>> http://pastebin.com/AQnWR0W3
>>> in line 19 does not generate the password hash, but the readable password
>>>
>>> Ricardo
>>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>>
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/61ead39c-3c6c-437d-815b-37944df833b2%40googlegroups.com
>> .
>>
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>  --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/S5dUX4OXkJo/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAOLVUFf9dJOS6b_uwaurTfwfZeydAUt6px6sOVDD%3D8SPv9WdtQ%40mail.gmail.com
> .
>
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJTdXTE%2BXetVe%2BOLo7QaEDHQx%3DRC9wVFPR%2BpnhD-DO_%2BLNPVuA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Does not generate the password hash my User

2013-12-05 Thread Ricardo
Ok

Em quinta-feira, 5 de dezembro de 2013 17h54min44s UTC-2, Ricardo escreveu:
>
> I have a model "Cliente" and in it a field "password".
> In forms.py file, I am using ModelForm, but put in the password field
> Password = forms.CharField (widget = forms.PasswordInput (render_value = 
> True))
> It turns out that the admin password field appears readable, and I do not 
> want that to happen.
> I tried to put in set_password. Models but did not succeed.
> Now if I put in the admin:
> form = FormCliente
> Displays the password field and confirm password type password.
> But I will not so I want to appear only the password hash.
>
> http://pastebin.com/AQnWR0W3
> in line 19 does not generate the password hash, but the readable password
>
> Ricardo
>  

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/61ead39c-3c6c-437d-815b-37944df833b2%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Does not generate the password hash my User

2013-12-05 Thread Ricardo
Hi Thomas.
Even entering rende_value = False does not. The password keeps popping up 
as text.
did not quite understand how that password1 is inserted before the check 
password2.
I could not see this problem.

Em quinta-feira, 5 de dezembro de 2013 17h54min44s UTC-2, Ricardo escreveu:
>
> I have a model "Cliente" and in it a field "password".
> In forms.py file, I am using ModelForm, but put in the password field
> Password = forms.CharField (widget = forms.PasswordInput (render_value = 
> True))
> It turns out that the admin password field appears readable, and I do not 
> want that to happen.
> I tried to put in set_password. Models but did not succeed.
> Now if I put in the admin:
> form = FormCliente
> Displays the password field and confirm password type password.
> But I will not so I want to appear only the password hash.
>
> http://pastebin.com/AQnWR0W3
> in line 19 does not generate the password hash, but the readable password
>
> Ricardo
>  

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/85425291-ba1d-4946-8f2c-2d91f532d1f5%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Does not generate the password hash my User

2013-12-05 Thread Ricardo Kamada
I have a model "Cliente" and in it a field "password".
In forms.py file, I am using ModelForm, but put in the password field
Password = forms.CharField (widget = forms.PasswordInput (render_value =
True))
It turns out that the admin password field appears readable, and I do not
want that to happen.
I tried to put in set_password. Models but did not succeed.
Now if I put in the admin:
form = FormCliente
Displays the password field and confirm password type password.
But I will not so I want to appear only the password hash.

http://pastebin.com/AQnWR0W3
in line 19 does not generate the password hash, but the readable password

Ricardo

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJTdXTGzao5CaAfX9b%3Dyy_%2BG6LeEcSV1FA7Z11tALZ2WYR4XhQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Signal does not run

2013-11-18 Thread Ricardo
resolved.
I was not recording the other signs, for this reason he was never called.
transaction_canceled.connect(on_canceled)
transaction_waiting.connect(on_waiting) 
...

Thanks

Em segunda-feira, 18 de novembro de 2013 15h38min54s UTC-2, Ricardo 
escreveu:
>
> Hi. I have a problem in the signal, because it fails to run.
> The print "Hello word" is not displayed. Can anyone help me identify my 
> mistake? Thanks
>
> from djpg.signals import transaction_paid
> def on_paid(sender, **kwargs):
> transaction = kwargs.pop('transaction')
> ref = transaction['reference']
>  print "HELLO WORD"
> # ...
>
> transaction_paid.connect(on_paid)
>
> Ricardo
>  

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f0d42b59-4ab8-47e6-8e42-1af2373315f3%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Signal does not run

2013-11-18 Thread Ricardo Kamada
Hi. I have a problem in the signal, because it fails to run.
The print "Hello word" is not displayed. Can anyone help me identify my
mistake? Thanks

from djpg.signals import transaction_paid
def on_paid(sender, **kwargs):
transaction = kwargs.pop('transaction')
ref = transaction['reference']
print "HELLO WORD"
# ...

transaction_paid.connect(on_paid)

Ricardo

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJTdXTHS77EKBC5gO0%2BrAaAVBUtfUkU-RhV5vuyw_jV-S%3Dpvdg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


notifications PagSeguro

2013-11-15 Thread Ricardo Kamada
Hi.

I am using the api Rafael PagSeguro to do here.
And to a problem in the notification.
the URL is correct and accessible, and I'm not doing these tests on
localhost.
I put a print function .. but I can not see.
But I think that the code PagSeguro sends a POST is not coming ...
Can anyone help me?

https://github.com/mstrcnvs/djpg
http://pastebin.com/29NMmbgn

Ricardo

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJTdXTFnxVvHM3q3ngP-hHV4bAATA7uHHSsjybQWN_fK1oeYCg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: clicking the list_display link open a new page with the result of my queryset

2013-11-06 Thread Ricardo Kamada
I got :)
was missing url
url (r '^ list / (?  P \ d +) / $', 'evento.views.lista', name = 'list')

Thanks to all

Ricardo


2013/11/6 Ricardo 

> Hi
> the file full url like this
> http://pastebin.com/ztF8VDET
> I just try to pass the id as said but still did not work.
> the error is this
> NoReverseMatch at / admin / event / incricaoevento /
> Reverse for 'evento.views.lista' with arguments '(1)' and keyword
> arguments '{}' not found.
>
> Now I do not know if you're calling the view correctly, if the error is in
> reverse ("evento.views.lista", args = [self.evento.id]) or something that
> gotta do with get_url the admin.
>
> Em quarta-feira, 6 de novembro de 2013 15h30min26s UTC-2, Tom Evans
> escreveu:
>>
>> You haven't shown the url in question, which makes it hard to answer.
>>
>> At a guess, the url specifies a %d parameter, you are passing it an
>> object. Pass it self.evento.id
>>
>> Cheers
>>
>> Tom
>>
>> On Wed, Nov 6, 2013 at 5:15 PM, Ricardo Kamada 
>> wrote:
>> > Hi, I'm trying to do in list_display
>> > a link to open in new tab list_display with results of my queryset.
>> > http://dpaste.com/1445232/
>> > that way I get this error reverse
>> >
>> > Reverse for 'evento.views.lista' with arguments '(> 01>,)'
>> > and keyword arguments '{}' not found.
>> >
>> > Could someone help me?
>> > I do not understand why this error because I call the view and pass the
>> > argument to the filter queryset but I get this error.
>> > Ricardo
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> Groups
>> > "Django users" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> an
>> > email to django-users...@googlegroups.com.
>> > To post to this group, send email to django...@googlegroups.com.
>> > Visit this group at http://groups.google.com/group/django-users.
>> > To view this discussion on the web visit
>> > https://groups.google.com/d/msgid/django-users/
>> CAJTdXTGNtZWmzsC7btxOLDymNr18hBpj8FxvSZDiAZ9uELevVA%40mail.gmail.com.
>> > For more options, visit https://groups.google.com/groups/opt_out.
>>
>  --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/m9OwGZRMurk/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/0700ad76-5d5f-44be-850c-98e6cf241052%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJTdXTFnb63-%3DwNSyVwjsU%3Dj%3DCdYOvW8QEKsDAn%3DEHM2hshFZg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: clicking the list_display link open a new page with the result of my queryset

2013-11-06 Thread Ricardo
Hi
the file full url like this
http://pastebin.com/ztF8VDET
I just try to pass the id as said but still did not work.
the error is this
NoReverseMatch at / admin / event / incricaoevento /
Reverse for 'evento.views.lista' with arguments '(1)' and keyword arguments 
'{}' not found.

Now I do not know if you're calling the view correctly, if the error is in 
reverse ("evento.views.lista", args = [self.evento.id]) or something that 
gotta do with get_url the admin.

Em quarta-feira, 6 de novembro de 2013 15h30min26s UTC-2, Tom Evans 
escreveu:
>
> You haven't shown the url in question, which makes it hard to answer. 
>
> At a guess, the url specifies a %d parameter, you are passing it an 
> object. Pass it self.evento.id 
>
> Cheers 
>
> Tom 
>
> On Wed, Nov 6, 2013 at 5:15 PM, Ricardo Kamada 
> > 
> wrote: 
> > Hi, I'm trying to do in list_display 
> > a link to open in new tab list_display with results of my queryset. 
> > http://dpaste.com/1445232/ 
> > that way I get this error reverse 
> > 
> > Reverse for 'evento.views.lista' with arguments '( 01>,)' 
> > and keyword arguments '{}' not found. 
> > 
> > Could someone help me? 
> > I do not understand why this error because I call the view and pass the 
> > argument to the filter queryset but I get this error. 
> > Ricardo 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "Django users" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an 
> > email to django-users...@googlegroups.com . 
> > To post to this group, send email to 
> > django...@googlegroups.com. 
>
> > Visit this group at http://groups.google.com/group/django-users. 
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/django-users/CAJTdXTGNtZWmzsC7btxOLDymNr18hBpj8FxvSZDiAZ9uELevVA%40mail.gmail.com.
>  
>
> > For more options, visit https://groups.google.com/groups/opt_out. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0700ad76-5d5f-44be-850c-98e6cf241052%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


clicking the list_display link open a new page with the result of my queryset

2013-11-06 Thread Ricardo Kamada
Hi, I'm trying to do in list_display
a link to open in new tab list_display with results of my queryset.
http://dpaste.com/1445232/
that way I get this error reverse

Reverse for 'evento.views.lista' with arguments '(,)' and keyword arguments '{}' not found.

Could someone help me?
I do not understand why this error because I call the view and pass the
argument to the filter queryset but I get this error.
Ricardo

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJTdXTGNtZWmzsC7btxOLDymNr18hBpj8FxvSZDiAZ9uELevVA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


list of presence in django admin

2013-11-05 Thread Ricardo Kamada
Hi
I have an app subscriptions for events all working ok.
Admin on inscriptions that have a list_display ta displaying:

| Name | events | email | phone | city |

Now for me to make a call list with:

| Name | events | __ signature of the person___ |

what better way to do it using the django admin ...?
Would have a way?


Ricardo

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJTdXTGQmgGbsiiGC%2Bi2K8TvecSPayzZD9iMTAGzA%3DUP4JM61A%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Call method of the session template

2013-10-11 Thread Ricardo Kamada
I understand what you say, however I know only call methods using {% url
'app.view.func'%} or {%}% app.view.func.
As I understand this django-aap carton, the shopping cart in the session
live. If it is in session I would have
access their methods and attributes. Well that's exactly what I'm not
getting. Access method remove_single.
In this href = "" is an image that removes the items you want to call the
method remove_simgle.
Actually I'm wrong in doing {% url%} because I do not want move pages. I
just want to remove the item from the cart.


class Cart(object):
"""
A cart that lives in the session.
"""
#...
#...

def remove_single(self, product):
"""
Removes a single product by decreasing the quantity.
"""
if product not in self.products:
return
if self._items_dict[product.pk].quantity <= 1:
# There's only 1 product left so we drop it
del self._items_dict[product.pk]
else:
self._items_dict[product.pk].quantity -= 1
self.session.modified = True

Ricardo


2013/10/11 Daniel Roseman 

> On Thursday, 10 October 2013 20:29:32 UTC+1, ke1g wrote:
>
>> No.  You can't pass an argument to a model method from the template.  I
>> see two options for you:
>>
>> 1.  Rework the method so that the argument is optional, and if the
>> argument is not provided, the method uses a reasonable default (maybe
>> item.product?).
>> 2. Write a custom template filter that lets you supply an argument
>>
>
> These answers all miss the point. The main problem is not that you need to
> pass an argument, it's that what you're trying to do makes *no sense at
> all* in the context of a template.
>
> You can't make the href of a link just point to a model method. A link
> needs to be a URL. So it needs a view, and an entry in the urlconf pointing
> to that view. That urlconf entry, of course, can take an argument, but that
> argument can't be a "product", it needs to be some kind of ID or slug that
> can be represented in the URL.
>
> Once you've got the view and the URL, you can use the `{% url %}` tag to
> generate the value for your link:
>
> 
>
> (although note that an action that removes an item should be a POST, not a
> simple GET link).
> --
> DR.
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/AzIxhSQpGws/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/acd5df91-ac8d-4141-a6fc-ccf4447b6b8d%40googlegroups.com
> .
>
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJTdXTEQD_RyBWNs9vkrE8YuRkCmSP74nQ8vBL5qSGYeXcEWpQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Call method of the session template

2013-10-10 Thread Ricardo Kamada
I tried numerous times ...
but if I put that way
{% 'item.remove_single' item.product %} or {% 'item.remove_single' product=
item.product %}
blames this error " Invalid block tag: ''item.remove_single'', expected
'empty' ou 'endfor' "

Ricardo


2013/10/10 Bill Freeman 

> The remove method requires an argument.  You're not supplying one (you
> can't in a template variable reference).
>
>
> On Thu, Oct 10, 2013 at 1:29 PM, Ricardo  wrote:
>
>> Hi, I'm using django carton to shopping cart.
>> I am not able to call the method remove_single in my template. on line 15
>> I tried several ways but I can not.
>> If you can help
>>
>> carton  ---> http://pastebin.com/X4FtHRZU
>> template  ---> http://pastebin.com/0AJYFB1x
>>
>> thank you
>> Ricardo
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>>
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/b67afb27-366b-4570-85a6-58900322fa3e%40googlegroups.com
>> .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>  --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/AzIxhSQpGws/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAB%2BAj0tPL8y7zBwv8RvaBP29D77dALP84WVv_tbHRd1xELfveg%40mail.gmail.com
> .
>
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJTdXTH%2BH0BAqRsnKOpvyX75no01n7aUn7YvLgcOY-_jjVB8Wg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Call method of the session template

2013-10-10 Thread Ricardo
Hi, I'm using django carton to shopping cart.
I am not able to call the method remove_single in my template. on line 15
I tried several ways but I can not.
If you can help

carton  ---> http://pastebin.com/X4FtHRZU
template  ---> http://pastebin.com/0AJYFB1x

thank you
Ricardo

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b67afb27-366b-4570-85a6-58900322fa3e%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django-cart. How to run method add_to_cart?

2013-10-03 Thread Ricardo Kamada
Hi Leonardo. managed to make the implementation of the cart. not used the
card but django django carton. There are the same but they are similar.
veleu for help. I'm passing the objects by post. Thanks for the help.
Em 02/10/2013 04:10, "Leonardo Giordani" 
escreveu:

> Hi Ricardo,
>
> well this is a question that needs a good explanation. I try to give you
> some hints about what you need to research about:
>
> a. You need to send data to the Django server through a POST view. This is
> a HTTP "verb", that is one of many different ways the browser has to
> communicate with your server. In particular, POST views in Django work just
> like standard views (i.e. GET views), but the request object has a POST
> attribute which encompasses the data sent by the browser.
>
> b. To create a POST HTTP request in your browser you need to create a
> form, and Django can help you with a very very rich API.
>
> So the general roadmap to achieve what you want is:
>
> 1. Set up a POST view that processes the incoming data
> 2. Link the POST view to an URL
> 3. Create an HTML template which shows a form to the user and sends data
> back to the server.
>
> The 3rd point is obviously needed only if you have to show the user a form
> to collect the input he or she enters. You can also call POST views
> directly, e.g. including some JS that performs the request, but this is an
> advanced topic.
>
> Start by looking at this video 
> tutorial<http://www.youtube.com/watch?v=gQe_8Q4YUpg>and reading the docs on 
> Django
> Forms <https://docs.djangoproject.com/en/dev/topics/forms/>
>
> I'd suggest you to also check the following resources to understand the
> previous two matters:
>
> http://www.w3schools.com/tags/ref_httpmethods.asp
> https://docs.djangoproject.com/en/dev/ref/request-response/
> http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol
> https://docs.djangoproject.com/en/dev/ref/forms/api/
>
> Feel free to ask more if you need help.
>
> Cheers,
>
> Leo
>
>
> Leonardo Giordani
> Author of The Digital Cat <http://lgiordani.github.com>
> My profile on About.me <http://about.me/leonardo.giordani> - My GitHub
> page <https://github.com/lgiordani> - My Coderwall 
> profile<https://coderwall.com/lgiordani>
>
>
> 2013/10/1 Ricardo Kamada 
>
>> you already helped me a lot =)
>> Leonardo looks just http://dpaste.com/1402408/
>> On line 20 I pass a value of fixed amount in the template.
>> How would get the amount in input dynamically?
>>
>> Abs
>> [] s
>>
>> Ricardo
>>
>>
>> 2013/10/1 Leonardo Giordani 
>>
>>>  Ricardo,
>>>
>>> I think the example on the django-cart site are somehow incorrect: since
>>> you are going to change the database you shall use a POST view and not a
>>> GET.
>>>
>>> However, putting apart HTTP verbs for a moment, let's look at how you
>>> call views from URLs. If you write something like the following in your
>>> views.py (or whatever file you mapped in your urls.py)
>>>
>>>
>>> from django.conf.urls import patterns, url
>>>
>>> from django.shortcuts import render_to_response
>>>
>>> def my_view(request, product_id, quantity):
>>> [do something with product_id and quantity]
>>> return render_to_response('template.html')
>>>
>>> urlpatterns = patterns('',
>>>url(r'^(?P\d+)/(?P\d+)/$',
>>>my_view
>>>)
>>>
>>> you can browse to http://yoursite/path/1234/56 and have the Python
>>> function my_view(product_id=1234, quantity=56) called.
>>>
>>> Try and implement something like the above code and see if it works.
>>>
>>> As for the django_cart: when you modify the DB always use POST views and
>>> not GET, then you are right, you have to return a template rendering in
>>> your add_to_cart() view.
>>>
>>> Let me know if it comes to life =)
>>>
>>> Cheers,
>>> Leo
>>>
>>>
>>>
>>> Leonardo Giordani
>>> Author of The Digital Cat <http://lgiordani.github.com>
>>> My profile on About.me <http://about.me/leonardo.giordani> - My GitHub
>>> page <https://github.com/lgiordani> - My Coderwall 
>>> profile<https://coderwall.com/lgiordani>
>>>
>>>
>>> 2013/10/1 Ricardo Kamada 
>>>
>>>>  Leonardo Hi thanks for the reply but I s

Re: Django-cart. How to run method add_to_cart?

2013-10-01 Thread Ricardo Kamada
you already helped me a lot =)
Leonardo looks just http://dpaste.com/1402408/
On line 20 I pass a value of fixed amount in the template.
How would get the amount in input dynamically?

Abs
[] s

Ricardo


2013/10/1 Leonardo Giordani 

> Ricardo,
>
> I think the example on the django-cart site are somehow incorrect: since
> you are going to change the database you shall use a POST view and not a
> GET.
>
> However, putting apart HTTP verbs for a moment, let's look at how you call
> views from URLs. If you write something like the following in your views.py
> (or whatever file you mapped in your urls.py)
>
>
> from django.conf.urls import patterns, url
>
> from django.shortcuts import render_to_response
>
> def my_view(request, product_id, quantity):
> [do something with product_id and quantity]
> return render_to_response('template.html')
>
> urlpatterns = patterns('',
>url(r'^(?P\d+)/(?P\d+)/$',
>my_view
>)
>
> you can browse to http://yoursite/path/1234/56 and have the Python
> function my_view(product_id=1234, quantity=56) called.
>
> Try and implement something like the above code and see if it works.
>
> As for the django_cart: when you modify the DB always use POST views and
> not GET, then you are right, you have to return a template rendering in
> your add_to_cart() view.
>
> Let me know if it comes to life =)
>
> Cheers,
> Leo
>
>
>
> Leonardo Giordani
> Author of The Digital Cat <http://lgiordani.github.com>
> My profile on About.me <http://about.me/leonardo.giordani> - My GitHub
> page <https://github.com/lgiordani> - My Coderwall 
> profile<https://coderwall.com/lgiordani>
>
>
> 2013/10/1 Ricardo Kamada 
>
>> Leonardo Hi thanks for the reply but I still can not understand.
>> I really need to pass the id and quantity parameters in the url? After
>> all I'm recording the items in the correct session?
>> I saw that the method has no return add_to_cart, as well as other methods
>> remove_from_cart.
>> In my template I am calling the method like this:
>>   
>> Buy  
>>
>> and URLs:
>> url (r '^ products / buy / $', 'cart.views.add_to_cart', name =
>> 'add_to_cart')
>>
>> You say that to pass arguments id and quantity that url?
>>
>> Ricardo
>>
>>
>> 2013/10/1 Leonardo Giordani 
>>
>>>  You have to implement an URL dispatcher that links an URL to your view.
>>> Read here <https://docs.djangoproject.com/en/dev/topics/http/urls/> and
>>> feel free to ask again if something is still not clear.
>>>
>>> Leonardo Giordani
>>> Author of The Digital Cat <http://lgiordani.github.com>
>>> My profile on About.me <http://about.me/leonardo.giordani> - My GitHub
>>> page <https://github.com/lgiordani> - My Coderwall 
>>> profile<https://coderwall.com/lgiordani>
>>>
>>>
>>> 2013/10/1 Ricardo 
>>>
>>>>  Hi, I have this same problem.
>>>> I'm looking for answer everywhere.
>>>> enemybass could implement?
>>>> If someone can help me with this
>>>>
>>>> [] s
>>>>
>>>> Em quarta-feira, 26 de setembro de 2012 05h33min24s UTC-3, enemybass
>>>> escreveu:
>>>>>
>>>>> https://github.com/bmentges/**django-cart<https://github.com/bmentges/django-cart>
>>>>>
>>>>> *I'm* a total *newbie* to *Django. *How to run method *add_to_car*t?
>>>>> In template I would have button "add to cart".
>>>>>
>>>>> Thanks.
>>>>>
>>>>> def add_to_cart(request, product_id, quantity):
>>>>> product = Product.objects.get(id=product**_id)
>>>>> cart = Cart(request)
>>>>> cart.add(product, product.unit_price, quantity)
>>>>>
>>>>> My model look something like this:
>>>>>
>>>>> class Product(models.Model):
>>>>> name = models.CharField(max_length=50**)
>>>>> slug = models.SlugField()
>>>>> unit_price = models.DecimalField(max_digits**=5, decimal_places=2)
>>>>> category = models.ManyToManyField(Categor**y)
>>>>>
>>>>> class Meta:
>>>>> verbose_name = "Product"
>>>>> verbose_name_plural = "Products"
>>>>&g

Re: Django-cart. How to run method add_to_cart?

2013-10-01 Thread Ricardo Kamada
Leonardo Hi thanks for the reply but I still can not understand.
I really need to pass the id and quantity parameters in the url? After all
I'm recording the items in the correct session?
I saw that the method has no return add_to_cart, as well as other methods
remove_from_cart.
In my template I am calling the method like this:
  Buy  

and URLs:
url (r '^ products / buy / $', 'cart.views.add_to_cart', name =
'add_to_cart')

You say that to pass arguments id and quantity that url?

Ricardo


2013/10/1 Leonardo Giordani 

> You have to implement an URL dispatcher that links an URL to your view.
> Read here <https://docs.djangoproject.com/en/dev/topics/http/urls/> and
> feel free to ask again if something is still not clear.
>
> Leonardo Giordani
> Author of The Digital Cat <http://lgiordani.github.com>
> My profile on About.me <http://about.me/leonardo.giordani> - My GitHub
> page <https://github.com/lgiordani> - My Coderwall 
> profile<https://coderwall.com/lgiordani>
>
>
> 2013/10/1 Ricardo 
>
>> Hi, I have this same problem.
>> I'm looking for answer everywhere.
>> enemybass could implement?
>> If someone can help me with this
>>
>> [] s
>>
>> Em quarta-feira, 26 de setembro de 2012 05h33min24s UTC-3, enemybass
>> escreveu:
>>>
>>> https://github.com/bmentges/**django-cart<https://github.com/bmentges/django-cart>
>>>
>>> *I'm* a total *newbie* to *Django. *How to run method *add_to_car*t? In
>>> template I would have button "add to cart".
>>>
>>> Thanks.
>>>
>>> def add_to_cart(request, product_id, quantity):
>>> product = Product.objects.get(id=product**_id)
>>> cart = Cart(request)
>>> cart.add(product, product.unit_price, quantity)
>>>
>>> My model look something like this:
>>>
>>> class Product(models.Model):
>>> name = models.CharField(max_length=50**)
>>> slug = models.SlugField()
>>> unit_price = models.DecimalField(max_digits**=5, decimal_places=2)
>>> category = models.ManyToManyField(Categor**y)
>>>
>>> class Meta:
>>> verbose_name = "Product"
>>> verbose_name_plural = "Products"
>>>
>>> def __unicode__(self):
>>> return self.name
>>>
>>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>>
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/cfabbfd6-01ac-4b40-b887-ea7d7cd59c06%40googlegroups.com
>> .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>  --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/M8zey6g_R6s/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAEhE%2BOkVVp1o5AvtHeDi6U5zsuTKr9swGiJshCh8XwcRfSE_tQ%40mail.gmail.com
> .
>
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJTdXTFX650QKMe66rz4DRPeEe%3D6iDV2Re894rsuhf6Li82ixg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django-cart. How to run method add_to_cart?

2013-09-30 Thread Ricardo
Hi, I have this same problem.
I'm looking for answer everywhere.
enemybass could implement?
If someone can help me with this

[] s

Em quarta-feira, 26 de setembro de 2012 05h33min24s UTC-3, enemybass 
escreveu:
>
> https://github.com/bmentges/django-cart
>
> *I'm* a total *newbie* to *Django. *How to run method *add_to_car*t? In 
> template I would have button "add to cart".
>
> Thanks.
>
> def add_to_cart(request, product_id, quantity):
> product = Product.objects.get(id=product_id)
> cart = Cart(request)
> cart.add(product, product.unit_price, quantity)
>
> My model look something like this:
>
> class Product(models.Model):
> name = models.CharField(max_length=50)
> slug = models.SlugField()
> unit_price = models.DecimalField(max_digits=5, decimal_places=2)
> category = models.ManyToManyField(Category)
>
> class Meta:
> verbose_name = "Product"
> verbose_name_plural = "Products"
>
> def __unicode__(self):
> return self.name
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/cfabbfd6-01ac-4b40-b887-ea7d7cd59c06%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Missing files on a new project

2013-01-28 Thread Ricardo Diaz
Well, i'm following a video tutorial -> this guy is using Django 1.4 and 
when he uses startmanager on shell Django creates all of those files on the 
main folder.

Check it about 3:11 https://www.youtube.com/watch?v=fVNL5MwskiQ

That is the reason why I'm asking for help.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Missing files on a new project

2013-01-27 Thread Ricardo Diaz
Hi, I'm pretty noob with Django.

I've readed a few pages of the Django-book and just started to create my 
own projects.

When I try to create a new project using django-admin startproject demo, it 
just creates 2 things

project
  l--demo
  l--manage.py

I don't know why it doesn't create the missing files: __init__.py 
settings.py and urls.py

I'm working on Ubuntu 12.04 and this happens on Django 1.4.3 and 1.4 
versions

Thx for your help.

-- 
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 to 
django-users+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Upgraded to Django 1.4.1 and now I have one database connection

2012-09-26 Thread Ricardo Grizonic
The subject should be: 

"Upgraded to Django 1.4.1 and now I have one database connection per thread"

sorry for that! :)

On Wednesday, 26 September 2012 13:34:13 UTC+2, Ricardo Grizonic wrote:
>
> Hey everyone,
>
> I recently upgraded from Django 1.3 to 1.4.1 and now it seems that for 
> every new thread, a new database connection to postgresql is created. I'm 
> using:
>
> from django.db import connection
>
> which, according to the docs, should get a global connection that would be 
> used by all the threads. Anything I might be doing wrong?
>
> Thanks, in advance, for you help!
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/DMVavsMi6aUJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Upgraded to Django 1.4.1 and now I have one database connection

2012-09-26 Thread Ricardo Grizonic
Hey everyone,

I recently upgraded from Django 1.3 to 1.4.1 and now it seems that for 
every new thread, a new database connection to postgresql is created. I'm 
using:

from django.db import connection

which, according to the docs, should get a global connection that would be 
used by all the threads. Anything I might be doing wrong?

Thanks, in advance, for you help!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/udczXGe8jVAJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Difficulties using generic views (Tutorial 4, Django 1.4)

2012-07-23 Thread Ricardo Cardoso
Oddly, when i started up the server this morning i could now see the polls 
correctly, while not having changed my code, by accessing 
http://127.0.0.1:8000/polls. Don't know if Django is prone to such 
randomness but am happy that it works now. Tested everything, added a view 
so that http://127.0.0.1:8000 loads polls, voted and viewed results. All 
fine.

I'll carry on testing this and getting a couple more tutorials done before 
moving to my first django production.

Thank you for your time and patience Carlos, much appreciated.




-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/CrRjT-ql1AMJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Difficulties using generic views (Tutorial 4, Django 1.4)

2012-07-22 Thread Ricardo Cardoso
Thank you for your input guys. 

Sadly, i had already checked it Carlos and have my templates for polls 
under:
/home/my_user/Webdev/Templates/polls

In this case my template dir is set up as:
/home/my_user/Webdev/Templates/

Should i create another polls dir under templates 
(/home/my_user/Webdev/Templates/polls/polls) considering in the error 
message i get 'polls/poll_list.html' , besides 'index.html'? This seems 
redundant and i'd like to understand why i would have to. 

Thanks again for your help.

On Thursday, July 19, 2012 12:08:39 AM UTC+1, Ricardo Cardoso wrote:
>
> I'm new to django and python, and decided to follow up the available 
> tutorials to get up to speed. These were helpful and got me on my feet but 
> while finishing up the tutorial i hit a major snag. While everything was 
> working properly using custom views, i can't seem to make my app load the 
> correct templates after switching to generic views.
>
> Here's the code:
>
> #urls.py
> from django.conf.urls import patterns, include, url
> from django.views.generic import DetailView, ListView
> from polls.models import Poll
>
> urlpatterns = patterns('',
> url(r'^$',
> ListView.as_view(
> queryset=Poll.objects.order_by('-pub_date')[:5],
> context_object_name='latest_poll_list',
> template_name='polls/index.html')),
> url(r'^(?P\d+)/$',
> DetailView.as_view(
> model=Poll,
> template_name='polls/detail.html')),
> url(r'^(?P\d+)/results/$',
> DetailView.as_view(
> model=Poll,
> template_name='polls/results.html'),
> name='poll_results'),
> url(r'^(?P\d+)/vote/$', 'polls.views.vote'),
> )
>
> The way i decided (perhaps wrongly) to organize my apps and templates is 
> as follows:
>
> Template dir as defined in settings.py:
> TEMPLATE_DIRS = ('/home/my_user/Webdev/Templates/', # this is where i'm 
> storing my templates at the moment
>
> App location: /home/my_user/Webdev/Django-lessons/pollproject/polls
>
> If i try to access the polls app directly by using the URL: 
> http://127.0.0.1:8000/polls/ i now get an error message stating that:
>
> TemplateDoesNotExist at /polls/ 
>
> index.html, polls/poll_list.html
>
>
>
> I realize this might have something to do with where i decided to store my 
> templates (made more sense at the time to store them separately since i 
> thought i could use different templates for the same app, for different 
> purposes).
>
> This is probably a basic issue but any help regarding this would be 
> greatly appreciated.
>
> Thanks!
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/NPYer7_BW2MJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Difficulties using generic views (Tutorial 4, Django 1.4)

2012-07-18 Thread Ricardo Cardoso
I'm new to django and python, and decided to follow up the available 
tutorials to get up to speed. These were helpful and got me on my feet but 
while finishing up the tutorial i hit a major snag. While everything was 
working properly using custom views, i can't seem to make my app load the 
correct templates after switching to generic views.

Here's the code:

#urls.py
from django.conf.urls import patterns, include, url
from django.views.generic import DetailView, ListView
from polls.models import Poll

urlpatterns = patterns('',
url(r'^$',
ListView.as_view(
queryset=Poll.objects.order_by('-pub_date')[:5],
context_object_name='latest_poll_list',
template_name='polls/index.html')),
url(r'^(?P\d+)/$',
DetailView.as_view(
model=Poll,
template_name='polls/detail.html')),
url(r'^(?P\d+)/results/$',
DetailView.as_view(
model=Poll,
template_name='polls/results.html'),
name='poll_results'),
url(r'^(?P\d+)/vote/$', 'polls.views.vote'),
)

The way i decided (perhaps wrongly) to organize my apps and templates is as 
follows:

Template dir as defined in settings.py:
TEMPLATE_DIRS = ('/home/my_user/Webdev/Templates/', # this is where i'm 
storing my templates at the moment

App location: /home/my_user/Webdev/Django-lessons/pollproject/polls

If i try to access the polls app directly by using the URL: 
http://127.0.0.1:8000/polls/ i now get an error message stating that:

TemplateDoesNotExist at /polls/ 

index.html, polls/poll_list.html



I realize this might have something to do with where i decided to store my 
templates (made more sense at the time to store them separately since i 
thought i could use different templates for the same app, for different 
purposes).

This is probably a basic issue but any help regarding this would be greatly 
appreciated.

Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/gWDhmGFeSlEJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Internationalization Issues

2012-06-22 Thread Ricardo Jacas
Hi Everyone,
I'm having a lot of trouble with i18n. My templates don't display all the
translations (i've already checked for the "fuzzy" tag).
I have no idea what could it be, any thoughts? Anything may help, i've been
reading forums for hours.



-- 
lets reign all together

-- 
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 to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Is this a bug in django? template_context_processors processed in views without RequestContext context_instance.

2012-06-13 Thread Ricardo L. Dani
Guys,

I solved. It's django-debug-toolbar fault. It's does double requests and
loads all the context processor :(

Thanx

2012/6/13 Ricardo L. Dani 

> Hello everyone,
>
> I'm having a issue with template_context_processors requests and views
> that do not use the context processors, i.e. in a render_to_response
> without use of RequestContext.
>
> For example, in my TEMPLATE_CONTEXT_PROCESSORS, as default, I have a
> "django.contrib.auth.context_processors.auth", this context processor loads
> in the context 2 variables like user and perms making 1 or 2 queries in
> database.
>
> In other way, i have a view like this:
>
> def test_view(request):
> return render_to_response('template.html', {'list': range(5)})
>
> # template.html
> # {% if list %}{% for i in list %}{{ i }}{% endfor %}{%
> endif %}
>
> Teoretically, this view don't use the django ORM and not use context
> processors, so a request to this view can`t touch in the database.
>
> But, for my surprise, I enable the mysql.log and with a tailf in the log I
> discover thats every request to the test_view pass in every
> TEMPLATE_CONTEXT_PROCESSORS and the lazy querysets are called too. In my
> opinion it can`t be happened.
>
> I'm using django 1.3.1.
>
> Can anyone help me?
>
> Thanks
>



-- 
Ricardo Lapa Dani

-- 
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 to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Is this a bug in django? template_context_processors processed in views without RequestContext context_instance.

2012-06-13 Thread Ricardo L. Dani
Hello everyone,

I'm having a issue with template_context_processors requests and views that
do not use the context processors, i.e. in a render_to_response without use
of RequestContext.

For example, in my TEMPLATE_CONTEXT_PROCESSORS, as default, I have a
"django.contrib.auth.context_processors.auth", this context processor loads
in the context 2 variables like user and perms making 1 or 2 queries in
database.

In other way, i have a view like this:

def test_view(request):
return render_to_response('template.html', {'list': range(5)})

# template.html
# {% if list %}{% for i in list %}{{ i }}{% endfor %}{%
endif %}

Teoretically, this view don't use the django ORM and not use context
processors, so a request to this view can`t touch in the database.

But, for my surprise, I enable the mysql.log and with a tailf in the log I
discover thats every request to the test_view pass in every
TEMPLATE_CONTEXT_PROCESSORS and the lazy querysets are called too. In my
opinion it can`t be happened.

I'm using django 1.3.1.

Can anyone help me?

Thanks

-- 
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 to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Error 500 instead of 404

2011-11-20 Thread Ricardo F. Teixeira
Solved (!) by creating those template files.
Thanks Tomek!
On Nov 20, 9:28 am, Tomek Paczkowski  wrote:
> If you dont have 404.html file, than Django will raise exception that
> 404.html is not found. Next, if you dont have 500.html your exception is
> generating new exception on lack of 500.html. Make sure you have both
> files. Eg:
>
> $ touch templates/{404,500}.html

-- 
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 to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Error 500 instead of 404

2011-11-19 Thread Ricardo F. Teixeira
Hello everybody!

I'm having a strange error.
I already searched for this error and there's quite a lot of
discussion about it. But I didn't find a proper answer that fits me.
So... when I set DEBUG to True and access an invalid URL Django
returns me a 404 error page, but if I set DEBUG to False it gives me
an 500...

Firstly I thought it was something wrong with my project so I started
a new one, with only the following basics options.
I can assure you that I only edit those 3 files (views.py, urls.py and
settings.py).

In settings.py I only change from DEGUG=True to DEBUG=False.

ricardo@maggie:~/ola $ ls
__init__.py  __init__.pyc manage.pysettings.py  settings.pyc
urls.py  urls.pyc views.py views.pyc

ricardo@maggie:~/ola $ cat urls.py
from django.conf.urls.defaults import patterns, include, url

# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()

urlpatterns = patterns('',
# Examples:
url(r'^$', 'ola.views.home', name='home'),
# url(r'^ola/', include('ola.foo.urls')),

# Uncomment the admin/doc line below to enable admin
documentation:
# url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

# Uncomment the next line to enable the admin:
# url(r'^admin/', include(admin.site.urls)),
)
ricardo@maggie:~/ola $ cat views.py
from django.http import HttpResponseNotFound

def home(request):
return HttpResponseNotFound()

ricardo@maggie:~/ola $ python manage.py runserver
Validating models...

0 errors found
Django version 1.3.1, using settings 'ola.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
[19/Nov/2011 23:53:21] "GET / HTTP/1.1" 404 0
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/django/core/servers/
basehttp.py", line 283, in run
self.result = application(self.environ, self.start_response)
  File "/Library/Python/2.7/site-packages/django/core/handlers/
wsgi.py", line 272, in __call__
response = self.get_response(request)
  File "/Library/Python/2.7/site-packages/django/core/handlers/
base.py", line 153, in get_response
response = self.handle_uncaught_exception(request, resolver,
sys.exc_info())
  File "/Library/Python/2.7/site-packages/django/core/handlers/
base.py", line 218, in handle_uncaught_exception
return callback(request, **param_dict)
  File "/Library/Python/2.7/site-packages/django/utils/decorators.py",
line 93, in _wrapped_view
response = view_func(request, *args, **kwargs)
  File "/Library/Python/2.7/site-packages/django/views/defaults.py",
line 30, in server_error
t = loader.get_template(template_name) # You need to create a
500.html template.
  File "/Library/Python/2.7/site-packages/django/template/loader.py",
line 157, in get_template
template, origin = find_template(template_name)
  File "/Library/Python/2.7/site-packages/django/template/loader.py",
line 138, in find_template
raise TemplateDoesNotExist(name)
TemplateDoesNotExist: 500.html

[19/Nov/2011 23:53:48] "GET /GIVE_ME_400 HTTP/1.1" 500 1314
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/django/core/servers/
basehttp.py", line 283, in run
self.result = application(self.environ, self.start_response)
  File "/Library/Python/2.7/site-packages/django/core/handlers/
wsgi.py", line 272, in __call__
response = self.get_response(request)
  File "/Library/Python/2.7/site-packages/django/core/handlers/
base.py", line 153, in get_response
response = self.handle_uncaught_exception(request, resolver,
sys.exc_info())
  File "/Library/Python/2.7/site-packages/django/core/handlers/
base.py", line 218, in handle_uncaught_exception
return callback(request, **param_dict)
  File "/Library/Python/2.7/site-packages/django/utils/decorators.py",
line 93, in _wrapped_view
response = view_func(request, *args, **kwargs)
  File "/Library/Python/2.7/site-packages/django/views/defaults.py",
line 30, in server_error
t = loader.get_template(template_name) # You need to create a
500.html template.
  File "/Library/Python/2.7/site-packages/django/template/loader.py",
line 157, in get_template
template, origin = find_template(template_name)
  File "/Library/Python/2.7/site-packages/django/template/loader.py",
line 138, in find_template
raise TemplateDoesNotExist(name)
TemplateDoesNotExist: 500.html

Thank you for your time.

Best regards,

Ricardo F. Teixeira

-- 
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 to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



[geo-django] Best way to capture geo-coordinate of an anonymous user?

2011-08-25 Thread Ricardo L. Dani
Hello everyone,

Anyone knows how to capture a geo-coordinate of an anonymous user
after his insert your address in an input? Using a google api?

Thanks so much

-- 
Ricardo Lapa Dani

-- 
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 to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: manage.py dumpdata json storage problem

2011-08-01 Thread Ricardo L. Dani
I found the ticket to this issue (with patchs)

https://code.djangoproject.com/ticket/5423

On Mon, Aug 1, 2011 at 9:32 AM, Ricardo L. Dani wrote:

> Hello django-users,
>
> I'm having problems trying to serialize the data of a postgresql db of my
> business application (lots of lots of data)
>
> Using the command:
>
> ./manage.py dumpdata > data.json
>
> But, the execution of this command takes a long time and the ram and swap
> of the computer reachs the limit causing a exeption:
>
> django.db.utils.DatabaseError: out of memory for query result
>
> The question is, somewone knows a way to this command write in the
> data.json directly or in demand? I believe this is the problem and solution,
> am I correct?
>
> graciously,
>
> --
> Ricardo Lapa Dani
>



-- 
Ricardo Lapa Dani

-- 
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 to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



manage.py dumpdata json storage problem

2011-08-01 Thread Ricardo L. Dani
Hello django-users,

I'm having problems trying to serialize the data of a postgresql db of my
business application (lots of lots of data)

Using the command:

./manage.py dumpdata > data.json

But, the execution of this command takes a long time and the ram and swap of
the computer reachs the limit causing a exeption:

django.db.utils.DatabaseError: out of memory for query result

The question is, somewone knows a way to this command write in the data.json
directly or in demand? I believe this is the problem and solution, am I
correct?

graciously,

-- 
Ricardo Lapa Dani

-- 
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 to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: django-admin inspectdb does not detect NULL columns for PostgreSQL database

2011-07-22 Thread Ricardo L. Dani
FYI i fixed that and post a patch in the ticket.

Regards

On Thu, Jul 21, 2011 at 9:21 AM, Ricardo L. Dani  wrote:
> Hi everyone,
>
> I have the same problem of this ticket from django trac:
> https://code.djangoproject.com/ticket/7783
>
> The PostgreSQL database introspection does not detect NULL columns,
> cursor.description does not return the null_ok field, so database
> introspection does not add null=True to column definitions. The
> is_nullable column in information_schema.columns does contain this
> information, however.
>
> A patch was subimitted, but i can't apply this 'cause the version of
> django that's the patch was appliend is different to 1.3 (the version
> i use).
>
> Somebody knows what version of django this patch is applied? Or a
> other way to solve this problem?
>
> Regards
>
> --
> Ricardo Lapa Dani
>



-- 
Ricardo Lapa Dani

-- 
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 to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



django-admin inspectdb does not detect NULL columns for PostgreSQL database

2011-07-21 Thread Ricardo L. Dani
Hi everyone,

I have the same problem of this ticket from django trac:
https://code.djangoproject.com/ticket/7783

The PostgreSQL database introspection does not detect NULL columns,
cursor.description does not return the null_ok field, so database
introspection does not add null=True to column definitions. The
is_nullable column in information_schema.columns does contain this
information, however.

A patch was subimitted, but i can't apply this 'cause the version of
django that's the patch was appliend is different to 1.3 (the version
i use).

Somebody knows what version of django this patch is applied? Or a
other way to solve this problem?

Regards

-- 
Ricardo Lapa Dani

-- 
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 to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Multiple INNER JOIN without raw SQL

2011-03-18 Thread Ricardo F. Teixeira
Hi Jason.

You are correct, Package.objects.all() does the job partially, but I
forget to mention (sorry) that what I want is all coments from a
specified package.

WHERE Package.name = 'some_package_name'

So using Packages.objects.all() does not retrieve, or dos not select,
all the comments from that package.
I know I can filter by name, package_list =
Package.objects.filter(name='something') but that doesn't give me the
comments for that package, because there's no relation between those
tables. The bad side of this approach is that I cannot change the ERM
for this database. I'm guessing that the only option is using raw
queries.

Ricardo F. Teixeira

On Mar 18, 4:52 pm, Jason Culverhouse  wrote:
> On Mar 18, 2011, at 6:38 AM, Ricardo F. Teixeira wrote:
>
> > Hi everyone!
>
> > Without using raw SQL queries how can I make multiple joins using this
> > model?
>
> Do a search for  "django select_related reverse one to many" for some 
> alternatives
>
>
>
>
>
> > I'm trying to get something like this:
>
> > SELECT Package.package, Release.release, Release.version,
> > ContribComment.*
> > FROM ContribComment
> > INNER JOIN Contrib
> > ON Contrib.id = ContribComment.fk_contrib_id
> > INNER JOIN ContribRelease
> > ON ContribRelease.fk_contrib = Contrib.id
> > INNER JOIN Release
> > ON Release.id = ContribRelease.id
> > INNER JOIN Package
> > ON Package.id = Release.fk_package
>
> > Is that possible to anchive something like this without using raw SQL
> > queries?
> > I'm asking that because I can't find any example with multiple inner
> > joins that is similar to my model.
>
> What you want work is:
>         Package.objects.select_related()
>
> But since the ORM will only follow 'forward' ForeignKey references,
> the result will be the same as:
>         Package.objects.all()
>
> You can get close with
>         ContribRelease.objects.select_related()
>
> which will inner join everything except ContribComment since there is no
> "forward" ForeignKey reference
>
> seehttp://docs.djangoproject.com/en/dev/ref/models/querysets/#select-rel...
>
>
>
>
>
> > class ContribComment(models.Model):
> >    fk_contrib_id = models.ForeignKey(Contrib)
> >    subject = models.TextField()
> >    text = models.TextField()
> >    ratings = models.IntegerField()
>
> > class Contrib(models.Model):
> >    username = models.TextField()
> >    city = models.TextField()
>
> > class ContribRelease(models.Model):
> >    fk_contrib = models.ForeignKey(Contrib)
> >    fk_release = models.ForeignKey(Release)
>
> > class Release(models.Model):
> >    fk_package = models.ForeignKey(Package)
> >    release = models.TextField()
> >    version = models.TextField()
> >    distribution = models.TextField()
> >    arch = models.TextField()
> >    summary = models.TextField()
> >    description = models.TextField()
>
> > class Package(models.Model):
> >    name = models.TextField(unique=True)
> >    homepage = models.TextField()
> >    snapshot = models.TextField()
>
> > Thanks,
>
> > Ricardo F. Teixeira
>
> Jason

-- 
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 to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Multiple INNER JOIN without raw SQL

2011-03-18 Thread Ricardo F. Teixeira
Hi everyone!

Without using raw SQL queries how can I make multiple joins using this
model?

I'm trying to get something like this:

SELECT Package.package, Release.release, Release.version,
ContribComment.*
FROM ContribComment
INNER JOIN Contrib
ON Contrib.id = ContribComment.fk_contrib_id
INNER JOIN ContribRelease
ON ContribRelease.fk_contrib = Contrib.id
INNER JOIN Release
ON Release.id = ContribRelease.id
INNER JOIN Package
ON Package.id = Release.fk_package

Is that possible to anchive something like this without using raw SQL
queries?
I'm asking that because I can't find any example with multiple inner
joins that is similar to my model.

class ContribComment(models.Model):
fk_contrib_id = models.ForeignKey(Contrib)
subject = models.TextField()
text = models.TextField()
ratings = models.IntegerField()

class Contrib(models.Model):
username = models.TextField()
city = models.TextField()

class ContribRelease(models.Model):
fk_contrib = models.ForeignKey(Contrib)
fk_release = models.ForeignKey(Release)

class Release(models.Model):
fk_package = models.ForeignKey(Package)
release = models.TextField()
version = models.TextField()
distribution = models.TextField()
arch = models.TextField()
summary = models.TextField()
description = models.TextField()

class Package(models.Model):
name = models.TextField(unique=True)
homepage = models.TextField()
snapshot = models.TextField()

Thanks,

Ricardo F. Teixeira

-- 
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 to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Cannot import models.py in views.py

2011-03-17 Thread Ricardo F. Teixeira
Hi Shaw and Bill,

Yeap, I already have done that with no luck.

ricardo@vulcanus:~/webservices/reviewsapp$ python views.py
Traceback (most recent call last):
  File "views.py", line 13, in 
from webservices.reviewsapp.models import *
ImportError: No module named webservices.reviewsapp.models

ricardo@vulcanus:~/webservices$ python urls.py
Traceback (most recent call last):
  File "urls.py", line 8, in 
from reviewsapp.models import *
  File "/home/ricardo/webservices/reviewsapp/models.py", line 10, in

from django.db import models
  File "/usr/lib/pymodules/python2.7/django/db/__init__.py", line 14,
in 
if not settings.DATABASES:
  File "/usr/lib/pymodules/python2.7/django/utils/functional.py", line
276, in __getattr__
self._setup()
  File "/usr/lib/pymodules/python2.7/django/conf/__init__.py", line
38, in _setup
raise ImportError("Settings cannot be imported, because
environment variable %s is undefined." % ENVIRONMENT_VARIABLE)
ImportError: Settings cannot be imported, because environment variable
DJANGO_SETTINGS_MODULE is undefined.
ricardo@vulcanus:~/webservices$

I'm starting to became confuse. If I try the same thing with urls.py
which import two functions frow views, it shows that django settings
module is not defined and does not throw an invalid module. Basically
in urls.py python can import views.py but in views.py cannot import
models.py? Weird…

Sugestions? Append in PYTHON_PATH my app dir?

Ricardo F. Teixeira

-- 
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 to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Cannot import models.py in views.py

2011-03-17 Thread Ricardo F. Teixeira
Hi list : )

I'm having a strange problem. I'm developing a webservice that
communicate with a database.
In my views.py file I'm trying to import models.py to manage some
queries but I got an error in views.py when I import models.py.

ricardo@vulcanus:~/webservices/reviewsapp$ python views.py
Traceback (most recent call last):
  File "views.py", line 13, in 
from reviewsapp.models import Category
ImportError: No module named reviewsapp.models

ricardo@vulcanus:~/webservices/reviewsapp$ ls models.py
models.py

In settings.py I have:
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'webservices.reviewsapp',
)

So in theory this should work, and I can(!) but only in django shell.

ricardo@vulcanus:~/webservices/reviewsapp$ python ../manage.py shell
In [1]: from reviewsapp.models import *

In [2]: C
Category Contrib  ContribComment   ContribReleases
ContribRoles ContribVersions

And it shows my model.

What I'm doing wrong here?

Thanks,

Ricardo F. Teixeira


-- 
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 to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: foreign key to self in sqllite3

2011-03-05 Thread Ricardo L. Dani
Use the name of class instead:

parent = models.ForeignKey("Category", blank=True, null=True,
verbose_name=_("parent"))

2011/3/5 mohammad Efazati 

> I have model field foreign key to self
> but sql have error and cant create null field for field
> why?
>
> class Category(models.Model):
> title = models.CharField(max_length=250,\
>  unique=True, verbose_name=_("Title"))
> slug = models.SlugField(max_length=100,\
> verbose_name=_("Slug"),\
> help_text=_("This Field will fill\
> automaticaly by title"))
> parent = models.ForeignKey('self', blank=True, null=True,
> verbose_name=_("parent"))
>
> thanks
>
> --
> 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 to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 
Ricardo Lapa Dani

-- 
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 to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: RadioSelect widget in Django 1.1 using Model Form

2010-11-03 Thread Ricardo L. Dani
Thanks Daniel,

Now it makes sense.

Thank you again

2010/11/3 Daniel Roseman 

> On Nov 3, 3:03 pm, "Ricardo L. Dani"  wrote:
> > Hello,
> >
> > I'm working with an project using django-cms and django 1.1 and I have
> this
> > problem:
> >
> > With a big model form with many choice charFields must be reendered as
> >  and not as 's (default)
> >
> > Ex:
> >
> > field = models.CharField(max_length=1, default=None, choices=CHOICES)
> >
> > renders:
> >
> > 
> > 
> > ... etc
> >
> > but i need a 
> >
> > With django 1.2 i get this using:
> >
> > class InscricaoForm(ModelForm):
> >
> > class Meta:
> > model = Inscricao
> > widgets ={
> > 'possiveis_areas_de_interesse' : RadioSelect,
> > 'regime_dedicacao_curso' : RadioSelect,
> > 'vinculo_empregaticio' : RadioSelect,
> > 'interesse_bolsa_estudos' : RadioSelect,
> > 'conhecimento_linguas_estrangeiras' : RadioSelect
> > }
> >
> > but I use django-cms and this not works fine with django 1.2
> >
> > the question: how i do that with django 1.1 ?
> >
> > thanks
> >
> > Ps: sorry for the bad english :/
> >
>
> Your English is fine.
>
> You have to overwrite the field declaration for each one you want to
> change, specifying the `widget` argument:
>
> class InscricaoForm(ModelForm):
>possiveis_areas_de_interesse =
> forms.ChoiceField(choices=FOO_CHOICES, widget=forms.RadioSelect)
>
> etc. You have to remember to include all the options you've defined
> for your model field - default, max_length, is_required. It's
> unfortunately very verbose, which is why the `widgets` syntax was
> introduced in version 1.2.
> --
> DR.
>
> --
> 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
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
Ricardo Lapa Dani
Graduando em Ciência da Computação
Universidade Federal de Ouro Preto

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



RadioSelect widget in Django 1.1 using Model Form

2010-11-03 Thread Ricardo L. Dani
Hello,

I'm working with an project using django-cms and django 1.1 and I have this
problem:

With a big model form with many choice charFields must be reendered as
 and not as 's (default)

Ex:

field = models.CharField(max_length=1, default=None, choices=CHOICES)

renders:



... etc

but i need a 

With django 1.2 i get this using:

class InscricaoForm(ModelForm):

class Meta:
model = Inscricao
widgets ={
'possiveis_areas_de_interesse' : RadioSelect,
'regime_dedicacao_curso' : RadioSelect,
'vinculo_empregaticio' : RadioSelect,
'interesse_bolsa_estudos' : RadioSelect,
'conhecimento_linguas_estrangeiras' : RadioSelect
}

but I use django-cms and this not works fine with django 1.2

the question: how i do that with django 1.1 ?

thanks

Ps: sorry for the bad english :/

-- 
Ricardo Lapa Dani
Graduando em Ciência da Computação
Universidade Federal de Ouro Preto

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Many to many ajax widget for admin

2010-08-02 Thread Carlos Ricardo Santos
Already tried to find a better approach without success, raw_id is now the
best option.

On 2 August 2010 10:54, Sævar Öfjörð  wrote:

> If someone is interested,
> I just used raw_id_fields in my intermediary inline modeladmin.
>
> class AuthorshipInline(admin.TabularInline):
>raw_id_fields = ('author',)
>
> This isn't exactly what I was going for, but it takes the really big
> select fields out of the picture.
>
> - Sævar
>
> On Jul 27, 5:24 am, ringemup  wrote:
> > You might want to check out grappelli and its Related Lookups feature:
> >
> > http://code.google.com/p/django-grappelli/
> >
> > On Jul 26, 4:30 pm, Sævar Öfjörð  wrote:
> >
> >
> >
> > > Hi
> >
> > > I have some models (Song and Author) that are related through an
> > > intermediary model (Authorship) like this:
> >
> > > class Song(models.Model)
> > > authors = models.ManyToManyField('Author', through='Authorship')
> >
> > > class Author(models.Model)
> > > name = models.CharField(max_length=255)
> >
> > > class Authorship(models.Model):
> > > AUTHORSHIP_TYPES = (
> > > ('lyrics', 'Lyrics'),
> > > ('melody', 'Melody'),
> > > ('cover', 'Cover'),
> > > )
> > > author = models.ForeignKey(Author)
> > > song = models.ForeignKey(Song)
> > > authorship_type = models.CharField(choices=AUTHORSHIP_TYPES)
> >
> > > I have inline editing set up in the admin for Song, so that
> > > authorships can be created/edited/deleted from the Song instance.
> > > But now the Authors have grown to about 2500 objects, which means that
> > > each select box contains 2500 options. This is too slow and I'm
> > > looking for an alternative.
> >
> > > I have come across Django Ajax Selects:
> http://code.google.com/p/django-ajax-selects/
> > > And Django Ajax Filtered Fields:
> http://code.google.com/p/django-ajax-filtered-fields/
> > > (actually I'm not sure if this can be used in the django admin)
> >
> > > But I haven't seen anything in their documentation about support for
> > > intermediary models like my Authorship model.
> >
> > > Has anyone had this problem and found a solution for it?
> >
> > > - Sævar
>
> --
> 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
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
Cumprimentos,
Carlos Ricardo Santos

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: where is my os.path

2010-08-02 Thread Carlos Ricardo Santos
So "import os"

On 2 August 2010 05:57, yalda.nasirian  wrote:

> hi
> when i type import sys or os i have error that unknown os
>
> --
> 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
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
Cumprimentos,
Carlos Ricardo Santos

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Problem with static files (MEDIA_URL and MEDIA_ROOT)

2010-06-27 Thread Denis Ricardo
Hello people! I am having any problems with static files (images, CSS)
in Django. I configured the MEDIA_URL and MEDIA_ROOT in settings.py
and when I execute the server and I go see the webpage, the static
files doesn't are encountered (the page stay without anything).

Screen Shot of my page: http://yfrog.com/jq35546894

I am using the Django 1.1, on Ubuntu 10.04. The following are the
server logs:

http://dpaste.com/211961/

This files exists! They are in this directory, but doesn't are
encountered by the Django.
The directory of my project follows below:

http://dpaste.com/211962/

And these are the files of project:

settings.py: http://dpaste.com/211967/

urls.py: http://dpaste.com/211964/

views.py: http://dpaste.com/211969/

base.html: http://dpaste.com/211971/ # This is the page of the Screen
Shot

Anybody can help me?

(Sorry by my bad english.)

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



  1   2   >