alguien sabe donde puedo registrar correos corporativos gratis,

2015-04-13 Thread wilder Hernández Garcia
alguien sabe donde puedo registrar correos corporativos gratis Gracias

-- 
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/32c73b84-3b22-4fb1-85ec-471cf9ba5309%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: login_required decorator in Django: open modal instead of redirecting to another page

2015-04-13 Thread Roh Codeur
I ended up going with Avraham's response in this. 

On Thursday, 9 April 2015 01:53:35 UTC+1, Roh Codeur wrote:
>
> Hi
>
> I have a django app which has certain sections which are reserved for 
> registered users. I have the views annotated with login_required decorator 
> which redirects the user to a login page.
>
> However, I would like to keep the user on the same page and open up a 
> modal dialog prompting user to sign in(like on the website: 
> http://www.fashiolista.com/). To achieve this, I thought I could setup a 
> middleware(instead of using login_required) and return a response like 
> below:
>
>return HttpResponse(""
>"showLogin()"
>"")
>
> When I try to do this, I realised that this renders a page with only the 
> script tag, which obviously doesnt work.
>
> I am using Bootstrap for showing modal dialogs.
>
> Middleware link: 
> http://onecreativeblog.com/post/59051248/django-login-required-middleware
>
> 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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5c3278b0-4688-4784-8a1f-7b037a6d1519%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django Admin should really support Twitter Bootsrap

2015-04-13 Thread Patrick Lemiuex
It's about time, the django admin tool should support twitter bootstrap 
markups and styling. This is the third django project where I've had to 
deal with custom form widgets because the admin tool supports kind of an 
outdated layout scheme in the admin template.

This also affects a lot of third party apps as well. It would be something 
worth contributing to the community by 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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/80fd3f22-5348-49bf-ba46-baee3cd76bc6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Python csv Module ValueError Exception

2015-04-13 Thread Henry Versemann
Up till now I've had no problems using the Python 2.7.8 csv module 
to write to Python dictionary objects to a csv file, using 
the csv.DictWriter, however now it appears that I'm sending it an object 
that it can't handle (See the attached file for an edited/readable version 
of the python object throwing the ValueError exception.). It doesn't appear 
to have many new characters which might be causing the problem, except that 
it seems to have comma characters as part of some of the field values. So 
I'm wondering if that could be the problem?

Would using the csv.Sniffer() possibly help solve my  problem(s)?

I've not seen this before so I would appreciate any help or suggestions in 
trying to figure this out.

Is there any way to fine-tune my exception checking/catching to better show 
me where the problem is? I'm currently using just a try/except in the code 
that's throwing the error. 

Thanks.

Henry

-- 
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/8477aa5e-e849-4331-aa36-6c0c99f6b09b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



