many-to-many between apps
Is it possible to establish a many-to-many relationship between a model in one app and a model in another app? I've just tried to do it and run into what I think is circular import trouble. This is a retro-fit after initial deployment. #in item.models.reference class Reference(models.Model): ... various fields ... class Meta: app_label = 'item' #in item.models.reference_region from company import Region class Reference_Region(models.Model): region = models.ForeignKey(Region) reference = models.ForeignKey(Reference) class Meta: app_label = 'item' #in company.models.region from item import Reference class Region(models.Model): ... various fields ... ref = models.ManyToManyField(Reference) I have tried it the other way declaring the many-to-many field in Reference and the same thing happens. ImportError: cannot import name Reference and ImportError: cannot import name Region respectively Any ideas appreciated Thanks 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 http://groups.google.com/group/django-users. For more options, visit https://groups.google.com/groups/opt_out.
Re: many-to-many between apps
On 31/07/2013 5:08pm, Mike Dewhirst wrote: Is it possible to establish a many-to-many relationship between a model in one app and a model in another app? Yes. I needed to avoid importing the class and use ... class Region(models.Model): ... various fields ... ref = models.ManyToManyField('item.Reference') Lovely! Thanks for Django I've just tried to do it and run into what I think is circular import trouble. This is a retro-fit after initial deployment. #in item.models.reference class Reference(models.Model): ... various fields ... class Meta: app_label = 'item' #in item.models.reference_region from company import Region class Reference_Region(models.Model): region = models.ForeignKey(Region) reference = models.ForeignKey(Reference) class Meta: app_label = 'item' #in company.models.region from item import Reference class Region(models.Model): ... various fields ... ref = models.ManyToManyField(Reference) I have tried it the other way declaring the many-to-many field in Reference and the same thing happens. ImportError: cannot import name Reference and ImportError: cannot import name Region respectively Any ideas appreciated Thanks 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 http://groups.google.com/group/django-users. For more options, visit https://groups.google.com/groups/opt_out.
Moving data in a browser.
The attached screenshot, simpletab, shows the simple cross tab I have created using Django (my first functioning app). This takes in a csv data file and an xml definition file. The user selects the variables they want to see, and the table is created. My question is that the user may want to flip the table round, or add new variables to the table. I'd quite like to do this as a drag and drop thing, would I have to do this using javascript or something else? I assume I can't use Django - am I wrong is thinking that? Any suggestions of how to do that gratefully received Thanks, N// -- 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. For more options, visit https://groups.google.com/groups/opt_out. <>
Re: Learning how to build a web site for my python games and a blog
Try this; http://learnpythonthehardway.org/book/next.html http://gettingstartedwithdjango.com/ Cal On Tue, Jul 30, 2013 at 3:07 PM, Randy Baxley wrote: > I am trying to learn Django. I have a good base in Python having worked > several basic MOOCs and second level classes. My major short term goal is > to build a web site where I will have a blog on smoked brisket in Chicago > and a place to rewrite my games built in the Rice University course > Interactive Python Programming from Coursera. Here is the final program > from that class. The reason for a rewrite is these are written on > CodeSkulptor. > > http://www.codeskulptor.org/#user16_nkeTb6O5Je_12.py > > Here you will find The Django Book written by *Adrian Holovaty who wrote > Django.* > * > * > http://www.djangobook.com/en/2.0/frontmatter.html > > What I am wondering is if anyone else is working through it as well as I > keep hitting road blocks and the answers I am getting here are not working > for me in Xumbunto though that may not be the problem. I have found that a > group of folks working at the same time tend to hit on ideas in a fashion > that is more to the point and on fb that it is easy to get back to the > thread you want since there are not as many threads pertaining to other > Django topics. > > I was also asking if there is another Django tutorial that might be at > more of a beginner level? > > On Saturday, July 27, 2013 8:57:45 AM UTC-5, Randy Baxley wrote: >> >> Is anyone working through The Django Book that would like to form a fb >> page just for that or knows of a good tutorial where questions will get >> answers? >> > -- > 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. > 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. For more options, visit https://groups.google.com/groups/opt_out.
j'ai rajouté une application rapidsms-xforms à rapidsms et maintenant ça ne marche pasn car la version de django de ce dernier est django1.5 et celui de rapidsms est une ancienne version et ça ne marc
-- 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. For more options, visit https://groups.google.com/groups/opt_out.
django1.5 pour rapidsms
depuis que j'ai rajouté l'application rapidsms-xforms à rapidsms, celui-ci ne marche plus car la version de ce dernier est Django1.5 et que pour rapidsms c'est un ancienne version! Les tags donnent un messages d'erreurs! Si quelqu'un peut m'aider!!! -- 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. For more options, visit https://groups.google.com/groups/opt_out.
Re: Moving data in a browser.
Things that you want to do in the browser should probably be done in the browser. If so, then Django isn't directly involved, until you want to persist the changes. There are a number of JavaScript libraries that support dragging things around a table. Long ago I did something like this using, I think, YUI (from yahoo), but I'm sure that tools have moved on since then. Personally, I now try to stick to things that leverage jQuery and jQueryUI, since I tend to load them anyway. You almost certainly will be tweaking your templates to feed the JS the information that it needs, though there may be libraries that can be pointed at virtually any table. If you're going to persist the changes without waiting for a submit button, then you need to AJAX the ordering information back when it changes. If you only save later, you still want a library that makes it easy to extract the current ordering. Remember to do things with CSS when possible. For example, hiding a table column: Rather than traipse through all the th and td for that column, setting display none, it is better to add/remove a class to the table tag (or some outer element) that triggers a CSS rule making display none. It is surprisingly easy to trigger IE to pop up "A script is taking to long. abort? continue?". On Wed, Jul 31, 2013 at 5:25 AM, Nigel Legg wrote: > The attached screenshot, simpletab, shows the simple cross tab I have > created using Django (my first functioning app). This takes in a csv data > file and an xml definition file. The user selects the variables they want > to see, and the table is created. > My question is that the user may want to flip the table round, or add new > variables to the table. I'd quite like to do this as a drag and drop > thing, would I have to do this using javascript or something else? I > assume I can't use Django - am I wrong is thinking that? > Any suggestions of how to do that gratefully received > Thanks, N// > > -- > 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. > 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. For more options, visit https://groups.google.com/groups/opt_out.
What is the best way to architect this part of the application?
I thank you again for answering a different question a couple of weeks ago. Today, however, I'm struggling with the best way to architect a part of my app. I'm hoping that you can help me figure out the best way to provide the necessary functionality to the user. I am building an application that allows home school families the ability to register their children for upcoming classes. This is a co-operative and so parents can be teachers, admins, etc. and there can be multiple children in each family. You may find the following information familiar. I copied/pasted it from my earlier post. In my models.py file I have the following class definitions: class Family(models.Model): ... name = models.CharField(verbose_name="Family Name") class FamilyMember(AbstractUser): family = models.ForeignKey(Family, blank=True, null=True) family_member_role = models.ForeignKey(FamilyMemberRole, blank=True, null=True)#For our example, let's assume this is either a parent or a child ... class Student(models.Model): ... family_member = models.OneToOneField(FamilyMember) ... class Schedule(models.Model): ... semester = models.ForeignKey(Semester, verbose_name='Semester') student = models.ManyToManyField(Student, verbose_name='Students', blank=True, null=True) ... So, there is a table called Family that I belong to. It holds my family name and a couple of other fields. There is then a one-to-many relationship from that to the FamilyMember table. In this table I have a record for each member of my family. The FamilyMember table is also being used as the authentication table for my site. I have not replaced the default security model but only abstracted it and added additional fields. My children are students so they are in the Student table. Of course, they are in the FamilyMember table with a foreign key in the Students table. I am logged into the site as myself. Since my family_member_role is set to parent I should be able to enroll all of my children into their courses. The Schedule table contains a bunch of relationships that "glue" together a course in a course catalog, a semester, a set of teachers, a set of assistants, a set of students, etc. I don't think that this this matters in my question but I wanted to mention it just in case. *** There can be unlimited periods. For this semester, we might have 3 periods but next semester we might have 4 or 5. So, I have a table that stores the periods for each semester. On to my design question. >From the user perspective, I'm thinking of the following workflow. However, I don't know if there is a better way to architect it. A parent logs into the site. She clicks on the "Schedule" link for a specific Semester. She sees a list of classes that she can enroll her children in. It is grouped by periods (first hour, second hour, etc) and it looks something like below. Note, the co-op only meets twice a month and does not replace any of the children's actual curriculum. These classes can be very educational but are really designed more for social interaction. First Period Fun with math (1st - 3rd grade) Spelling games (1st - 3rd grade) C++ programming (4th - 5th grade) Sing and dance (4th - 5th grade) Second Period Science experiments (1st - 3rd grade) Computer games (1st - 3rd grade) Woodworking (4th - 5th grade) Public speaking (4th - 5th grade) Now, as a parent, I need to enroll my two children into classes. I have a 3rd grader and a 4th grader. I am NOT forced to enroll my children in classes that match their grades. I can enroll my 3rd grade child in the C++ programming class if I think that he can succeed in that class. So, how do I set up this enrollment? I have a couple of options that are floating around in my mind. The first option is to use the bootstrap accordian class (See OPTION 1 below). When a parent clicks on the "Fun with math" the list of their children are displayed as radio buttons. The parent can select either/or child. Both children /could/ be enrolled in the same first period if desired. Let's say that Mark is selected in the Math class. When the parent clicks on the "Spelling games" class, the same children list is displayed. If the parent selects Mark for this Spelling class, then the math class selection is cleared for Mark. So, Mark can only be enrolled in one class during First Period. As the parent moves on to Second Period, she can enroll her children just like she did during first period
Re: how to create a new table in existing app
On 31/07/2013 5:57pm, Mike Dewhirst wrote: I just defined a new many-to-many relationship in an existing table then manually defined the many-to-many table model. Unfortunately, syncdb didn't/wouldn't create the table for me. No errors, just no table! Is there a trick to it? Yes. Just needed a "through" mention and syncdb worked. Was able to to remove it later without consequences. Is South the answer? -- 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. For more options, visit https://groups.google.com/groups/opt_out.
Remote Authentication and Session Management
I'm using Django to build a *frontend* application which will fetch data from a remote (RESTful, for the matter) API for presentation to users that can authenticate within the API. This API will, upon every successful login, output a *cookie* which I will need to use in further requests, and to this *cookie* will correspond a given (session) timeout (so that I will need to login again within the API to generate a new *cookie*). I was advised to stay away from storing usernames and passwords myself on the * frontend* side of the matters, so now I need to figure out how can I store this *cookie* upon and associate it with a *browser* session so that I can know if a given user is "authenticated" in view code. How do I go about accomplishing this? -- 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. For more options, visit https://groups.google.com/groups/opt_out.
Re: Learning how to build a web site for my python games and a blog
These are definitely good suggestions for going deeper in Python and C. I am not real confident that the poll tutorial and vagrant are going to work for me though since my current sticking point is getting the NAME fielod to point to mydb. It does something funny with the r hat which may be connected to my Xubunto being installed side by side with XP. On Wednesday, July 31, 2013 5:22:52 AM UTC-5, Cal Leeming [Simplicity Media Ltd] wrote: > > Try this; > > http://learnpythonthehardway.org/book/next.html > http://gettingstartedwithdjango.com/ > > Cal > > On Tue, Jul 30, 2013 at 3:07 PM, Randy Baxley > > > wrote: > >> I am trying to learn Django. I have a good base in Python having worked >> several basic MOOCs and second level classes. My major short term goal is >> to build a web site where I will have a blog on smoked brisket in Chicago >> and a place to rewrite my games built in the Rice University course >> Interactive Python Programming from Coursera. Here is the final program >> from that class. The reason for a rewrite is these are written on >> CodeSkulptor. >> >> http://www.codeskulptor.org/#user16_nkeTb6O5Je_12.py >> >> Here you will find The Django Book written by *Adrian Holovaty who wrote >> Django.* >> * >> * >> http://www.djangobook.com/en/2.0/frontmatter.html >> >> What I am wondering is if anyone else is working through it as well as I >> keep hitting road blocks and the answers I am getting here are not working >> for me in Xumbunto though that may not be the problem. I have found that a >> group of folks working at the same time tend to hit on ideas in a fashion >> that is more to the point and on fb that it is easy to get back to the >> thread you want since there are not as many threads pertaining to other >> Django topics. >> >> I was also asking if there is another Django tutorial that might be at >> more of a beginner level? >> >> On Saturday, July 27, 2013 8:57:45 AM UTC-5, Randy Baxley wrote: >>> >>> Is anyone working through The Django Book that would like to form a fb >>> page just for that or knows of a good tutorial where questions will get >>> answers? >>> >> -- >> 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. >> 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. For more options, visit https://groups.google.com/groups/opt_out.
Re: Remote Authentication and Session Management
Is this an inactivity timeout? If so, you could perform an interaction with the back end every time the user interacts with you, even if the user's interaction doesn't require it, thereby extending the timeout just as though the user was working directly. Just performing an interaction periodicly to extend the timeout, despite the lack of a user interaction, would be circumventing the back end's security policy, not to be done lightly. But accepting AJAX indications that the user is actively paging through the data (detecting scrolling in JavaScript, for example, or responding to a popup that says timeout is coming) as a reason to perform a timeout extending interaction probably doesn't violate the back end's policy. If, instead, the timeout happens whether or not there has been recent interaction, then it would be best to consider frequent re-authentication to be the back end's policy, and pass that burden on to the user. As far as managing the back end cookie goes, store it on the user's session object. Update it when it changes )or when it is handed to you, whether or not it differs, the change is low cost). There is no need to send it on to the user's browser, which already gets the Django session key. See: https://docs.djangoproject.com/en/dev/topics/http/sessions/ On Wed, Jul 31, 2013 at 8:29 AM, wrote: > I'm using Django to build a *frontend* application which will fetch data > from a remote (RESTful, for the matter) API for presentation to users that > can authenticate within the API. This API will, upon every successful > login, output a *cookie* which I will need to use in further requests, > and to this *cookie* will correspond a given (session) timeout (so that I > will need to login again within the API to generate a new *cookie*). I > was advised to stay away from storing usernames and passwords myself on the > *frontend* side of the matters, so now I need to figure out how can I > store this *cookie* upon and associate it with a *browser* session so > that I can know if a given user is "authenticated" in view code. How do I > go about accomplishing this? > > -- > 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. > 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. For more options, visit https://groups.google.com/groups/opt_out.
How to profile Django App?
I have a web page that is loading very slow. It uses a Javascript tree grid component - data loaded via XML - XML generated by LXML - Django view - Django ORM - MYSQL DB. I need to find out where is the performance bottleneck. It could be one or more of the above components. What are the best tools - Free or Commercial which can help me profile this whole path? -- 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. For more options, visit https://groups.google.com/groups/opt_out.
Re: pdf conversion error
2013/7/29 Harjot Mann : > I am trying to convert the html templates in my project from localhost > using wkhtltopdf. I used weasyprint and a script also but the getting > the same errror from all. It creates the pdf but inside this is > written: > Not Found > The requested URL /accounts/login/ was not found on this server. > Apache/2.2.22 (Ubuntu) Server at localhost Port 80 > > What is its solution?? > You probably have in your view the decorator 'login_required' and you have defined de correct url of login whit LOGIN_URL in your settings. -- 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. For more options, visit https://groups.google.com/groups/opt_out.
Re: pdf conversion error
*haven't defined 2013/7/31 Charly Román : > 2013/7/29 Harjot Mann : >> I am trying to convert the html templates in my project from localhost >> using wkhtltopdf. I used weasyprint and a script also but the getting >> the same errror from all. It creates the pdf but inside this is >> written: >> Not Found >> The requested URL /accounts/login/ was not found on this server. >> Apache/2.2.22 (Ubuntu) Server at localhost Port 80 >> >> What is its solution?? >> > > You probably have in your view the decorator 'login_required' and you > have defined de correct url of login whit LOGIN_URL in your settings. -- 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. For more options, visit https://groups.google.com/groups/opt_out.
django jquery
Hi, Can any one please suggest good book or tutorials if possible regarding django and ajax (jquiry). I looked at one book "Django JavaScript Integration AJAX and jQuery", but it was very confusing and outdated as well, didn't help much.Please suggest tutorials or books with latest version. Would be very thankful. Thank you. -- 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. For more options, visit https://groups.google.com/groups/opt_out.
Re: pdf conversion error
On Wed, Jul 31, 2013 at 9:23 PM, Charly Román wrote: > You probably have in your view the decorator 'login_required' and you > have defined de correct url of login whit LOGIN_URL in your settings. Yeah..it was the problem. Thanks for your help but I already solved it yesterday. Now its working fine. Thanks once again :) -- Harjot Kaur Mann Blog: http://harjotmann.wordpress.com/ -- 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. For more options, visit https://groups.google.com/groups/opt_out.
Re: django jquery
You've posed a pretty open-ended question. Are you looking to provide an API using Django that then a client communicates with via Ajax using jQuery? Or are you interested in, say, using jQuery to manipulate the UI generated by Django templates? If you can be more specific in your goals, more direction can provided. Jonathan On Wed, Jul 31, 2013 at 10:14 AM, Robin Lery wrote: > Hi, > Can any one please suggest good book or tutorials if possible regarding > django and ajax (jquiry). I looked at one book "Django JavaScript > Integration AJAX and jQuery", but it was very confusing and outdated as > well, didn't help much.Please suggest tutorials or books with latest > version. Would be very thankful. > > Thank you. > > -- > 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. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- Jonathan D. Baker Developer http://jonathandbaker.com -- 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. For more options, visit https://groups.google.com/groups/opt_out.
Re: Impossible? Django with NTLM SSO auth on windows?
On Sun, Jul 7, 2013 at 5:01 PM, Yves Rausch wrote: > Hello guys, > > we had a similar issue and created a new module on apache 2.4 where you > can use ntlm authentication on a windows machine. > Here is the binary download and some information (including a link to > github repository): http://www.informer.de/produkte/apache-sspi-ntlm/ > Hope this helps. > Excellent news! Congratulations on the achievement and thank you so much for sharing this with us! Best wishes, AT -- 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. For more options, visit https://groups.google.com/groups/opt_out.
Re: django jquery
I was thinking about client communication via ajax and jquery, but also interested in jquery ui. I am a django noob and also with ajax. So its very confusing for me how to integrate these two. Can you please advice where to start? Thank you. On Wed, Jul 31, 2013 at 9:54 PM, Jonathan Baker < jonathandavidba...@gmail.com> wrote: > You've posed a pretty open-ended question. Are you looking to provide an > API using Django that then a client communicates with via Ajax using > jQuery? Or are you interested in, say, using jQuery to manipulate the UI > generated by Django templates? If you can be more specific in your goals, > more direction can provided. > > Jonathan > > > On Wed, Jul 31, 2013 at 10:14 AM, Robin Lery wrote: > >> Hi, >> Can any one please suggest good book or tutorials if possible regarding >> django and ajax (jquiry). I looked at one book "Django JavaScript >> Integration AJAX and jQuery", but it was very confusing and outdated as >> well, didn't help much.Please suggest tutorials or books with latest >> version. Would be very thankful. >> >> Thank you. >> >> -- >> 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. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > > > > -- > Jonathan D. Baker > Developer > http://jonathandbaker.com > > -- > 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. > 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. For more options, visit https://groups.google.com/groups/opt_out.
Re: Using standard Django admin User forms for Custom User model?
On Wed, Jul 31, 2013 at 12:36 PM, Victor Hooi wrote: > Hi, > > When you add a Django User through the admin, it presents you with a > initial screen to enter a username and password (/admin/auth/user/add/), > and then handles hashing for you. > > Also, when you go to edit a User, it gives you a Change Password form > (e.g. /admin/auth/user/2/password/) > > I'm using a custom user model in my Django app, by inheriting from > AbstractCustomer. > > If I add this to the admin now, password is just a standard textbox, and > obviously if I create a user through that, I can't login since I assume > it's not hashing the password. > > Is there any way I can use the normal Django User admin forms with a > custom User model? > > Secondly, I tried creating a user via the create_user() method on my > custom User object - I still wasn't able to login to the admin using that > username/password, which I thought was weird. > Have you read the documentation on this issue? https://docs.djangoproject.com/en/1.5/topics/auth/customizing/#custom-users-and-the-built-in-auth-forms The docs discuss what you have to do in order to get your User model represented in the admin, and also provide a worked example. If you've got a specific question that isn't covered by the docs, or if you're confused by what the docs say, let us know. Yours, Russ Magee %-) -- 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. For more options, visit https://groups.google.com/groups/opt_out.
Upgrading to 1.5 on Centos
On my Mac, running python 2.7, I upgraded from 1.4 to 1.5 by doing this: rm -rf /Library/Python/2.7/site-packages/django Followed by python setup.py install in the dir I untar-ed Django-1.5.1 to. This all worked fine. On a Centos system running python 2.6 I did: rm -rf /usr/lib/python2.6/site-packages/django followed by the setup.py install. My django app is working, and appears to be running 1.5, however anytime I use manage.py (for collectstatic or syncdb or test, for example) I get these messages: /usr/lib/python2.6/site-packages/django/core/management/__init__.py:465: DeprecationWarning: The 'execute_manager' function is deprecated, you likely need to update your 'manage.py'; please see the Django 1.4 release notes (https://docs.djangoproject.com/en/dev/releases/1.4/). DeprecationWarning) /usr/lib/python2.6/site-packages/django/core/management/__init__.py:409: DeprecationWarning: The 'setup_environ' function is deprecated, you likely need to update your 'manage.py'; please see the Django 1.4 release notes (https://docs.djangoproject.com/en/dev/releases/1.4/). DeprecationWarning) So it seems I still have some 1.4 stuff around. I don't get this on my Mac. How can I get rid of these messages? -- 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. For more options, visit https://groups.google.com/groups/opt_out.
Looking for the right way to specialize the User model
I'm using Django 1.5 and I needed an api to control the addition of users and the management of users on those groups. Django's rest framework proved a good starting point but I hit issues with the ManyToMany relation groups which means that there is no model for the user_group which in turn complicated the API. I worked around this fairly easily with the following code: from django.db import models from django.contrib.auth.models import User, UserManager, Group class UserGroup(models.Model): user = models.ForeignKey(User) group = models.ForeignKey(Group) class Meta: # auth_user_groups is created by the ManyToMany relation field # in the contrib.auth.models User model managed = False db_table = 'auth_user_groups' # Add an easy way to get at this from the User objects def get_user_groups(self): return UserGroup.objects.filter(user=self) User.add_to_class('get_user_groups', get_user_groups) This handles the problem by allowing the API to have convenient usergroup urls and endpoints but I don't like using 'add_to_class'. I really just want a specialized user class but I could not get the following to work: class APIUser(User): objects = UserManager() class Meta: managed = False db_table = 'auth_user' def get_user_groups(self): return UserGroup.objects.filter(user=self) Sadly, it fails with, for example, "Unknown column 'auth_user.user_ptr_id' in 'where clause'" if I try to save a newly created APIUser. Am I barking up the wrong tree or just missing something obvious? -- 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. For more options, visit https://groups.google.com/groups/opt_out.
Re: django1.5 pour rapidsms
can you post the traceback you are getting? On Wednesday, July 31, 2013 7:49:10 AM UTC-4, mimi89 wrote: > > depuis que j'ai rajouté l'application rapidsms-xforms à rapidsms, celui-ci > ne marche plus car la version de ce dernier est Django1.5 et que pour > rapidsms c'est un ancienne version! > Les tags donnent un messages d'erreurs! > Si quelqu'un peut m'aider!!! > > -- 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. For more options, visit https://groups.google.com/groups/opt_out.