Replicate admin format in django template
Hi I have a column which is a TextField. When we look at django admin it appears as a box. models.py add_detail = models.TextField() Let say you write the following text in that add_detail textbox in django admin :- Mission Impossible 4 Actor : Tom cruise I am displaying this add_detail in template in the following way:- {{add_detial}} I have to display it in a box with proper alignment so i am using it in a table format. Now when you look at the template It will appear like this:- Mission Impossible 4 Actor : Tom cruise What i want is the way it is saved in admin add_detail field in whatever manner whether he gave whitespaces,breaks,press return it should appear exactly the same in html. How can i achieve this ? Regards Nikhil Verma -- Regards Nikhil Verma +91-958-273-3156 -- 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.
Removing Save functionality from Admin
Hi, I have a model called Photos, I would like to remove the save button and functionality from the admin area for photos model. Is it possible? Thanks and Regards, Swaroop Shankar V -- 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: Replicate admin format in django template
You need to convert the new lines to html code there are 2 templatetags for doing so: https://docs.djangoproject.com/en/1.3/ref/templates/builtins/#linebreaks On 12.01.2012 09:54, Nikhil Verma wrote: Hi I have a column which is a TextField. When we look at django admin it appears as a box. models.py add_detail = models.TextField() Let say you write the following text in that add_detail textbox in django admin :- Mission Impossible 4 Actor : Tom cruise I am displaying this add_detail in template in the following way:- {{add_detial}} I have to display it in a box with proper alignment so i am using it in a table format. Now when you look at the template It will appear like this:- Mission Impossible 4 Actor : Tom cruise What i want is the way it is saved in admin add_detail field in whatever manner whether he gave whitespaces,breaks,press return it should appear exactly the same in html. How can i achieve this ? Regards Nikhil Verma -- Regards Nikhil Verma +91-958-273-3156 -- 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. -- 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.
Staging (dev,test,prod) in django
Hi, in my environment there are three stages: dev, test, prod. Every stage has its own linux user, and all three stages can live on different hosts. The application is installed in $HOME of a user with this name schema: proj_customer_S (S is d=dev q=qualtitytest p=prod) There are some custom scripts to: - Compare database tables and source code between dev--test and test--prod - Push/Pull source code from one stage to the next. I want to get rid of these custom scripts, and use open source application. There are some tools: For example Chef, Puppet but they are for cloud solutions. Looks too big for me. Fabric: could be used to implement "diff files" and "diff database-table". How do you handle staging? - Deploy the source code and static files - diff files between stages - diff database tables. Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de -- 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.
how to change column name in many2many relations?
Is it possible to change the column name in many2many relations? I can change in in foreignKeys with the db_column attribute. I can change the table name in many2many relations with db_table. What about column names in many2many relations? Thanks, E. -- 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.
"Current" timezone in admin
Hi, With 1.4 timezone support I was wondering if/how django admin supports the current user's timezone. There's no corresponding HTTP header like "Accept-Language" so I guess the timezone must be set in the session (looked up from a profile or whatever). Is there a hook that allows the "current" timezone to be set for admin, so that it uses it for datetime display/submission? Maybe a middleware that expects a session variable configured/named in settings? With full timezone support I also think it may be worth adding timezone to the standard User model, with a default None that falls back to settings.TIME_ZONE Cheers, Danny -- 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: Help me with django Form
On Thursday, 12 January 2012 01:49:40 UTC, coded kid wrote: > > Hi guys, I’ve been trying to signup using the django form I created. > Whenever I signup, the form is always saving the id no and not other > fields like names, username.pasword,email etc. Below are the codes; > In views.py: > from django.shortcuts import render_to_response > from django.http import HttpResponse > from django.template import RequestContext > from django.http import HttpResponseRedirect > from mymeek.meekme import models > from django.views.decorators.csrf import csrf_exempt > @csrf_exempt > def welcome(request): > #Allow new user reg and login, if failed direct the user to signup > if request.method=='POST': > form=models.Register() > new_user=form.save() > return HttpResponseRedirect('/logpage/') > else: > form=models.Register() > return render_to_response('mainpage.html', > {'form':models.Register}) > You haven't defined a form. Just calling a model instance "form" doesn't make it one. Plus, of course, at no point are you passing the POST values into the instantiation. See https://docs.djangoproject.com/en/1.3/topics/forms/modelforms/ for modelforms, and https://docs.djangoproject.com/en/1.3/topics/forms/#using-a-form-in-a-view for the general pattern of how to instantiate a form from the POST. -- DR. -- 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/-/K8AJc--LKqIJ. 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: how to change column name in many2many relations?
I have solved by defining the model of the relation with a "through" attribute. A little lenghty but effective... E. On Jan 12, 11:01 am, "?manu*" wrote: > Is it possible to change the column name in many2many relations? > > I can change in in foreignKeys with the db_column attribute. I can > change the table name in many2many relations with db_table. What about > column names in many2many relations? > > Thanks, > E. -- 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: how to change column name in many2many relations?
https://docs.djangoproject.com/en/1.3/topics/db/models/#verbose-field-names set a readable name for column, or you want to refer other database table column ? sorry, but i have the urge to ask. why we should do that? thanks On 12 January 2012 18:36, ?manu* wrote: > I have solved by defining the model of the relation with a "through" > attribute. A little lenghty but effective... > > E. > > On Jan 12, 11:01 am, "?manu*" wrote: > > Is it possible to change the column name in many2many relations? > > > > I can change in in foreignKeys with the db_column attribute. I can > > change the table name in many2many relations with db_table. What about > > column names in many2many relations? > > > > Thanks, > > E. > > -- > 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. > > -- 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: not sure how to unpack a list within a tuple within another list inside the template
On Wednesday, 11 January 2012 21:33:48 UTC, somecallitblues wrote: > > Hi Djangoers, > > I have a default dict variable final_d = defaultdict(list) that looks like > this: > > [(order1, [customer2, customer1]), (order2, [customer3, customer5, > customer6]) ] > > I've tried everything possible inside the template and I can't unpack this > thing. I'm passing final_d to the template inside the dictionary like > this: d = {'final_d':final_d} > > This is my template which should I think work from what I've read on SO > and elsewhere: > > > {% for order, customers in final_d %} > > > {{ ordder.name }} > Cusotmers > > {% for customer in customers %} > {{ > customer.name }} > {% endfor %} > > > {% endfor %} > > > I have tried absolutely everything and I can't get this to render. > > The above code doesn't render a result. if I change {% for order, > customers in final_d %} to {% for order in final_d %} I do get the order > details, but I can't access customer details. > > Thank you for your help! > > -m > A defaultdict operates just like a normal dict in that iterating over it just returns the keys. Usually you would do {% for order, customers in final_d.items %} to iterate over both keys and values. However I'm confused by your initial description. What you show is not a dict at all, but a list of 2-tuples (each containing a string and a list). Is that a single value of the dict, or what? -- DR. -- 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/-/WIowdkQrZGoJ. 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: not sure how to unpack a list within a tuple within another list inside the template
On 2012-01-11, at 22:33 , Mario Gudelj wrote: > Hi Djangoers, > > I have a default dict variable final_d = defaultdict(list) that looks like > this: > > [(order1, [customer2, customer1]), (order2, [customer3, customer5, > customer6]) ] DefaultDicts are dicts, when you iterate over dicts directly you iterate over their keys not pairs of (key, value). So your dict does not look like this, it looks like this: {order1: [customer2, customer1], order2: [customer3, customer5, customer6]} and there is no way iterating over it will yield anything but its keys Either use `dict.iteritems()` to iterate over (key, value) pairs or iterate over it and then dereference the values corresponding to each key. -- 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.
Announcement: django-geoshortcuts - GeoJSON and GPX shortcuts for GeoDjango apps
Hi, we have created small Django application package for serving some GIS geospatial formats from Django queryset data. Currently supported formats are GeoJSON and GPS via 'render_to_geojson' and 'render_to_gpx shortcuts'. If You are interested, please have a look here [1]. Comments, patches and whatever else is welcome. [1] - https://github.com/gista/django-geoshortcuts Ivan Mincik, Gista s.r.o. -- 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: not sure how to unpack a list within a tuple within another list inside the template
On 2012-01-12, at 11:47 , Daniel Roseman wrote: > However I'm confused by your initial description. What you show is not a > dict at all, but a list of 2-tuples (each containing a string and a list). > Is that a single value of the dict, or what? I'm guessing it's the initialization vector for the dict, though I'm not sure why he used this for a non-ordered dict. >>> dict([(1, [2, 3]), (5, [6, 7, 8])]) {1: [2, 3], 5: [6, 7, 8]} >>> collections.defaultdict(lambda: [], [(1, [2, 3]), (5, [6, 7, 8])]) defaultdict( at 0x1004ce488>, {1: [2, 3], 5: [6, 7, 8]}) -- 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.
restricting choices of foreign key to objects owned by user
hi note: this is in admin. I have a model called Child. Child has foreign key to Project. There are many projects, but each user is only allowed to add a child to the projects he belongs to. I have restricted the ProjectAdmin queryset so that the user can only see his projects in the project changelist. But when the user goes to add/edit a child, the dropdown shows *all* projects and not only the projects he belongs to. Any clues on how to achieve this? -- regards Kenneth Gonsalves -- 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: A demo of django-inlinetrans and django-inplaceedit
2012/1/11 Juergen Schackmann > Hi, > this looks really great. > Thanks > I have 3 questions for which I would highly appreciate the answers: > > I hope have three answers > 1. What is the best way to include some form magic, i.e. sending the > changes not directly to the model but to a form that does some verification > and also return the form error messages? > The value is does not send to the directly to the model. Django-inplace-edit does verification, if you need a special verification you can create an adaptor and overwrite the method "get_form", this returns a specify form with a clean method. See this: http://pypi.python.org/pypi/django-inplaceedit#adaptor-api Or this extension: https://github.com/goinnn/django-inplaceedit-extra-fields/blob/master/inplaceeditform_extra_fields/fields.py > 2. If I do not want to send field by field, but possibly a set of fields > back to the to the server, like the row of a table. Would that be feasible? > Now this is not implemented, and I think it is not trivial. But you can try it 3. How would you create a new field on the page/ new object in the model? > I'm sorry I don't understand this > > Keep up the great work > Thnx > Juergen > > -- > 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/-/rR9BqMnZhEsJ. > > 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. > -- 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: Does anyone know any blogs that write about how to quickly install and deploy a django application on Amazon EC2?
No offense to the author, but I would advise ignoring that blog for the following reasons: # author admits he is a non-sysadmin noob # he installs everything globally rather than using virtualenv # he uses apache instead of... well... anything else # there does not appear to be anything in there that is specific to ec2 Bonus reason: # he uses mysql instead of postgres In fact there really isn't much of a difference between installing/ deploying to ec2 compared to installing anywhere else, so any good article you find on django deployment will work on ec2. Where this does not hold true is if you are looking to create the node and deploy your app all in one step. In this case you will want to use something like chef (or puppet I assume, though I have only used chef). Be forewarned that it gets quite deep in terms of mastering all the concepts. http://wiki.opscode.com/display/chef/Build+a+Django+Stack I reckon you could also do something like that, perhaps a bit more crudely, with shell scripts and fabric. I haven't seen any good examples of that though. --Stuart -- 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.
Primary key for read-only models
I need to read data from an "external" database table from my django project. I am not interested in modifying the data, only reading it. Of course I would like to create a django model for the table, because it makes life so much more easier. I have already done this previously, however in this case the table has a multiple field primary key, unsupported by Django. There is no other field which is guaranteed to be unique that I can use as primary key in the Django model. Do I need to worry about this? or can I just slap the primary_key flag on any of the fields, since I will never be inserting or updating in that table? -- 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: Does anyone know any blogs that write about how to quickly install and deploy a django application on Amazon EC2?
On Thu, Jan 12, 2012 at 9:54 AM, Stuart Laughlin wrote: > # author admits he is a non-sysadmin noob ad-hominem > # he installs everything globally rather than using virtualenv on single-purpose servers it's not so important. still good practice, but not mandatory. > # he uses apache instead of... well... anything else well-tuned apache and mod_wsgi is on the same league as the cool boys. (i still prefer nginx, and i don't think this is a good example of apache tuning, but nothing bad about it) > # there does not appear to be anything in there that is specific to > ec2 point conceded, but lots of people will look for EC2 instructions, even if it's just "just like any old server" > Bonus reason: > # he uses mysql instead of postgres again, might not be the bestest choice but nowhere near a bad one. -- Javier -- 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: Primary key for read-only models
On Thu, Jan 12, 2012 at 10:03 AM, Demetrio Girardi wrote: > I have already done this previously, however in this case the table > has a multiple field primary key, unsupported by Django. There is no > other field which is guaranteed to be unique that I can use as primary > key in the Django model. > > Do I need to worry about this? or can I just slap the primary_key flag > on any of the fields, since I will never be inserting or updating in > that table? maybe since it's read-only you could create a view with a field that concatenates the parts of the composite key -- Javier -- 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: Primary key for read-only models
Had recently kinda the same just that I have 2 tables without a primary key at all and I just declared one of the fields as primary key and works fine. On 12.01.2012 16:03, Demetrio Girardi wrote: I need to read data from an "external" database table from my django project. I am not interested in modifying the data, only reading it. Of course I would like to create a django model for the table, because it makes life so much more easier. I have already done this previously, however in this case the table has a multiple field primary key, unsupported by Django. There is no other field which is guaranteed to be unique that I can use as primary key in the Django model. Do I need to worry about this? or can I just slap the primary_key flag on any of the fields, since I will never be inserting or updating in that table? -- 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: Removing Save functionality from Admin
Hi All, I guess the question was not clear and am sorry for that. I have a model by the name Photos. I have enabled the admin section for this model. I don't want the admin to create any entries for this models from the admin area, so i need to remove the 'Add Photos' button on top of the Photos listing page. How can it be done? Hope my question is much more clear now. Thanks Regards, Swaroop Shankar V On Thu, Jan 12, 2012 at 2:53 PM, Swaroop Shankar V wrote: > Hi, > > I have a model called Photos, I would like to remove the save button and > functionality from the admin area for photos model. Is it possible? > > Thanks and Regards, > > Swaroop Shankar V > > -- 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: Removing Save functionality from Admin
You can rewrite the *has_add_permission* method of your admin class and return False. More info here: https://docs.djangoproject.com/en/1.3/ref/contrib/admin/#django.contrib.admin.ModelAdmin. has_add_permission On Thu, Jan 12, 2012 at 5:51 PM, Swaroop Shankar V wrote: > Hi All, > I guess the question was not clear and am sorry for that. I have a model > by the name Photos. I have enabled the admin section for this model. > I don't want the admin to create any entries for this models from the admin > area, so i need to remove the 'Add Photos' button on top of the Photos > listing page. How can it be done? Hope my question is much more clear now. > Thanks > > Regards, > > Swaroop Shankar V > > > > > On Thu, Jan 12, 2012 at 2:53 PM, Swaroop Shankar V wrote: > >> Hi, >> >> I have a model called Photos, I would like to remove the save button and >> functionality from the admin area for photos model. Is it possible? >> >> Thanks and Regards, >> >> Swaroop Shankar V >> >> > -- > 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. > -- This e-mail and any file transmitted with it is intended only for the person or entity to which is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. Copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you are not the intended recipient, please notify the sender immediately by return e-mail, delete this communication and destroy all copies. -- 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: Need to examine and act on old vs. new at .save() time
On Jan 11, 9:23 pm, Dennis Lee Bieber wrote: > On Wed, 11 Jan 2012 17:26:44 +, Tom Evans > wrote: > > >On Wed, Jan 11, 2012 at 5:22 PM, Jeff wrote: > >> When Device.netgroups (a M2M field) changes, we need to perform > >> some python-ldap operations. > > >Have you considered simply going back to the database to check what > >the values currently are? It would be inefficient, but clean and > >concise. > > I've forgotten how many means of changing this data there are, > but... Dennis, Several. A web-only solution won't work. I found the 'm2m_changed' signal yesterday, read that you can't determine *what* changed by using it, and also ended up directed to some open bug reports... etc... and threw up my hands. To the best of my digging, there is no way to accurately tell in SomeModel.save() whether the previous value of MyM2MField and the new value are the same, and/or what the differences are. I ended up completely restructuring stuff (I'll spare you the details) so that I can just say "whatever .netgroups looks like AFTER save, make LDAP look exactly like that." This is essentially what Tom Evans suggested in his reply. It's inefficient, and clearly a workaround, but is at least doable. It boils down in LDAP-terms to saying "replace all attribute values for X with the following full data. I don't care what your old data was." ... instead of saying, "remove value Y from the 1000 values set on X" :| Thank you all for your efforts to 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. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Need to examine and act on old vs. new at .save() time
The only other way that I could think to do it would be to write your own M2M object. Just an object with two foreign key fields to reference X and Y. In that object you could overwrite the save method to check for which relations currently exist for a given reference to X and update accordingly. I'm not sure this would work for you, but it might be an alternative, although it violates the DRY principle. Furbee On Thu, Jan 12, 2012 at 9:20 AM, Jeff wrote: > > On Jan 11, 9:23 pm, Dennis Lee Bieber wrote: > > On Wed, 11 Jan 2012 17:26:44 +, Tom Evans > > wrote: > > > > >On Wed, Jan 11, 2012 at 5:22 PM, Jeff wrote: > > >> When Device.netgroups (a M2M field) changes, we need to perform > > >> some python-ldap operations. > > > > >Have you considered simply going back to the database to check what > > >the values currently are? It would be inefficient, but clean and > > >concise. > > > > I've forgotten how many means of changing this data there are, > > but... > > Dennis, > > Several. > > A web-only solution won't work. > > I found the 'm2m_changed' signal yesterday, read that you can't > determine *what* changed by using it, and also ended up directed > to some open bug reports... etc... and threw up my hands. > > To the best of my digging, there is no way to accurately tell > in SomeModel.save() whether the previous value of MyM2MField > and the new value are the same, and/or what the differences > are. > > I ended up completely restructuring stuff (I'll spare you the > details) so that I can just say "whatever .netgroups looks > like AFTER save, make LDAP look exactly like that." This > is essentially what Tom Evans suggested in his reply. It's > inefficient, and clearly a workaround, but is at least doable. > > It boils down in LDAP-terms to saying "replace all attribute > values for X with the following full data. I don't care what > your old data was." ... instead of saying, "remove value Y > from the 1000 values set on X" :| > > Thank you all for your efforts to 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. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- 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.
reverse() with keyword argument driving me batty
Hi all, I'm running Django 1.3, and I can't get a simple reverse() with keywords to work. My urlconf has this: url(r'^results/text/(?P)/$', 'textresults', name='exporttextresults') My code does this: exporturl = reverse("exporttextresults", kwargs={"jobkey": returned_key}) And I get this error: *** NoReverseMatch: Reverse for 'exporttextresults' with arguments '()' and keyword arguments '{'jobkey': '40756766e8de9e0994536cf11773267d469c3a4ed77da53e89b8bc1de6c9'}' not found. What's the right calling sequence for a reverse to an URL with a keyword argument? Thanks, John -- 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: reverse() with keyword argument driving me batty
On Thu, Jan 12, 2012 at 9:50 AM, John DeRosa wrote: > url(r'^results/text/(?P)/$', 'textresults', > name='exporttextresults') One guess, you haven't specified what the (?P in your regex accepts. For example: (?P\w+) -- 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.
Social conference website?
Good morning, I am building up a social-conference website in Django for a university clubs' comedy-revue. I will open-source it under the two-clause BSD license. Features I would like to implement: • User accounts automatically generated on attendance registration • Ticket, Sponsor and paraphernalia sales through a PayPal gateway • Document collaboration area (built off askbot) for Writers I have seen a variety of Django-based conference websites. Which would you recommend I build off to ascertain the aforementioned features? Thanks for all suggestions, Alec Taylor -- 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: reverse() with keyword argument driving me batty
On Jan 12, 2012, at 10:18 AM, Andy McKay wrote: > On Thu, Jan 12, 2012 at 9:50 AM, John DeRosa wrote: >> url(r'^results/text/(?P)/$', 'textresults', >> name='exporttextresults') > > One guess, you haven't specified what the (?P in your regex accepts. > For example: > (?P\w+) > Gah! I am an imbecile! Now I know why Mozilla never hired me! Thanks!!! John -- 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: reverse() with keyword argument driving me batty
Your URLconf is broken. The (?P) regex fragment gives you a keyword argument of jobkey, but it only matches a zero length string. You need to include a regex to specify what you want jobkey to match. (?P[0-9a-fA-F]*) Cheers, Cliff On Thu, 2012-01-12 at 09:50 -0800, John DeRosa wrote: > Hi all, > > I'm running Django 1.3, and I can't get a simple reverse() with keywords to > work. > > My urlconf has this: > >url(r'^results/text/(?P)/$', 'textresults', > name='exporttextresults') > > My code does this > >exporturl = reverse("exporttextresults", kwargs={"jobkey": > returned_key}) > > And I get this error: > >*** NoReverseMatch: Reverse for 'exporttextresults' with arguments > '()' and keyword arguments '{'jobkey': > '40756766e8de9e0994536cf11773267d469c3a4ed77da53e89b8bc1de6c9'}' not > found. > > > What's the right calling sequence for a reverse to an URL with a keyword > argument? > > Thanks, > > John > -- 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: Removing Save functionality from Admin
Thanks Denis, that fixed the issue. One more question, is it possible to display an image in the edit form? I don't want the admin to upload any image but i want to display whatever image is uploaded on the edit form, is it possible? I googled but could not find any relevant results. Thanks Regards, Swaroop Shankar V On Thu, Jan 12, 2012 at 10:34 PM, Denis Darii wrote: > You can rewrite the *has_add_permission* method of your admin class and > return False. > More info here: > https://docs.djangoproject.com/en/1.3/ref/contrib/admin/#django.contrib.admin.ModelAdmin. > has_add_permission > > On Thu, Jan 12, 2012 at 5:51 PM, Swaroop Shankar V wrote: > >> Hi All, >> I guess the question was not clear and am sorry for that. I have a model >> by the name Photos. I have enabled the admin section for this model. >> I don't want the admin to create any entries for this models from the admin >> area, so i need to remove the 'Add Photos' button on top of the Photos >> listing page. How can it be done? Hope my question is much more clear now. >> Thanks >> >> Regards, >> >> Swaroop Shankar V >> >> >> >> >> On Thu, Jan 12, 2012 at 2:53 PM, Swaroop Shankar V >> wrote: >> >>> Hi, >>> >>> I have a model called Photos, I would like to remove the save button and >>> functionality from the admin area for photos model. Is it possible? >>> >>> Thanks and Regards, >>> >>> Swaroop Shankar V >>> >>> >> -- >> 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. >> > > > > -- > This e-mail and any file transmitted with it is intended only for the > person or entity to which is addressed and may contain information that is > privileged, confidential or otherwise protected from disclosure. Copying, > dissemination or use of this e-mail or the information herein by anyone > other than the intended recipient is prohibited. If you are not the > intended recipient, please notify the sender immediately by return e-mail, > delete this communication and destroy all copies. > > -- > 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. > -- 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.
admin properties and short_description
Hi, is there a way how to pass a short_description to a property? I have: @property def extend_types(self): return cjson.decode(self.extend_types_data) #extend_types.short_description = 'Something better' with the code uncommented I get: AttributeError: 'property' object has no attribute 'short_description' -- 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: A demo of django-inlinetrans and django-inplaceedit
> > > >> 2. If I do not want to send field by field, but possibly a set of fields >> back to the to the server, like the row of a table. Would that be feasible? >> > > Now this is not implemented, and I think it is not trivial. But you can > try it > i am afraid my js skills are too limited for that :-( > > 3. How would you create a new field on the page/ new object in the model? >> > > I'm sorry I don't understand this > let me explain with an example: i have an recipe model and i have ingredients that have a foreign key to recipe. on the web page i display the recipe plus all its ingredients. and with inplaceedit i can edit all those ingredients, which is great. but how would i enable the user to add a new ingredient? -- 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/-/Ie3c77e-ynEJ. 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: Social conference website?
There's https://github.com/pinax/symposion but i'm not sure what you mean by "social". On Thursday, January 12, 2012 at 1:18 PM, Alec Taylor wrote: > Good morning, > > I am building up a social-conference website in Django for a > university clubs' comedy-revue. > > I will open-source it under the two-clause BSD license. > > Features I would like to implement: > • User accounts automatically generated on attendance registration > • Ticket, Sponsor and paraphernalia sales through a PayPal gateway > • Document collaboration area (built off askbot) for Writers > > I have seen a variety of Django-based conference websites. Which would > you recommend I build off to ascertain the aforementioned features? > > Thanks for all suggestions, > > Alec Taylor > > -- > 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 > (mailto:django-users@googlegroups.com). > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com > (mailto:django-users+unsubscr...@googlegroups.com). > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- 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: Class-Based Generic Views (CreateView) - field exclusions and defaults
can really no one help? i am really stuck here at the moment -- 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/-/RYLQqxJE7HYJ. 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: not sure how to unpack a list within a tuple within another list inside the template
Mario, While there are syntaxes for doing this sort of thing in the template language, I would expect the template to start looking messy, and be hard to maintain. May I suggest that you wrap this stuff in a class to provide attribute like access to the data that you need? This puts the access logic in python, and makes the template code more transparent. Bill -- 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: Staging (dev,test,prod) in django
On 12/01/2012 8:55pm, Thomas Guettler wrote: Hi, How do you handle staging? - Deploy the source code and static files dev (winXP) commit to svn (linux) svn wakes up buildbot (same linux) buildbot wipes out the test site (same linux) buildbot rebuilds the test site (including collectstatic) and runs tests buildbot emails the dev team with results including link to logged i/o from the rebuild and the tests - diff files between stages svn - diff database tables. My project is a prototype at this point and I use PostgreSQL on the dev machine for both dev and testing. Both winXP and linux machines are on the same network. When I need separate databases I'll start using fixtures and dump/reload for both dev and test sites. At the moment I'm dropping and syncdb'ing tables but I'll use South as soon as the database has settled down. I'm not ready to move code into production but I think that will be much more a manual process managed by a sysadmin after I document what I what I want done. Mike Thomas -- 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: not sure how to unpack a list within a tuple within another list inside the template
Thanks for your help guys. I ended up creating a class for for orders and customers class and then I passed those objects to the tepmlate inside a dict. That worked. Cheers, On 12 January 2012 21:55, Masklinn wrote: > On 2012-01-12, at 11:47 , Daniel Roseman wrote: > > However I'm confused by your initial description. What you show is not a > > dict at all, but a list of 2-tuples (each containing a string and a > list). > > Is that a single value of the dict, or what? > > I'm guessing it's the initialization vector for the dict, though I'm not > sure why he used this for a non-ordered dict. > >>>> dict([(1, [2, 3]), (5, [6, 7, 8])]) >{1: [2, 3], 5: [6, 7, 8]} >>>> collections.defaultdict(lambda: [], [(1, [2, 3]), (5, [6, 7, 8])]) >defaultdict( at 0x1004ce488>, {1: [2, 3], 5: [6, 7, > 8]}) > > > -- > 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. > > -- 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: Class-Based Generic Views (CreateView) - field exclusions and defaults
What are you triying to achieve? 2012/1/12 Juergen Schackmann : > can really no one help? i am really stuck here at the moment > > -- > 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/-/RYLQqxJE7HYJ. > > 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. -- Andrés Reyes Monge armo...@gmail.com +(505)-8873-7217 -- 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: Class-Based Generic Views (CreateView) - field exclusions and defaults
I am trying to do the same as described in previous example: I have a model with a foreign key field to User and in the view I want to populate the the field from request.user. And when doing it exactly the way as Russ proposed, I get the described error. -- 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/-/_YvDz1bT9SkJ. 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: Class-Based Generic Views (CreateView) - field exclusions and defaults
On 11/01/12 20:54, Juergen Schackmann wrote: if is use this code, as proposed by russ: def form_valid(self, form): self.object.user = ... (something meaningful.. e.g., self.request.user) return super(CreateCampaignView, self).form_valid(form) i get the error 'NoneType' object has no attribute 'user'. and actually, by looking at the source code, that is exactly what is supposed to happen in a create view: self.object is set to None, as you can see in BaseCreateView def post(self, request, *args, **kwargs): self.object = None return super(BaseCreateView, self).post(request, *args, **kwargs) am i the only one having this problem? any help is highly appreciated. thanks juergen -- I agree that it looks like self.object is None, so you can't set self.object.user as Russ wrote. How about the following: def form_valid(self, form): form.instance.user = request.user return super(CreateCampaignView, self).form_valid(form) I haven't had a chance to test the code. I hope that it works, or at least leads you in the right direction! Regards, Alasdair -- Alasdair Nicol Developer, MEMSET mail: alasd...@memset.com web: http://www.memset.com/ Memset Ltd., registration number 4504980. 25 Frederick Sanger Road, Guildford, Surrey, GU2 7YD, UK. -- 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: Does anyone know any blogs that write about how to quickly install and deploy a django application on Amazon EC2?
On Thursday, January 12, 2012 10:09:13 AM UTC-6, Javier Guerra wrote: > > On Thu, Jan 12, 2012 at 9:54 AM, Stuart Laughlin > wrote: > > # author admits he is a non-sysadmin noob > > ad-hominem > False. I pointed out what the author clearly stipulates. "I’m a sys admin NOOB. I am also teaching myself to code. This is my first time setting up this stack so there are probably going to be some bugs/security issues I conveniently side stepped just to get it to work." "This is obviously not secure enough for a ‘production’ environment." If that's what you want to model your deployment after, be my guest. I hardly think it's fallacious of me to suggest someone do otherwise. > # he uses apache instead of... well... anything else > well-tuned apache and mod_wsgi is on the same league as the cool boys. > (i still prefer nginx, and i don't think this is a good example of > apache tuning, but nothing bad about it) > I don't care a whit about what "the cool boys" are doing. What I care about is a production deployment that works efficiently and reliably and that is diagnosable when something doesn't work. Apache fails those criteria; nginx and lighttpd pass (in my opinion and the opinion of many other developers who have used these technologies for non-trivial web applications in production environments). > > Bonus reason: > > > # he uses mysql instead of postgres > > again, might not be the bestest choice but nowhere near a bad one. > That's why I listed it as a bonus reason. Better than mssql and sqlite for a production deployment anyway, eh? --Stuart -- 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/-/ByBrEdUj8HUJ. 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: Does anyone know any blogs that write about how to quickly install and deploy a django application on Amazon EC2?
http://kencochrane.net/blog/2011/06/django-gunicorn-nginx-supervisord-fabric-centos55/ I would go there. It's not Amazon EC2 specific, but Amazon's distribution by default is a Centos-based one, so everything should be in the same place. Plus, he very helpfully gives you code you can use to get everything running quickly. The hardest thing is getting nginx running within the main initlevel, but even that is not hard, just tedious. This does not, however, tell you how to setup S3 storage to be Django's file backend. You'll have to look somewhere else for that On Thu, Jan 12, 2012 at 6:32 PM, Stuart Laughlin wrote: > > On Thursday, January 12, 2012 10:09:13 AM UTC-6, Javier Guerra wrote: > >> On Thu, Jan 12, 2012 at 9:54 AM, Stuart Laughlin >> wrote: >> > # author admits he is a non-sysadmin noob >> >> ad-hominem >> > False. I pointed out what the author clearly stipulates. > > "I’m a sys admin NOOB. I am also teaching myself to code. This is my first > time setting up this stack so there are probably going to be some > bugs/security issues I conveniently side stepped just to get it to work." > > "This is obviously not secure enough for a ‘production’ environment." > > If that's what you want to model your deployment after, be my guest. I > hardly think it's fallacious of me to suggest someone do otherwise. > > > > # he uses apache instead of... well... anything else > >> well-tuned apache and mod_wsgi is on the same league as the cool boys. >> (i still prefer nginx, and i don't think this is a good example of >> apache tuning, but nothing bad about it) >> > I don't care a whit about what "the cool boys" are doing. What I care > about is a production deployment that works efficiently and reliably and > that is diagnosable when something doesn't work. Apache fails those > criteria; nginx and lighttpd pass (in my opinion and the opinion of many > other developers who have used these technologies for non-trivial web > applications in production environments). > > >> > Bonus reason: >> >> > # he uses mysql instead of postgres >> >> again, might not be the bestest choice but nowhere near a bad one. >> > That's why I listed it as a bonus reason. Better than mssql and sqlite for > a production deployment anyway, eh? > > > --Stuart > > -- > 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/-/ByBrEdUj8HUJ. > > 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. > -- 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: Does anyone know any blogs that write about how to quickly install and deploy a django application on Amazon EC2?
I am partial to debian / ubuntu, so I use those rather than Amazon's default AMIs (see http://alestic.com/ ). Here are a few links that I have found particularly useful in the past, for various aspects of the deployment process... * http://www.saltycrane.com/blog/2009/05/notes-using-pip-and-virtualenv-django/ * http://www.saltycrane.com/blog/2010/10/how-install-pil-ubuntu/ * http://brandonkonkle.com/blog/2010/jun/25/provisioning-new-ubuntu-server-django/ Hope that helps, --Stuart On Thu, Jan 12, 2012 at 5:37 PM, Jeff Heard wrote: > http://kencochrane.net/blog/2011/06/django-gunicorn-nginx-supervisord-fabric-centos55/ > > I would go there. It's not Amazon EC2 specific, but Amazon's distribution > by default is a Centos-based one, so everything should be in the same place. > Plus, he very helpfully gives you code you can use to get everything > running quickly. The hardest thing is getting nginx running within the main > initlevel, but even that is not hard, just tedious. > > This does not, however, tell you how to setup S3 storage to be Django's file > backend. You'll have to look somewhere else for that > > > On Thu, Jan 12, 2012 at 6:32 PM, Stuart Laughlin > wrote: >> >> >> On Thursday, January 12, 2012 10:09:13 AM UTC-6, Javier Guerra wrote: >>> >>> On Thu, Jan 12, 2012 at 9:54 AM, Stuart Laughlin >>> wrote: >>> > # author admits he is a non-sysadmin noob >>> >>> ad-hominem >> >> False. I pointed out what the author clearly stipulates. >> >> "I’m a sys admin NOOB. I am also teaching myself to code. This is my first >> time setting up this stack so there are probably going to be some >> bugs/security issues I conveniently side stepped just to get it to work." >> >> "This is obviously not secure enough for a ‘production’ environment." >> >> If that's what you want to model your deployment after, be my guest. I >> hardly think it's fallacious of me to suggest someone do otherwise. >> >> >> > # he uses apache instead of... well... anything else >>> >>> well-tuned apache and mod_wsgi is on the same league as the cool boys. >>> (i still prefer nginx, and i don't think this is a good example of >>> apache tuning, but nothing bad about it) >> >> I don't care a whit about what "the cool boys" are doing. What I care >> about is a production deployment that works efficiently and reliably and >> that is diagnosable when something doesn't work. Apache fails those >> criteria; nginx and lighttpd pass (in my opinion and the opinion of many >> other developers who have used these technologies for non-trivial web >> applications in production environments). >> >>> >>> > Bonus reason: >>> >>> > # he uses mysql instead of postgres >>> >>> again, might not be the bestest choice but nowhere near a bad one. >> >> That's why I listed it as a bonus reason. Better than mssql and sqlite for >> a production deployment anyway, eh? >> >> >> --Stuart >> >> -- >> 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/-/ByBrEdUj8HUJ. >> >> 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. > > > -- > 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. -- 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/Data Base Advice
On Jan 5, 6:40 pm, Petite Abeille wrote: > On Jan 6, 2012, at 12:13 AM, Chris Kavanagh wrote: > > > I believe, thanks to your (previous) post, I was confused as to the > > difference between SQL and Database in general. I had thought learning > > SQL was learning database design. When in actuality, it's just the > > language used to access databases. I need to study database concepts > > and design. > > There are two main aspects to SQL: Data Definition Language (DDL [1]) and > Data Manipulation Language (DML [2]). > > DDL is was you design database with (create table, etc). DML is what you > interact database with (select, update, etc). > > In the same way as it's rather helpful to understand HTTP itself to build a > web application, it's rather essential to understand database design if you > build a database, irrespectively of sugar coating (ORM [3], MVC, and other > TLA). > > Learn about normalization [3]. > > Take a look at SQLite to get started [4][5]. > > In the meantime: > > Double-thinking in > SQLhttp://explainextended.com/2009/07/12/double-thinking-in-sql/ > > Also:http://browsertoolkit.com/fault-tolerance.png > > [1]http://en.wikipedia.org/wiki/Data_Definition_Language > [2]http://en.wikipedia.org/wiki/Data_Manipulation_Language > [3]http://en.wikipedia.org/wiki/Database_normalization > [4]http://www.sqlite.org/ > [5]http://www.sqlite.org/lang.html Thank you for the advice Petite. I will check out those links also. -- 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: Does anyone know any blogs that write about how to quickly install and deploy a django application on Amazon EC2?
http://www.synstorm.co.uk/2012/01/08/setting-up-django-on-a-free-amazon-ec2-instance/?utm_source=Python+Weekly+Newsletter&utm_campaign=337820f7f5-Python_Weekly_Issue_17_January_12_2012&utm_medium=email On 13 January 2012 10:44, Stuart Laughlin wrote: > I am partial to debian / ubuntu, so I use those rather than Amazon's > default AMIs (see http://alestic.com/ ). Here are a few links that I > have found particularly useful in the past, for various aspects of the > deployment process... > > * > http://www.saltycrane.com/blog/2009/05/notes-using-pip-and-virtualenv-django/ > * http://www.saltycrane.com/blog/2010/10/how-install-pil-ubuntu/ > * > http://brandonkonkle.com/blog/2010/jun/25/provisioning-new-ubuntu-server-django/ > > > Hope that helps, > > --Stuart > > On Thu, Jan 12, 2012 at 5:37 PM, Jeff Heard > wrote: > > > http://kencochrane.net/blog/2011/06/django-gunicorn-nginx-supervisord-fabric-centos55/ > > > > I would go there. It's not Amazon EC2 specific, but Amazon's > distribution > > by default is a Centos-based one, so everything should be in the same > place. > > Plus, he very helpfully gives you code you can use to get everything > > running quickly. The hardest thing is getting nginx running within the > main > > initlevel, but even that is not hard, just tedious. > > > > This does not, however, tell you how to setup S3 storage to be Django's > file > > backend. You'll have to look somewhere else for that > > > > > > On Thu, Jan 12, 2012 at 6:32 PM, Stuart Laughlin > > wrote: > >> > >> > >> On Thursday, January 12, 2012 10:09:13 AM UTC-6, Javier Guerra wrote: > >>> > >>> On Thu, Jan 12, 2012 at 9:54 AM, Stuart Laughlin < > stu...@bistrotech.net> > >>> wrote: > >>> > # author admits he is a non-sysadmin noob > >>> > >>> ad-hominem > >> > >> False. I pointed out what the author clearly stipulates. > >> > >> "I’m a sys admin NOOB. I am also teaching myself to code. This is my > first > >> time setting up this stack so there are probably going to be some > >> bugs/security issues I conveniently side stepped just to get it to > work." > >> > >> "This is obviously not secure enough for a ‘production’ environment." > >> > >> If that's what you want to model your deployment after, be my guest. I > >> hardly think it's fallacious of me to suggest someone do otherwise. > >> > >> > >> > # he uses apache instead of... well... anything else > >>> > >>> well-tuned apache and mod_wsgi is on the same league as the cool boys. > >>> (i still prefer nginx, and i don't think this is a good example of > >>> apache tuning, but nothing bad about it) > >> > >> I don't care a whit about what "the cool boys" are doing. What I care > >> about is a production deployment that works efficiently and reliably and > >> that is diagnosable when something doesn't work. Apache fails those > >> criteria; nginx and lighttpd pass (in my opinion and the opinion of many > >> other developers who have used these technologies for non-trivial web > >> applications in production environments). > >> > >>> > >>> > Bonus reason: > >>> > >>> > # he uses mysql instead of postgres > >>> > >>> again, might not be the bestest choice but nowhere near a bad one. > >> > >> That's why I listed it as a bonus reason. Better than mssql and sqlite > for > >> a production deployment anyway, eh? > >> > >> > >> --Stuart > >> > >> -- > >> 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/-/ByBrEdUj8HUJ. > >> > >> 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. > > > > > > -- > > 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. > > -- > 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. > > -- 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: Changes to default project layout?
Just following up on this, I don't think my question is answered, specifically, which settings.py file is intended to be used? On Wednesday, November 9, 2011 2:08:47 AM UTC-8, Russell Keith-Magee wrote: > > Hi Victor, > > All the answers you're looking for are in the draft release notes for > the 1.4 release: > > > https://docs.djangoproject.com/en/dev/releases/1.4/#updated-default-project-layout-and-manage-py > > Yours, > Russ Magee %-) > > On Wed, Nov 9, 2011 at 2:17 PM, Victor Hooi wrote: > > heya, > > > > Also, I noticed that there's no models.py file in the first app that > > startproject creates - I assume this is by design, right? > > > > Hmm, what's the rationale behind it? > > > > Cheers, > > Victor > > > > -- > > > > > -- 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/-/LETGA11YF6sJ. 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: Does anyone know any blogs that write about how to quickly install and deploy a django application on Amazon EC2?
You mean that the webserver that Django itself recommends in https://docs.djangoproject.com/en/dev/howto/deployment/ is not a good choice? 2012/1/12 Stuart Laughlin : > > On Thursday, January 12, 2012 10:09:13 AM UTC-6, Javier Guerra wrote: >> >> On Thu, Jan 12, 2012 at 9:54 AM, Stuart Laughlin >> wrote: >> > # author admits he is a non-sysadmin noob >> >> ad-hominem > > False. I pointed out what the author clearly stipulates. > > "I’m a sys admin NOOB. I am also teaching myself to code. This is my first > time setting up this stack so there are probably going to be some > bugs/security issues I conveniently side stepped just to get it to work." > > "This is obviously not secure enough for a ‘production’ environment." > > If that's what you want to model your deployment after, be my guest. I > hardly think it's fallacious of me to suggest someone do otherwise. > > >> # he uses apache instead of... well... anything else >> >> well-tuned apache and mod_wsgi is on the same league as the cool boys. >> (i still prefer nginx, and i don't think this is a good example of >> apache tuning, but nothing bad about it) > > I don't care a whit about what "the cool boys" are doing. What I care about > is a production deployment that works efficiently and reliably and that is > diagnosable when something doesn't work. Apache fails those criteria; nginx > and lighttpd pass (in my opinion and the opinion of many other developers > who have used these technologies for non-trivial web applications in > production environments). > >> >> > Bonus reason: >> >> > # he uses mysql instead of postgres >> >> again, might not be the bestest choice but nowhere near a bad one. > > That's why I listed it as a bonus reason. Better than mssql and sqlite for a > production deployment anyway, eh? > > > --Stuart > > -- > 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/-/ByBrEdUj8HUJ. > > 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. -- Andrés Reyes Monge armo...@gmail.com +(505)-8873-7217 -- 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: Social conference website?
Thanks. Social as in social-auth. Preferably FriendList as well ("Enabling user to select the set of friends to send requests to": https://developers.facebook.com/docs/reference/dialogs/requests/) On Fri, Jan 13, 2012 at 7:42 AM, Donald Stufft wrote: > There's https://github.com/pinax/symposion but i'm not sure what you mean by > "social". > > On Thursday, January 12, 2012 at 1:18 PM, Alec Taylor wrote: > > Good morning, > > I am building up a social-conference website in Django for a > university clubs' comedy-revue. > > I will open-source it under the two-clause BSD license. > > Features I would like to implement: > • User accounts automatically generated on attendance registration > • Ticket, Sponsor and paraphernalia sales through a PayPal gateway > • Document collaboration area (built off askbot) for Writers > > I have seen a variety of Django-based conference websites. Which would > you recommend I build off to ascertain the aforementioned features? > > Thanks for all suggestions, > > Alec Taylor > > -- > 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. > > > -- > 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. -- 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: change min_length in form __init__?
why you use the "*" in your function argument? 2012/1/11 galgal > Is there any way, to change the field's *min_length* argument inside form > constructor? That doesn't work: > > def __init__(self, *args, **kwargs): >> super(CreateTeamForm, self).__init__(*args, **kwargs) >> self.fields['primary_color'].min_length = 4 > > -- > 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/-/laN38iWqC-oJ. > 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. > -- 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: Need to examine and act on old vs. new at .save() time
Hallöchen! Jeff writes: > [...] > > I found the 'm2m_changed' signal yesterday, read that you can't > determine *what* changed by using it, and also ended up directed > to some open bug reports... etc... and threw up my hands. But the "action" and "pk_set" arguments contain this information. Tschö, Torsten. -- Torsten BrongerJabber ID: torsten.bron...@jabber.rwth-aachen.de or http://bronger-jmp.appspot.com -- 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: Internationalization and localization
Thats what I was also thinking about to do it like that, I have couple websites in django but still beginner learning, with django_easymode I created entire website that translates itself just by switching between languages /en/ /it/ etc... so I can add unlimited...but I would like to know also your way that pretty much better for me because I don't need to depend on 3rd party plugin.. is there a way you could send me a zip of small working example? thanks On Sun, Jan 1, 2012 at 7:49 AM, francescortiz wrote: > I always create multilingual sites. What I do is inspired by django- > modeltranslation, but I find awkward that it leaves a "default" > language field and I prefer to have all my fields defined inside my > models. > > 1. Create a field for each language and a function that returns the > field corresponding to the client language: > > class MyModel(models.Model): >title_ca = models.CharField(max_length=255) >title_en = models.CharField(max_length=255) >title_es = models.CharField(max_length=255) >def title(self): >return getattr(self, 'title_%s' % get_language()) > > 2. In templates call the fuction that detects the language: > {{object.title}} > > 2. Then, urls.py looks like this: > (r'^$', 'home'), >(r'^(?P\w{2})/$', 'home'), > > 3. And views.py: > > from myapp.utils import enable_language > > def home(request, language=None): > ># We don't want urls without language prefix in order to prevent > duplicate content >if language is None: >return > HttpResponseRedirect(reverse('isaweb.views.home',kwargs={'language':get_language()}) > ) > >enable_language(request, language) > >return render_to_response('home.html', > {},context_instance=RequestContext(request)) > > 4. This goes into utils.py: > > def enable_language(request, language): ># Language only gets updated if it changed or is not set. >try: >if request.session['django_language'] != language: >request.session['django_language'] = language >translation.activate(language) >request.LANGUAGE_CODE = translation.get_language() >except KeyError: >request.session['django_language'] = language >translation.activate(language) >request.LANGUAGE_CODE = translation.get_language() > > > > > On Dec 7 2011, 3:14 am, kenneth gonsalves > wrote: > > On Mon, 2011-12-05 at 19:00 -0800, rentgeeen wrote: > > > What I want to how to translate stuff from DB, all at django official > > > say is about static content, what I have only found is this: > > > > django-modeltranslation > > -- > > regards > > Kenneth Gonsalves > > -- > 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. > > -- 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.