{
'has_overrides': False, 
'points_possible': 3, 
'updated_at': '2015-03-27T17:04:57Z', 
'turnitin_enabled': 'None', 
'course_id': 5269, 
'id': 55988, 
'locked_for_user': False,
'muted': False, 
'grading_type': 'points', 
'peer_reviews': False, 
'discussion_topic': 
{
'attachments': [], 
'delayed_post_at': None, 
'last_reply_at': '2015-03-27T17:04:46Z', 
'locked_for_user': False, 
'can_group': True, 
'message': 'e5d6 imutgy8kly8u9poy8.,9p8ip90', 
'read_state': 'unread', 
'id': 45944, 
'unread_count': 0, 
'subscribed': False, 
'title': '578o,y89poy890p[ji0[pi0k', 
'discussion_type': 'side_comment', 
'user_can_see_posts': True, 
'posted_at': '2015-03-27T17:04:46Z', 
'require_initial_post': None, 
'pinned': False, 
'discussion_subentry_count':0, 
'topic_children': [], 
'user_name': ' x ', 
'root_topic_id': None,
'assignment_id': 55988, 
'podcast_has_student_posts': False, 
'podcast_url': None, 
'html_url': 
'https://xx.beta.instructure.com/courses/5269/discussion_topics/45944', 
'can_unpublish': True, 
'permissions': 
{
'attach': True, 
'update': True,
'delete': True
}, 
'locked': False, 
'group_category_id': None, 
'can_lock': True, 
'lock_at': None, 
'author': 
{
'avatar_image_url': 
'https://xx.instructure.com/images/thumbnails/275792/EqKbSWlDn3akrSERY2sxyR32unu1YUHG8rhQYCR1',
 
'display_name': 'x ', 
'id': 1, 
'html_url': 
'https://xx.beta.instructure.com/courses/5269/users/1'
}, 
'url': 
'https://xx.beta.instructure.com/courses/5269/discussion_topics/45944', 
'published': True, 
'position': None
}, 
'integration_data': {}, 
'description': 'e5d6 imutgy8kly8u9poy8.,9p8ip90', 
'anonymous_peer_reviews': 'None', 
'grade_group_students_individually': 'None', 
'grading_standard_id': 'None', 
'html_url': 
'https://xx.beta.instructure.com/courses/5269/assignments/55988', 
'turnitin_settings': 
{
'originality_report_visibility': 'immediate', 
'internet_check': False, 
'journal_check': False, 'exclude_small_matches_type': None, 
'exclude_quoted': False, 
'submit_papers_to': True, 
's_paper_check': False, 
'exclude_small_matches_value': None, 
'exclude_biblio': False
}, 
'has_submitted_submissions': False,  
'needs_grading_count': 0, 
'group_category_id': 'None', 
'integration_id': 'None', 
'name': '578o,y89poy890p[ji0[pi0k', 
'unlock_at': '2015-03-26T05:00:00Z', 
'due_at': 'None', 
'created_at': '2015-03-27T17:04:46Z', 
'post_to_sis': 'None', 
'lock_at': 'None', 
'assignment_group_id': 13902, 
'automatic_peer_reviews': False,  
'published': True, 
'position': 1, 
 

Re: classic: unsupported operand type(s) for +: 'int' and 'NoneType'

2015-04-13 Thread Bill Blanchard
If you allow Null values in your model and one of the two is being
populated with Null, then you'll get the error you're seeing.  Example:

Form:
ram_1 = 56
ram_2 = Null (None)

56 + Null (None) doesn't work.

What you should do instead is set Null to FALSE in both your field
declarations and set a default value (it could be zero if you want, but
since you have two choices, you can make it one of the two as well).  You
could leave it as null=True and set a default value, but that seems like
bad practice.

Bill

On Mon, Apr 13, 2015 at 4:07 PM, makayabou  wrote:

> It's  ram_tot = self.ram_1 + self.ram_2
>
> that returns me "cannot contenate int and NOne
>
> On Monday, April 13, 2015 at 10:05:49 PM UTC+2, makayabou wrote:
>>
>> Hello,
>> I'm sorry for that trivial problem, but I'm still a bit lost...
>>
>> [code]
>> #In models.py:
>>
>> class Ordi(models.Model):
>> RAM_CAP_1 = 1024
>> RAM_CAP_2 = 2048
>> RAM_CAP_CHOICES = (
>> (RAM_CAP_1, u'1G'),
>> (RAM_CAP_2, u'2G'),
>> )
>> ram_1 = models.IntegerField("memory slot 1", max_length=10,
>> choices=RAM_CAP_CHOICES, null= True, blank=True)
>> ram_2 = models.IntegerField("memory slot 2", max_length=10,
>> choices=RAM_CAP_CHOICES, null= True, blank=True)
>>
>> def ram_total(self):
>> ram_tot = self.ram_capacite_1 + self.ram_capacite_2
>> #
>> # Here, python can't contenate int and NoneType...
>> #
>> return ram_tot
>>  def maintenus(self):
>> ordis_maintenus = self.maintenance_set.all()
>> for o in ordis_maintenus:
>> return o.__unicode__
>> def __unicode__(self):
>> return 'ordi '+unicode(self.id)+' - '+self.renvoios()
>>
>>
>> class Maintenance(models.Model):
>> ordi = models.ForeignKey(Ordi)
>> def __unicode__(self):
>> return self.titre + " du " +self.date_sortie.strftime('%m/%d/%Y')
>>
>> [/code]
>>
>  --
> 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/f30ef94f-55b4-482f-9b39-a007e99321ff%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/CAP7uEDLOp95VocH73Tx74LV7OMQmWHAsoAKErPBipC%3D_GxKGNQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: classic: unsupported operand type(s) for +: 'int' and 'NoneType'

2015-04-13 Thread makayabou
It's  ram_tot = self.ram_1 + self.ram_2

that returns me "cannot contenate int and NOne

On Monday, April 13, 2015 at 10:05:49 PM UTC+2, makayabou wrote:
>
> Hello,
> I'm sorry for that trivial problem, but I'm still a bit lost...
>
> [code]
> #In models.py:
>
> class Ordi(models.Model):
> RAM_CAP_1 = 1024
> RAM_CAP_2 = 2048
> RAM_CAP_CHOICES = (
> (RAM_CAP_1, u'1G'),
> (RAM_CAP_2, u'2G'),
> )
> ram_1 = models.IntegerField("memory slot 1", max_length=10, 
> choices=RAM_CAP_CHOICES, null= True, blank=True)
> ram_2 = models.IntegerField("memory slot 2", max_length=10, 
> choices=RAM_CAP_CHOICES, null= True, blank=True)
>
> def ram_total(self):
> ram_tot = self.ram_capacite_1 + self.ram_capacite_2
> #
> # Here, python can't contenate int and NoneType...
> #
> return ram_tot
>  def maintenus(self):
> ordis_maintenus = self.maintenance_set.all()
> for o in ordis_maintenus:
> return o.__unicode__
> def __unicode__(self):
> return 'ordi '+unicode(self.id)+' - '+self.renvoios()
>
>
> class Maintenance(models.Model):
> ordi = models.ForeignKey(Ordi)
> def __unicode__(self):
> return self.titre + " du " +self.date_sortie.strftime('%m/%d/%Y')
> 
> [/code]
>

-- 
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/f30ef94f-55b4-482f-9b39-a007e99321ff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


classic: unsupported operand type(s) for +: 'int' and 'NoneType'

2015-04-13 Thread makayabou
Hello,
I'm sorry for that trivial problem, but I'm still a bit lost...

[code]
#In models.py:

class Ordi(models.Model):
RAM_CAP_1 = 1024
RAM_CAP_2 = 2048
RAM_CAP_CHOICES = (
(RAM_CAP_1, u'1G'),
(RAM_CAP_2, u'2G'),
)
ram_1 = models.IntegerField("memory slot 1", max_length=10, 
choices=RAM_CAP_CHOICES, null= True, blank=True)
ram_2 = models.IntegerField("memory slot 2", max_length=10, 
choices=RAM_CAP_CHOICES, null= True, blank=True)

def ram_total(self):
ram_tot = self.ram_capacite_1 + self.ram_capacite_2
#
# Here, python can't contenate int and NoneType...
#
return ram_tot
 def maintenus(self):
ordis_maintenus = self.maintenance_set.all()
for o in ordis_maintenus:
return o.__unicode__
def __unicode__(self):
return 'ordi '+unicode(self.id)+' - '+self.renvoios()


class Maintenance(models.Model):
ordi = models.ForeignKey(Ordi)
def __unicode__(self):
return self.titre + " du " +self.date_sortie.strftime('%m/%d/%Y')

[/code]

-- 
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/2a666fc7-92bc-487f-ba71-62594aa304cd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Please advise about pros/cons of cross-platform as Phonegap and Titanium in combination with Django.

2015-04-13 Thread Filipe Ximenes
About cross-platform mobile development: my advice is to only use then if
it's a simple app. If you are planning to do something more complex, like
some innovative interface or expecting a very fluid interaction, it's often
not a good choice.
Many times you will struggle to replicate mobile behaviour using this
technology. Also, it's common to need to interact with native modules, and
sometimes you will even need to develop your own native modules. Trust me:
it's not funny to juggle between javascript, objective-c, and java.
Otherwise, i've worked with Phonegap, it's a good framework, has a lot of
open source packages developed by the community.
Also, consider Ionic: http://ionicframework.com/

On Mon, Apr 13, 2015 at 3:22 PM, Filipe Ximenes 
wrote:

> I'm assuming your current application is not a SPA (single page
> application).
> Django is a good option for serving data for a mobile app, you just need
> to develop an API. Django default behaviour is to serve full html pages,
> but when you are working with mobile apps you are only interested in the
> actual data from your django application, therefore a JSON (or other format
> you'd like to use) it's a better choice. There are a some libs that will
> help you developing an API, the most used ones are: Tastypie and Django
> REST framework (DRF). I really like working with DRF, it's a very powerful
> tool, very popular and with an active community.
>
> http://django-rest-framework.org/
>
> Also, in my company, when we are doing applications that will interact
> with mobile devices, we do all the backend logic in an API and for the
> frontend, we do a SPA using Angular.js. This way we keep all the logic in a
> single place, accelerating the backend development and reducing the amount
> of code needed to maintain.
>
> On Mon, Apr 13, 2015 at 2:45 PM, 백병화  wrote:
>
>> Hi All
>> I'm using
>> django+python+mariadb+mysql+redis+html5+css3+javascript+jquery+nginx 4 web
>> development
>> and I'm wondering cross-platform as Phonegap or titanium for mobile apps.
>> Colud you plz advise about pros/cons of them(In combination with
>> Django+Python)?
>> Thank you for reading ma article.
>>
>> --
>> 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/cdb48ad5-8a01-4362-84a2-5233407c9405%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
>
>
> *Filipe Ximenes*+55 (81) 8245-9204
>
> *Vinta Software Studio*http://www.vinta.com.br
>



-- 


*Filipe Ximenes*+55 (81) 8245-9204

*Vinta Software Studio*http://www.vinta.com.br

-- 
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/CAA-QWB0k4MmzBPDoESPzOStwP8%3DuTNewP4UywZ5Pr-JKfou83Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Please advise about pros/cons of cross-platform as Phonegap and Titanium in combination with Django.

2015-04-13 Thread Filipe Ximenes
I'm assuming your current application is not a SPA (single page
application).
Django is a good option for serving data for a mobile app, you just need to
develop an API. Django default behaviour is to serve full html pages, but
when you are working with mobile apps you are only interested in the actual
data from your django application, therefore a JSON (or other format you'd
like to use) it's a better choice. There are a some libs that will help you
developing an API, the most used ones are: Tastypie and Django REST
framework (DRF). I really like working with DRF, it's a very powerful tool,
very popular and with an active community.

