list_display - display all fields
In the 'list_display' control, is possible display all fields without having to list them? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Get model name
How to know the name of the model? i.e. class Foo(models.Model): --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Changing data format in admin
I would show a numeric field with 3 digits into the admin interface list_display = ("%03d" % numeric,) But it fails because is required an int argument. Any idea to solve it? if there is solution. --~--~-~--~~~---~--~~ 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: Changing data format in admin
Since admin interface isn't possible. On 17 ene, 17:19, Kless wrote: > I would show a numeric field with 3 digits into the admin interface > > list_display = ("%03d" % numeric,) > > But it fails because is required an int argument. > > Any idea to solve it? if there is solution. --~--~-~--~~~---~--~~ 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: Changing data format in admin
I answer myself. It's created a function that returns the desired way, and it's added to the list_display. def id_fixed(self): return "%03d" % self.id On 17 ene, 17:19, Kless wrote: > I would show a numeric field with 3 digits into the admin interface > > list_display = ("%03d" % numeric,) > > But it fails because is required an int argument. > > Any idea to solve it? if there is solution. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Choosing over a table
I need show a table with several rows, where the user can search any data (as admin interface). But when the user clicks about the data chosen I chosen store that option to show another table according that first election. Any idea or advise about how to get it? --~--~-~--~~~---~--~~ 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: Choosing over a table
I think that django-tables is the solution https://launchpad.net/django-tables On 23 ene, 09:41, Kless wrote: > I need show a table with several rows, where the user can search any > data (as admin interface). > > But when the user clicks about the data chosen I chosen store that > option to show another table according that first election. > > Any idea or advise about how to get it? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Adding a slug
I want to add a new field --slug-- to tables where any data is being used in the URL I dumped all data, added that new field -- slug = models.SlugField(_('slug')) -- And I created a hook to save it. -- def save(self): #if not self.slug: self.slug = defaultfilters.slugify(self.name) super(Model, self).save() -- I load all data but slug is not being created. I also tried with _post_save() hook. Any idea to solve this? --~--~-~--~~~---~--~~ 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: Adding a slug
On 24 ene, 15:51, Daniel Roseman wrote: > Are you saying that the slug is not being created when you reload your > previously dumped data via ./manage.py loaddata? This is expected > behaviour. Yes, that's it. The slug is succesfully created when a new objects is added but it doesn't works since ./manage.py loaddata --~--~-~--~~~---~--~~ 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 help with models
I also was looking for a solution for it and I found that the most optimal is the first approach --at least for me--. You have a normal table with data entered into a language by default, and then it's used another one to translating the text fields from that main table. The difference with yours is that I use: lang = models.ForeignKey('Language') On 24 ene, 17:41, Adrián Ribao wrote: > Hello everybody, > > I need to create dinamic content in several models. I have 3 > approaches: > > approach 1: > > class News(models.Model): > date = ... > visible = ... > text = models.CharField(max_length=255) > > class NewsTrans(models.Model): > news = models.ForeignKey(News) > lang = models.CharField(max_length=5, choices=settings.LANGUAGES) > text = models.CharField(max_length=255) > > approach 2: > class News(models.Model): > lang = models.CharField(max_length=5, choices=settings.LANGUAGES) > date = ... > visible = ... > text = models.CharField(max_length=255) > > approcah 3: > class NewsBase(): > date = ... > visible = ... > > class News(NewsBase): > lang = models.CharField(max_length=5, choices=settings.LANGUAGES) > text = models.CharField(max_length=255) > > (Any other approaches are welcome.) > > The one I like the least is the second one. > > I really need help here, please tell me how to implement translations > in ddbb in the most efficient way. > > Thank you. > > P.S. I hope Django can manage this problem, hopefully in 1.3! --~--~-~--~~~---~--~~ 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-smtpd allows you to handle email messages just like Django processes HTTP requests
The integration with the SMTP server already is solved with this project: Sos (Son Of Sam Email Server) http://www.zedshaw.com/projects/sos/ Good luck! On 24 ene, 16:29, nside wrote: > Hello, > > I just started a new project that basically allows you to write email > handlers in Django. It could be used in a user-registration > application where the user could reply to the email instead of > clicking on a URL. > I drafted a quick documentation > athttp://code.google.com/p/django-smtpd/wiki/GettingStarted > It shows the basic design of the lib and I'm looking for comments/ > suggestions/use cases if that's of interest to anyone on this list. > Note that this is still in "hacking" phase so don't consider using > this in a production system. > > Thanks! > Denis --~--~-~--~~~---~--~~ 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: Optimal translation of tables
Not, by now. I have created the models and I'm working now on views and templates, but I haven't started to profiling SQL. On 24 ene, 20:20, Adrián Ribao wrote: > Do you use a custom Model Manager or something similar to make it > optimal? I'm using this approach now but it needs to make a query for > every element, which is not very efficient. > I'd be happy if one of the django "brains" tell us how could we do > this. > > Thank you. --~--~-~--~~~---~--~~ 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: Using hashing for password checking in auth module
I recommend you to use bcrypt, the password-hashing algorithm used in OpenBSD. The advantages are that it creates and manages auto. the salt for each password entered; And the most important is that it is adaptable to future processor performance improvements. http://pypi.python.org/pypi/bcryptWrap On 30 ene, 19:36, Guy Rutenberg wrote: > Hi, > > I've started using Django recently and when I've used the auth module > I noticed that it only verifies a plain text password. I'm not > comfortable with this behaviour as it means that passwords have to be > sent by login forms in plain text. > > In previous projects of mine I've used a solution that sent involved > comparing a hash value of a given salt with the hash of the password > (which is stored in the database). A salt is sent with the login form > and upon submission, using javascript the salt is concated with a > hahed password and then both of them are hashed again. The same thing > happens in the server-side and only the result hashes are compared. > This eliminates the need to send the password in plain-text in the > login forms and adds extra security. > > Is it possible to such thing with the current auth module? if not how > hard it will be to add such functionality to the current module/write > a new authentication backend for it? > > Thanks, > > Guy Rutenberg --~--~-~--~~~---~--~~ 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: Using hashing for password checking in auth module
Rutenberg, you're correct. bcrypt is only a solution for storing the hash of passwords of secure way. In fact, it's the way more secure and easy that I've found; and it has been implemented and is being used by OpenBSD. Your method has a point of failure. Whatever can see your code JS (client-code), so he will know what are you making with the password that is sent from a form. The best options are https or using HMAC-SHA1/RIPEMD160 On 31 ene, 12:24, Guy Rutenberg wrote: > Hi Kless, > > Correct me if I'm wrong but bcrypt can be used as a solution for > storing the passwords in the database (instead of the default sha1) > but it doesn't provide the solution I'm looking for: not sending plain- > text passwords in login forms. Anyway bcrypt sounds interesting, > especially its ability to adapt to processor improvments. > > Thanks, > > Guy > > On Jan 31, 11:41 am, Kless wrote: > > > I recommend you to use bcrypt, the password-hashing algorithm used in > > OpenBSD. > > > The advantages are that it creates and manages auto. the salt for each > > password entered; And the most important is that it is adaptable to > > future processor performance improvements. > > >http://pypi.python.org/pypi/bcryptWrap --~--~-~--~~~---~--~~ 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: Using hashing for password checking in auth module
Hi Rutenberg, I just find anything that can be of interest for you. It's a "secure" method to login without https. Althought it isn't realy secure in comparison to https. http://www.pylucid.org/about/features/JS-SHA-Login/ On 1 feb, 09:07, Guy Rutenberg wrote: > I just wonder if Django > has builtin support for using this things or I've to write my own. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Modify label from field.label_tag
Is possible to modify the label value got from *{{ field.label_tag }} * ? By example, if it's got: e-mail I would to modify that label to (as example): E-MAIL And *{{ field.label_tag|upper }}* is not valid because it modifies all: USERNAME Any idea? --~--~-~--~~~---~--~~ 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: Modify label from field.label_tag
Does anybody could help me with this? Thanks in advance. On 6 feb, 13:53, Kless wrote: > Is possible to modify the label value got from *{{ field.label_tag }} > * ? > > By example, if it's got: > > e-mail > > I would to modify that label to (as example): > > E-MAIL > > And *{{ field.label_tag|upper }}* is not valid because it modifies > all: > > USERNAME > > Any idea? --~--~-~--~~~---~--~~ 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: Modify label from field.label_tag
Thanks Russel for your fast reply. My answer is down On 7 feb, 10:05, Russell Keith-Magee wrote: > On Sat, Feb 7, 2009 at 6:03 PM, Kless wrote: > > > Does anybody could help me with this? > > First off - please be patient. You've waited less than a day for a > response. Sometimes it will take a day or two to get a response - > especially when you ask your question on a Friday night. Yes, I'm sorry. But I saw that my message is already on the second page or so. > As for your question - the text displayed by label_tag is derived from > the label on the field in your form definition. If you want the text > to read E-MAIL rather than e-mail, then modify the label property to > suit: > > http://docs.djangoproject.com/en/dev/ref/forms/fields/#django.forms.F... Yes, I supposed that. But the problem is when you want use a form of an external application, and you wann't write a custom form to change simply the case of any letters. This is the case of RegistrationForm in djago-registration [1], which has labes as lower case as *label=_(u'username')* [1] http://bitbucket.org/ubernostrum/django-registration/src/tip/registration/forms.py > Alternatively, fix the problem in CSS using the text-transform property: > > label { text-transform: uppercase; } Thanks for this hint. If there is not a solution to accessing from Django, then I'll use: { text-transform: capitalize; } --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Template - Deleting last character in loop
I'm building a dinamic list of links, and I want that been separated by '|' character. Note that 'foo' is a list --- {% for i in foo %} {{ i }}| {% endfor %} --- The problem is that I wantn't that last separator (because there isn't another field). I tried the next one but without luck: --- {% ifnotequal i foo|slice:'-1' %}|{% endifnotequal %} --- How could be solved? Thanks in advance --~--~-~--~~~---~--~~ 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: Template - Deleting last character in loop [Solved]
I just to solve it :) --- {% ifnotequal i foo|last %}|{% endifnotequal %} --- On 26 mar, 13:46, Kless wrote: > I'm building a dinamic list of links, and I want that been separated > by '|' character. > > Note that 'foo' is a list > --- > {% for i in foo %} > {{ i }}| > {% endfor %} > --- > The problem is that I wantn't that last separator (because there isn't > another field). > > I tried the next one but without luck: > --- > {% ifnotequal i foo|slice:'-1' %}|{% endifnotequal %} > --- > > How could be solved? > Thanks in advance --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Alternative to AppEngine database
MongoDB has added a connector [1] that lets you use it as the persistent store in your Python AppEngine applications. This is very important to avoid the use of a propietary database. It would be great if there would more connectors using another key/ value databases as Tokyo Cabinet [2]. [1] http://www.10gen.com/blog/2009/3/use-mongodb-with-googles-appengine-sdk [2] http://tokyocabinet.sourceforge.net/index.html --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
[ANN] Falcon - powering innovation
If anybody is interesed in new technologies, you'll love this new language called Falcon [1], which has been open sourced ago little time. Falcon is a scripting engine ready to empower mission-critical multithreaded applications. It provides six integrated programming paradigms: procedural, object oriented, prototype oriented, functional, tabular and message oriented. You use what you prefer. To know more about its design, read the interview to the Falcon author that has published ComputerWorld Australia [2]. [1] http://www.falconpl.org/ [2] http://www.computerworld.com.au/article/298655/-z_programming_languages_falcon?fp=2&fpid= --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Template filter with plural tag
I would to pluralize into a translation block [1] but I also want to apply the 'apnumber' template filter [2] --- {% load humanize %} {% load i18n %} {% blocktrans count list|apnumber as number %} There is {{ number }} object. {% plural %} There are {{ number }} objects. {% endblocktrans %} --- The problem is that if the filter is used then the 'plural' tag doesn't works. Is there any way to solve it? [1] http://docs.djangoproject.com/en/dev/topics/i18n/#in-template-code [2] http://docs.djangoproject.com/en/dev/ref/contrib/humanize/#apnumber --~--~-~--~~~---~--~~ 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: Template filter with plural tag [Solved]
Thanks! It works as charm. On 11 abr, 22:54, Malcolm Tredinnick wrote: > Indeed, this is possible. You need to use a number for the counting > portion of the blocktrans-plural combination, so that gettext can use > the number to determine the plural form. The trick is that you use the > same variable again, combined with a filter as another alias inside the > translation block to represent the content you want. Like this: > > {% blocktrans count list as number and list|apnumber as word %} > There is {{ word }} object. > {% plural %} > There are {{ word }} objects. > {% endblocktrans %} --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Debug middleware
How to debug a middleware? I would print any variables for a middleware that I'm building Is there any way to make it? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Change the model name
Is possible to change the model name? >From a class as *class FooBar* it's got a model called *foobar*, but I would to get a model called 'foo_bar', without change the class name to 'Foo_Bar'. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Display only some tables
How to show only any tables to any users -as to the visitors-? --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Display only some tables
1) I want to display any tables to whatever person -public--, but I want not to display tables of both Auth and Sites models 2) And that only can be added more data only by registered users. On 31 mayo, 21:04, "Joseph Heck" <[EMAIL PROTECTED]> wrote: > Hey Kless, > > I think you need to be a bit clearer on your question. What are you > trying to accomplish? > > On Sat, May 31, 2008 at 11:47 AM, Kless <[EMAIL PROTECTED]> wrote: > > > How to show only any tables to any users -as to the visitors-? --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Change the model name
No, it wasn't about that, but thanks anyway. On 31 mayo, 21:08, "Joseph Heck" <[EMAIL PROTECTED]> wrote: > If you're talking about changing the display name in the > administrative interface, there is the option of setting "verbose > name" - seehttp://www.djangoproject.com/documentation/model-api/#table-names > for more information. You can also change the database table name > associated with the model object if you feel you must. More details > are in that same documentation page. > > -joe > > On Sat, May 31, 2008 at 11:45 AM, Kless <[EMAIL PROTECTED]> wrote: > > Is possible to change the model name? > > > From a class as *class FooBar* > > it's got a model called *foobar*, > > but I would to get a model called 'foo_bar', without change the class > > name to 'Foo_Bar'. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Change the model name
I'm refering to that the model name -not the db name- is created by: app_label + '.' + model_class_name (in lowercase). So, of a class as: class FooBar(...): ... The model name is: 'application.foobar' And I would to get a 'model_class_name' separed by underscores -when there is anything letter in uppercase- : foo_bar On 1 jun, 04:40, Eric Abrahamsen <[EMAIL PROTECTED]> wrote: > Are you maybe talking about changing the underlying database table name? > > http://www.djangoproject.com/documentation/model-api/#table-names > > On Jun 1, 2008, at 2:45 AM, Kless wrote: > > > > > Is possible to change the model name? > > > From a class as *class FooBar* > > it's got a model called *foobar*, > > but I would to get a model called 'foo_bar', without change the class > > name to 'Foo_Bar'. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Display only some tables
Well, I've been playing with the admin interface, and simply choosing the permissions is enought to display any tables to the users. The bad is that it's necessary that the users are registered to that can see she tables. On 1 jun, 17:09, Tim <[EMAIL PROTECTED]> wrote: > Hi Kless, > > This doesn't sound like a "how do I get my code to work" problem but > more of a general "how does this work" sort of question. I'd suggest > you read through Django Book (http://www.djangobook.com/en/1.0/chapter12/ > seems appropriate) to figure out how the Auth stuff works and there is > a chapter on modifying the Django admin (http://www.djangobook.com/en/ > 1.0/chapter17/). For creating a site that has public users > registering, check outhttp://code.google.com/p/django-registration/ > -- lots of Django goodness to get you started. > > If you don't want a user with admin access to see the Auth and Sites > modules, make sure the user isn't a superuser and then adjust their > permissions so they don't have access to any of the permissions for > those modules. > > Tim > > On May 31, 2:16 pm, Kless <[EMAIL PROTECTED]> wrote: > > > 1) I want to display any tables to whatever person -public--, but I > > want not to display tables of both Auth and Sites models > > 2) And that only can be added more data only by registered users. > > > On 31 mayo, 21:04, "Joseph Heck" <[EMAIL PROTECTED]> wrote: > > > > Hey Kless, > > > > I think you need to be a bit clearer on your question. What are you > > > trying to accomplish? > > > > On Sat, May 31, 2008 at 11:47 AM, Kless <[EMAIL PROTECTED]> wrote: > > > > > How to show only any tables to any users -as to the visitors-? --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Use new variables on templates
I've added the next variables on settings.py -rather than use sites module for a single site-. How use the new variable added in the templates? SITE_NAME = 'Something' SITE_URL = 'http://something.com' from django.conf import settings.SITE_NAME ?? Where add it? --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Use values of Site module on templates [SOLVED]
At the end, I'll get these variables directly from the Site module. And to access to them, can be made using templatetags or context processors -that is better for this case-. * Templatetags --- from django import template from django.contrib.sites.models import Site register = template.Library() current_site = Site.objects.get_current() def site_domain(): return current_site.domain @register.simple_tag def site_url(): return "http://www.%s"; % (site_domain()) @register.simple_tag def site_name(): return current_site.name --- * Context processors --- from django.contrib.sites.models import Site def site(request): """Adds site-related context variables to the context. """ current_site = Site.objects.get_current() return { 'SITE_NAME': current_site.name, 'SITE_DOMAIN': current_site.domain, 'SITE_URL': "http://www.%s"; % (current_site.domain), } --- --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Add new context processors [Trick]
To add any new context processor, write this on your settings file: --- from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS TEMPLATE_CONTEXT_PROCESSORS = TEMPLATE_CONTEXT_PROCESSORS + \ ('project.app.context_processors.name',) --- So, neither that variable is overwritted neither you have to copy it from the global settings file. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Serving media from Django only in development [Trick]
urls.py - from django.conf import settings # Serves media content. WARNING!! Only for development uses. # On production use lighthttpd for media content. if settings.DEBUG: # Delete the first trailing slash, if any. if settings.MEDIA_URL.startswith('/'): media_url = settings.MEDIA_URL[1:] else: media_url = settings.MEDIA_URL # Add the last trailing slash, if have not. if not media_url.endswith('/'): media_url = media_url + '/' urlpatterns += patterns('', (r'^' + media_url + '(?P.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT} ), ) - --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Cryha - Toolkit for crypto on database
I'm proud to release version 0.9 of Cryha. Cryha is a Python toolkit for securing information into a data base; it lets hash passwords, and encrypt/decrypt personal information. It is ready for input of Unicode characters, and the schema is returned as Unicode. The text is stored according to this schema for a hash: ``separator, the hash function identifier, separator, the salt, separator, the hash output`` And this another for a cipher text: ``separator, the cipher identifier, separator, the mode identifier, separator, the IV parameter, separator, the ciphertext`` The idea of the schema has been taken of Linux systems that store the hashed passwords so, using a ``$`` as separator. Here you can see how it is so easy to hash and encrypt/decrypt on the fly: http://github.com/kless/tw.registra/tree/master/tw/Registra/model/identity.py#L263 http://github.com/kless/tw.registra/tree/master/tw/Registra/model/identity.py#L288 * Now it's ready to read its configuration of TG2/Pylons projects, but it would be very easy adapt it for another frameworks. For more information about Cryha read on its home project [1]. It can be installed via setuptools: $ sudo easy_install Cryha [1] http://github.com/kless/cryha/tree/master --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---