http://django-rest-framework.org/

Also, in my company, when we are doing applications that will interact with
mobile devices, we do all the backend logic in an API and for the frontend,
we do a SPA using Angular.js. This way we keep all the logic in a single
place, accelerating the backend development and reducing the amount of code
needed to maintain.

On Mon, Apr 13, 2015 at 2:45 PM, 백병화  wrote:

> Hi All
> I'm using
> django+python+mariadb+mysql+redis+html5+css3+javascript+jquery+nginx 4 web
> development
> and I'm wondering cross-platform as Phonegap or titanium for mobile apps.
> Colud you plz advise about pros/cons of them(In combination with
> Django+Python)?
> Thank you for reading ma article.
>
> --
> 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/cdb48ad5-8a01-4362-84a2-5233407c9405%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 


*Filipe Ximenes*+55 (81) 8245-9204

*Vinta Software Studio*http://www.vinta.com.br

-- 
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/CAA-QWB1umJ9QvGA68365g_78Q6qfoQsdwUTMMsAGoQE4%2BMnmXw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Please advise about pros/cons of cross-platform as Phonegap and Titanium in combination with Django.

2015-04-13 Thread 백병화
Hi All
I'm using 
django+python+mariadb+mysql+redis+html5+css3+javascript+jquery+nginx 4 web 
development
and I'm wondering cross-platform as Phonegap or titanium for mobile apps.
Colud you plz advise about pros/cons of them(In combination with 
Django+Python)?
Thank you for reading ma article.

-- 
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/cdb48ad5-8a01-4362-84a2-5233407c9405%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django hstore widget not working

2015-04-13 Thread Tim Graham
That's the correct output according to 
https://docs.djangoproject.com/en/1.8/ref/contrib/postgres/forms/#hstorefield

On Monday, April 13, 2015 at 7:10:01 AM UTC-4, ksingh wrote:
>
> Hello,
> Had recently updated my project to 1.8, and now the widget for hstore on 
> admin is not proper.
> It is just showing me the textarea field with dictionary data.
>

-- 
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/49c524f2-e2f4-43a8-b36a-652f424b6efb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django ProgrammingError: no relation exists when using ManyToManyfield

2015-04-13 Thread Pavel Kuchin
Hi Chase,

Can you please attach your settings.py (or at least DATABASES and
INSTALLED_APPS options) and LocationModel class?

Best regards, Pavel

2015-04-13 17:37 GMT+03:00 Chase Cooley :
> Yes, I have tried makemigrations and migrate for all modules and it still
> doesn't work. I have also tried makemigrations and migrate for individual
> modules with no luck.
>
> On Sunday, April 12, 2015 at 10:12:08 AM UTC-5, Pavel Kuchin wrote:
>>
>> Hi Chase,
>>
>> Did you try makemigrations and migrate:
>> $ python manage.py makemigrations
>> $ python manage.py migrate
>> You should run them for all modules at first time (do not set any specific
>> module).
>>
>> Best regards, Pavel.
>>
>>> I can post code and errors here, but have already posted on
>>> stackoverflow.com and so I figured it might be useful to see some of the
>>> comments users on that site have suggested. If this is not acceptable let me
>>> know and i'll post everything here.
>>> Thanks!
>>>
>>>
>>> http://stackoverflow.com/questions/29190190/django-programmingerror-no-relation-exists-when-using-manytomanyfield?noredirect=1#comment46603898_29190190
>
> --
> 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/MHngqha8fIk/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/3d6bcc21-7176-4b45-8ae2-576872381521%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/CALyspwr9MeQ6KLOfEvmWo%2BF_L239a2ZokY3WoRpZXAy_Ct6QaQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django ProgrammingError: no relation exists when using ManyToManyfield

2015-04-13 Thread Chase Cooley
Yes, I have tried makemigrations and migrate for all modules and it still 
doesn't work. I have also tried makemigrations and migrate for individual 
modules with no luck.

On Sunday, April 12, 2015 at 10:12:08 AM UTC-5, Pavel Kuchin wrote:
>
> Hi Chase,
>
> Did you try makemigrations and migrate:
> $ python manage.py makemigrations
> $ python manage.py migrate
> You should run them for all modules at first time (do not set any specific 
> module).
>
> Best regards, Pavel.
>
> I can post code and errors here, but have already posted on 
>> stackoverflow.com and so I figured it might be useful to see some of the 
>> comments users on that site have suggested. If this is not acceptable let 
>> me know and i'll post everything here.
>> Thanks!
>>
>>
>> http://stackoverflow.com/questions/29190190/django-programmingerror-no-relation-exists-when-using-manytomanyfield?noredirect=1#comment46603898_29190190
>>
>

-- 
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/3d6bcc21-7176-4b45-8ae2-576872381521%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django admin page display unnormal

2015-04-13 Thread aRkadeFR

Your static files are not served properly.

Please, run the collectstatic command and see if the admin
static files are copied.

Check in your browser that the files media are served then.

aRkadeFR

On 04/13/2015 05:04 AM, zli wrote:


It is my admin add user page



It is static_root setting





--
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/226a43b2-4918-43f1-9e12-3cb716c05d8b%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/552BBB58.8040405%40arkade.info.
For more options, visit https://groups.google.com/d/optout.


Re: view queryset object in admin view

2015-04-13 Thread makayabou
Thank you Jani,
it solved it!
I was just loosing around, I finally got it...
thanks all

On Monday, April 13, 2015 at 2:29:36 PM UTC+2, makayabou wrote:
>
> I made a clearer and full sample code.
> When I use the code as is, I get results in a poor readable
> format in PCAdmin view
> [, ] 
> 
> although I just want Jean Dubois, martin franck
>
> Thanks for help
>
> My models.py
> [code]
> from django.db import models
>
> class PC(models.Model):
> os= models.CharField(max_length=5, null=True, blank=True)
> def users(self):
> pc = self.user_set.all()
> return pc
> # If I use loop "for", I get a great unicode view, but only the first 
> result...
> # for o in pc:
> # return o.__unicode__()
> def __unicode__(self):
> return 'pc  '+ unicode(self.id)+ ' - ' + self.os
>
> class User(models.Model):
> name=models.CharField(max_length=20, null=True, blank=True)
> mypc = models.ForeignKey(PC, null=True,blank=True)
> def __unicode__(self):
> return self.name
> [/code]
>
> My admin.py:
> [code]
> from django.contrib import admin
> from users.models import User, PC
>
> class PCAdmin(admin.ModelAdmin):
> list_display = ('users','id')
> 
> class UserAdmin(admin.ModelAdmin):  
> list_display = ('name','mypc')
> admin.site.register(User, UserAdmin)
> admin.site.register(PC, PCAdmin)
> /]
>
>
>
>
> On Monday, April 13, 2015 at 1:12:55 PM UTC+2, makayabou wrote:
>>
>> Hello,
>> thanks for reply,
>> of course attribute name was defined, I just ommited to past it!
>>
>> Here's code:
>>
>> [code]
>> #In models.py:
>>
>>
>> class PC(models.Model):
>> def users(self):
>> pc = self.user_set.all()
>> for o in pc:
>> return o.__unicode__
>> def __unicode__(self):
>> return 'pc '+unicode(self.id)+' - '+self.os()
>>
>>
>> class User(models.Model):
>> name=models.TextField()
>> mypc = models.ForeignKey(PC)
>> def __unicode__(self):
>> return self.name   
>>
>>
>> #In admin.py:
>>
>>
>> class PcAdmin(admin.ModelAdmin):
>> list_display = ('users','id')
>> [/code]
>>
>> Still have this weird print: 
>> >
>>
>> instead of:
>> Jean Dubois
>>
>> thank you for help
>>
>> Le lundi 13 avril 2015 07:57:00 UTC+2, Avraham Serour a écrit :
>>>
>>> Well, your class User doesn't have an attribute name you are using on 
>>> the method __unicode__, you should define and set the attribute name with 
>>> something like a textfield
>>> On Apr 13, 2015 3:21 AM, "makayabou"  wrote:
>>>
 Hello,

 Sorry for the previous send unattended...

 I have problems trying to print values of a QUerySet Object in Admin 
 View.

 In admin view, I would like to get a clear list of results,
> as defined in __unicode__ from class User.
> Instead, I get:
>
> >
>
> I just need Jean Dubois..
>
> Here's the code:
>
> #In models.py:
>
>
> class PC(models.Model):
>  def users(self):
>  pc = self.user_set.all()
>  for o in pc:
>  return o.__unicode__
>  def __unicode__(self):
>  return 'pc '+unicode(self.id)+' - '+self.os()
>
>
>
>
> class User(models.Model):
> mypc = models.ForeignKey(PC)
> def __unicode__(self):
> return self.name   
>
>
> #In admin.py:
>
>
> class PcAdmin(admin.ModelAdmin):
> list_display = ('users','id')
>
>
 Thanks for your 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...@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/61ec8171-77c5-4bba-9274-8f209422d15e%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/b929d114-e364-4864-926c-0dc0ec5b91dc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: view queryset object in admin view

2015-04-13 Thread makayabou
I made a clearer and full sample code.
When I use the code as is, I get results in a poor readable
format in PCAdmin view
[, ] 

although I just want Jean Dubois, martin franck

Thanks for help

My models.py
[code]
from django.db import models

class PC(models.Model):
os= models.CharField(max_length=5, null=True, blank=True)
def users(self):
pc = self.user_set.all()
return pc
# If I use loop "for", I get a great unicode view, but only the first 
result...
# for o in pc:
# return o.__unicode__()
def __unicode__(self):
return 'pc  '+ unicode(self.id)+ ' - ' + self.os

class User(models.Model):
name=models.CharField(max_length=20, null=True, blank=True)
mypc = models.ForeignKey(PC, null=True,blank=True)
def __unicode__(self):
return self.name
[/code]

My admin.py:
[code]
from django.contrib import admin
from users.models import User, PC

class PCAdmin(admin.ModelAdmin):
list_display = ('users','id')

class UserAdmin(admin.ModelAdmin):  
list_display = ('name','mypc')
admin.site.register(User, UserAdmin)
admin.site.register(PC, PCAdmin)
/]




On Monday, April 13, 2015 at 1:12:55 PM UTC+2, makayabou wrote:
>
> Hello,
> thanks for reply,
> of course attribute name was defined, I just ommited to past it!
>
> Here's code:
>
> [code]
> #In models.py:
>
>
> class PC(models.Model):
> def users(self):
> pc = self.user_set.all()
> for o in pc:
> return o.__unicode__
> def __unicode__(self):
> return 'pc '+unicode(self.id)+' - '+self.os()
>
>
> class User(models.Model):
> name=models.TextField()
> mypc = models.ForeignKey(PC)
> def __unicode__(self):
> return self.name   
>
>
> #In admin.py:
>
>
> class PcAdmin(admin.ModelAdmin):
> list_display = ('users','id')
> [/code]
>
> Still have this weird print: 
> >
>
> instead of:
> Jean Dubois
>
> thank you for help
>
> Le lundi 13 avril 2015 07:57:00 UTC+2, Avraham Serour a écrit :
>>
>> Well, your class User doesn't have an attribute name you are using on the 
>> method __unicode__, you should define and set the attribute name with 
>> something like a textfield
>> On Apr 13, 2015 3:21 AM, "makayabou"  wrote:
>>
>>> Hello,
>>>
>>> Sorry for the previous send unattended...
>>>
>>> I have problems trying to print values of a QUerySet Object in Admin 
>>> View.
>>>
>>> In admin view, I would like to get a clear list of results,
 as defined in __unicode__ from class User.
 Instead, I get:

 >

 I just need Jean Dubois..

 Here's the code:

 #In models.py:


 class PC(models.Model):
  def users(self):
  pc = self.user_set.all()
  for o in pc:
  return o.__unicode__
  def __unicode__(self):
  return 'pc '+unicode(self.id)+' - '+self.os()




 class User(models.Model):
 mypc = models.ForeignKey(PC)
 def __unicode__(self):
 return self.name   


 #In admin.py:


 class PcAdmin(admin.ModelAdmin):
 list_display = ('users','id')


>>> Thanks for your 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...@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/61ec8171-77c5-4bba-9274-8f209422d15e%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/9b1ce52e-edb8-4811-ad34-e5407723831c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: view queryset object in admin view

2015-04-13 Thread Jani Tiainen
Hi, there are several flaws in your code.


On Mon, 13 Apr 2015 04:12:55 -0700 (PDT)
makayabou  wrote:

> Hello,
> thanks for reply,
> of course attribute name was defined, I just ommited to past it!
> 
> Here's code:
> 
> [code]
> #In models.py:
> 
> 
> class PC(models.Model):
> def users(self):
> pc = self.user_set.all()
> for o in pc:
> return o.__unicode__

Here you return first (only first) __unicode__ method of "o" object.
Wild guess is that you want to do something like this:

def users(self):
return u', '.join([unicode(u) for u in self.user_set.all()])  ## Return 
comma separated list of users

> def __unicode__(self):
> return 'pc '+unicode(self.id)+' - '+self.os()

You declare unicode method, yet your return is a bytestring. You should put 
u-prefix before texts.

> 
> class User(models.Model):
> name=models.TextField()
> mypc = models.ForeignKey(PC)
> def __unicode__(self):
> return self.name   
> 
> 
> #In admin.py:
> 
> 
> class PcAdmin(admin.ModelAdmin):
> list_display = ('users','id')
> [/code]
> 
> Still have this weird print: 
> >
> 

That's correct output - first object and it's __unicode__ method - that's what 
you return in your code.

> instead of:
> Jean Dubois
> 
> thank you for help
> 
> Le lundi 13 avril 2015 07:57:00 UTC+2, Avraham Serour a écrit :
> >
> > Well, your class User doesn't have an attribute name you are using on the 
> > method __unicode__, you should define and set the attribute name with 
> > something like a textfield
> > On Apr 13, 2015 3:21 AM, "makayabou"  
> > wrote:
> >
> >> Hello,
> >>
> >> Sorry for the previous send unattended...
> >>
> >> I have problems trying to print values of a QUerySet Object in Admin View.
> >>
> >> In admin view, I would like to get a clear list of results,
> >>> as defined in __unicode__ from class User.
> >>> Instead, I get:
> >>>
> >>> >
> >>>
> >>> I just need Jean Dubois..
> >>>
> >>> Here's the code:
> >>>
> >>> #In models.py:
> >>>
> >>>
> >>> class PC(models.Model):
> >>>  def users(self):
> >>>  pc = self.user_set.all()
> >>>  for o in pc:
> >>>  return o.__unicode__
> >>>  def __unicode__(self):
> >>>  return 'pc '+unicode(self.id)+' - '+self.os()
> >>>
> >>>
> >>>
> >>>
> >>> class User(models.Model):
> >>> mypc = models.ForeignKey(PC)
> >>> def __unicode__(self):
> >>> return self.name   
> >>>
> >>>
> >>> #In admin.py:
> >>>
> >>>
> >>> class PcAdmin(admin.ModelAdmin):
> >>> list_display = ('users','id')
> >>>
> >>>
> >> Thanks for your 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...@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/61ec8171-77c5-4bba-9274-8f209422d15e%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/58ba4264-a9b1-4a7e-a86c-cc9d145deaab%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.


-- 
Jani Tiainen

-- 
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/20150413142244.252d5d6d%40jns42-l.w2k.keypro.fi.
For more options, visit https://groups.google.com/d/optout.


Re: view queryset object in admin view

2015-04-13 Thread makayabou
Hello,
thanks for reply,
of course attribute name was defined, I just ommited to past it!

Here's code:

[code]
#In models.py:


class PC(models.Model):
def users(self):
pc = self.user_set.all()
for o in pc:
return o.__unicode__
def __unicode__(self):
return 'pc '+unicode(self.id)+' - '+self.os()


class User(models.Model):
name=models.TextField()
mypc = models.ForeignKey(PC)
def __unicode__(self):
return self.name   


#In admin.py:


class PcAdmin(admin.ModelAdmin):
list_display = ('users','id')
[/code]

Still have this weird print: 
>

instead of:
Jean Dubois

thank you for help

Le lundi 13 avril 2015 07:57:00 UTC+2, Avraham Serour a écrit :
>
> Well, your class User doesn't have an attribute name you are using on the 
> method __unicode__, you should define and set the attribute name with 
> something like a textfield
> On Apr 13, 2015 3:21 AM, "makayabou"  
> wrote:
>
>> Hello,
>>
>> Sorry for the previous send unattended...
>>
>> I have problems trying to print values of a QUerySet Object in Admin View.
>>
>> In admin view, I would like to get a clear list of results,
>>> as defined in __unicode__ from class User.
>>> Instead, I get:
>>>
>>> >
>>>
>>> I just need Jean Dubois..
>>>
>>> Here's the code:
>>>
>>> #In models.py:
>>>
>>>
>>> class PC(models.Model):
>>>  def users(self):
>>>  pc = self.user_set.all()
>>>  for o in pc:
>>>  return o.__unicode__
>>>  def __unicode__(self):
>>>  return 'pc '+unicode(self.id)+' - '+self.os()
>>>
>>>
>>>
>>>
>>> class User(models.Model):
>>> mypc = models.ForeignKey(PC)
>>> def __unicode__(self):
>>> return self.name   
>>>
>>>
>>> #In admin.py:
>>>
>>>
>>> class PcAdmin(admin.ModelAdmin):
>>> list_display = ('users','id')
>>>
>>>
>> Thanks for your 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...@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/61ec8171-77c5-4bba-9274-8f209422d15e%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/58ba4264-a9b1-4a7e-a86c-cc9d145deaab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django admin page display unnormal

2015-04-13 Thread zli


It is my admin add user page



It is static_root setting





-- 
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/226a43b2-4918-43f1-9e12-3cb716c05d8b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django hstore widget not working

2015-04-13 Thread ksingh
Hello,
Had recently updated my project to 1.8, and now the widget for hstore on 
admin is not proper.
It is just showing me the textarea field with dictionary data.

-- 
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/cb965d47-c6a4-48ef-9eff-3d7be3ff4f7d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.