Re: Database relations concepts

2010-02-18 Thread Timothy Kinney
What does it mean to check about index selectivity? Sorry, my knowledge of databases is mostly as a user. But I am learning a lot this week. -Tim On Fri, Feb 19, 2010 at 1:39 AM, Javier Guerra wrote: > On Fri, Feb 19, 2010 at 2:31 AM, Timothy Kinney >

Re: Database relations concepts

2010-02-18 Thread Javier Guerra
On Fri, Feb 19, 2010 at 2:31 AM, Timothy Kinney wrote: > is there a way to store a list variable in a model as a field (without > creating another table)? There's no 'list' field type in SQL. There's a 'set' in MySQL; but i think it's not standard, so not supported in

Re: template code in tinymce editor

2010-02-18 Thread Stephan John
Thanks for this interesting approach. Stephan Am Freitag, 19. Februar 2010 00:34:54 schrieb Matías Costa: > In general no, but in this simple usage it is posible. Writing from > memory, the names will be wrong: > > class Info(models.Model) > ...fields > > def

Re: Database relations concepts

2010-02-18 Thread Timothy Kinney
This is a fabulous response, Peter. Thank you very much for making this so clear. The samurai_set is a revelation for me as well. I see now that I should look more carefully at the methods available for the models. If I can ask another question about this same topic, is there a way to store a

Re: Database relations concepts

2010-02-18 Thread Peter Herndon
On Feb 18, 2010, at 11:47 PM, Timothy Kinney wrote: > > Here's the system I'm currently using that doesn't work too well... > > Samurai (id, name) > > Room (id, name, ForeignKey(Samurai), ForeignKey(Province)) > > Province (id, name) > > > Can someone suggest which relationships to use to

Database relations concepts

2010-02-18 Thread Timothy Kinney
I'm having some trouble wrapping my head around some ORM concepts in Django. I have a Samurai model, and I want to develop a Province and Room model. The idea is that each Room is associated with a Province (is in the province) and each Room can hold multiple samurai (and items). I want to be

Re: Working with outside data sources

2010-02-18 Thread Rishabh Manocha
On Fri, Feb 19, 2010 at 11:23 AM, Michael Lissner < mliss...@michaeljaylissner.com> wrote: > Thanks for the reply. > > My teammate that writing the scrapers is a java guy, and he's planning to > use that rather than django/python. I haven't looked at the kinds of > databases that django creates,

Re: Working with outside data sources

2010-02-18 Thread Michael Lissner
Thanks for the reply. My teammate that writing the scrapers is a java guy, and he's planning to use that rather than django/python. I haven't looked at the kinds of databases that django creates, but do you think that will cause any problems? If not, I think we'll proceed with plan B, below.

Re: Working with outside data sources

2010-02-18 Thread Rishabh Manocha
On Fri, Feb 19, 2010 at 10:04 AM, mjlissner wrote: > I'm using django for a final project in my masters program at UC > Berkeley, and I'm trying to sort out exactly how the database works. I > would spend a bunch of time figuring this out myself, but I am working > in a

Re: Admin screen pluralizing models inappropriately and database relations question

2010-02-18 Thread Timothy Kinney
This has proven very helpful, thank you! I've decided to implement it like this: Samurai: Autofield ID (primary, unique) Item: Autofield ID (primary, unique) Inventory: Autofield ID, ForeignKey('Samurai'), ForeignKey('Item'), Condition = IntegerField This seems to do what I want. Looking

Working with outside data sources

2010-02-18 Thread mjlissner
I'm using django for a final project in my masters program at UC Berkeley, and I'm trying to sort out exactly how the database works. I would spend a bunch of time figuring this out myself, but I am working in a team, and my teammates need this info asap. My teammates are making scrapers that

Re: admin calender not showing for datefields

2010-02-18 Thread Kenneth Gonsalves
On Friday 19 Feb 2010 2:01:50 am mendes.rich...@gmail.com wrote: > Does anyone know a solution for this or help me in the right > direction. > look in the apache access logs (not error logs) for a 404 on the calendar - probably a path problem -- regards Kenneth Gonsalves Senior Associate

Re: Admin screen pluralizing models inappropriately and database relations question

2010-02-18 Thread Tim Shaffer
1) You can change this in your model. Check out "verbose_name" and "verbose_name_plural" for the model's Meta class. http://docs.djangoproject.com/en/dev/ref/models/options/ 2) If you have a ManyToMany field to samurai on the item, you don't need the inventory model at all. A samurai's inventory

Re: Use django auth system with ruby on rails

2010-02-18 Thread geraldcor
All of your comments prompted me to start reverse engineering what django does and I came across the check_password method which just separates the algorithm, salt and hash and then sends it to the following method to compare the raw password to the hash password. So basically, in Ruby, I can do

Re: Model for debt, credit and balance

2010-02-18 Thread Marcelo Barbero
It worked!!! Thanks a lot. Marcelo 2010/2/18 Tim : > There might be a better way, but something like this should work. > > In your view, build a list... > > transaction_list = [] > balance = 0 > for tran in Transaction.objects.order_by('date'): >    balance = balance +

Re: choices in model field error

2010-02-18 Thread Karen Tracey
On Thu, Feb 18, 2010 at 11:18 AM, hooda_28 wrote: > hi im having a problem for about an hour now, i have a model > > class Dummy(models.Model): >sell = models.CharField(max_length=20, choices=Z_CHOICES) > >def __unicode__(self): >return u'%s' % (self.sell) >

Re: A model's property in a form?

2010-02-18 Thread Boris Schaeling
On Thu, 18 Feb 2010 17:13:09 +0100, Boris Schaeling wrote: [...]I see. Then it means what I actually tried to do is impossible. I can't use properties as described at http://www.djangoproject.com/documentation/models/properties/ but should overwrite save() and

Re: template code in tinymce editor

2010-02-18 Thread Matías Costa
In general no, but in this simple usage it is posible. Writing from memory, the names will be wrong: class Info(models.Model) ...fields def article_context_rendered(self): t = templates.from_string(self.article_context) return t.render({'info':self}; And in the template

Re: LDAP Authentication and Single Sign on

2010-02-18 Thread Mike Dewhirst
On 19/02/2010 1:53am, Wayne wrote: Hi, I am about to develop an admin interface using Django framework for several web applications . By design, those applications will be decentralized, which means that they may use different databases and reside on different servers and they will talk to each

template code in tinymce editor

2010-02-18 Thread Stephan John
Hi, I use in the Admin interface the tinymce editor. It is possible to enter some template code in the editor which is displayed in the template? Example: the view: def client_info(request): info = request.META content = Article.objects.all() template =

Re: Slugify() and Clean form data Questions

2010-02-18 Thread Jon Loeliger
> > from django.template.defaultfilters import slugify > > Every filter you see listed in > http://docs.djangoproject.com/en/dev/ref/templates/builtins/ lives in > django.template.defaultfilters. Awesome! Thanks! And with that in hand, the only place I can find the string

Re: CSRF issue...

2010-02-18 Thread Matt McCants
Depends on what you have for your render_to_response. It's pretty good practice (from what I can tell) to use something like this Note that response is a dict that has my per view context variables in it. return render_to_response("myapp_super_cool_template.html", response,

Re: Slugify() and Clean form data Questions

2010-02-18 Thread Matt McCants
Here's a stripped down example. I've messed with using signals instead of overriding the save method for all the models that need a slug. But this is quick and easy. http://gist.github.com/308068 Matt On Thu, 2010-02-18 at 14:53 -0600, Jon Loeliger wrote: > > > > > Is there a canonical

Re: Slugify() and Clean form data Questions

2010-02-18 Thread Jon Loeliger
> Some places say underscores are valid, others say they removed: > > http://docs.djangoproject.com/en/dev/ref/templates/builtins/ > > slugify > > Converts to lowercase, removes non-word characters > (alphanumerics and underscores) and converts spaces to > hyphens.

Re: Slugify() and Clean form data Questions

2010-02-18 Thread Jon Loeliger
> > > Is there a canonical definition or even a reference implementation > > of a slug =3D slugify(str) function somewhere? Yeah, I could go > > grep through the sources and maybe find one? And yes, I see: > >=20 > >http://docs.djangoproject.com/en/dev/ref/models/fields/#slugfield > >=20 >

Re: Slugify() and Clean form data Questions

2010-02-18 Thread Peter Herndon
On Feb 18, 2010, at 3:01 PM, Jon Loeliger wrote: > Folks, > > Quick question or two: > > Is there a canonical definition or even a reference implementation > of a slug = slugify(str) function somewhere? Yeah, I could go > grep through the sources and maybe find one? And yes, I see: > >

admin calender not showing for datefields

2010-02-18 Thread mendes.rich...@gmail.com
Hello Django Users, We started putting our django application in production and came across something what to me was really odd. In our database model we have multiple DateFields which are presented with a today and calender besides it in the admin site. When we moved our application into

Admin screen pluralizing models inappropriately and database relations question

2010-02-18 Thread Timothy Kinney
Hello, I'm new to Django, but learning as fast as I can. I would appreciate some technical help and some database design advice... ** 1) Admin pluralizing question So I have three models: samurai, item, inventory When I login to the admin screen it has chosen to pluralize them as: samurais,

Slugify() and Clean form data Questions

2010-02-18 Thread Jon Loeliger
Folks, Quick question or two: Is there a canonical definition or even a reference implementation of a slug = slugify(str) function somewhere? Yeah, I could go grep through the sources and maybe find one? And yes, I see: http://docs.djangoproject.com/en/dev/ref/models/fields/#slugfield

Re: getting a view function from a view name

2010-02-18 Thread Timothy Kinney
Check out the http shortcuts: http://docs.djangoproject.com/en/dev/topics/http/shortcuts/ There is one for redirect that can redirect you to a function in the view. -Tim On Thu, Feb 18, 2010 at 1:49 PM, Ryan Mark wrote: > Any thoughts as to how I could get the view function from

How to deal with inconsistent database - using ForeignKey across table

2010-02-18 Thread sww314
I have a database that another application (i.e. non-Django) feeds data into. class Service(models.Model): name = models.CharField(max_length=100) class Alert(models.Model): service = models.ForeignKey(Service) message = models.CharField(max_length=255) A given service can have many

Re: cant see data with a Generic View

2010-02-18 Thread gustavo
Robin, I tried, but it didnt work... On 18 fev, 17:20, robin nanola wrote: > i solved it, it was just an encoding issue, i just put these > #!/usr/bin/python > # -*- coding: utf-8 -*- > in the first two lines of the of my choices file and then make sure that all > the

getting a view function from a view name

2010-02-18 Thread Ryan Mark
Any thoughts as to how I could get the view function from a url name? Is there something like django.core.urlresolvers.resolve() that takes a url name and returns a view function? Thanks! -- Ryan Mark -- You received this message because you are subscribed to the Google Groups "Django users"

Re: django + memcached: problem with limit of 1 mb

2010-02-18 Thread Javier Guerra
On Thu, Feb 18, 2010 at 2:32 PM, ramu...@gmail.com wrote: > Does anyone know about any solutions for keeping data bigger, than 1 > mb in memcached ? sure, use the filesystem. seriously; nginx can serve static data from disk just as fast as memcached does from RAM. -- Javier

Re: django + memcached: problem with limit of 1 mb

2010-02-18 Thread ramu...@gmail.com
This can works on the base of this snippet http://www.djangosnippets.org/snippets/488/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send

Unexpected view decorator arguments

2010-02-18 Thread Travis the Software Maven
I'm trying to write a simple view decorator that does some permission checking based on an ID passed as part of the URL and the authenticated user. Some relevant code: The decorator: def owns_item(failure_redirect_url='/'): def check_ownership(method): def _wrapper(request,

django + memcached: problem with limit of 1 mb

2010-02-18 Thread ramu...@gmail.com
Does anyone know about any solutions for keeping data bigger, than 1 mb in memcached ? This is no big deal to cut big data to 1mb pieces before setting and merge this pieces after getting from memcached. And this algorithm can work transparently for users. -- You received this message because

Re: cant see data with a Generic View

2010-02-18 Thread robin nanola
i solved it, it was just an encoding issue, i just put these #!/usr/bin/python # -*- coding: utf-8 -*- in the first two lines of the of my choices file and then make sure that all the choices are encoded also to utf-8 format. thanks for your time, i appreciate it. On Fri, Feb 19, 2010 at 3:09 AM,

Re: cant see data with a Generic View

2010-02-18 Thread Timothy Kinney
This happened to me before. I solved it by first writing generic text in the template and then making sure that the text would show. Then I passed a variable to the template but left it defined as {None: None} to see if I was making the call correctly. Finally, I edited the variable to be some

cant see data with a Generic View

2010-02-18 Thread gustavo
Hello fellows, I have a generic view but I cant see the data. The template is been loaded and there is only one register in the database. But the template doesnt bring the data. Any clue why? Thanks a lot! -- You received this message because you are subscribed to the Google Groups "Django

Re: ANN: Djangout -- Buildout recipes for Django

2010-02-18 Thread Timothy Kinney
Sorry for the noob question, but what is a Buildout recipe? On Thu, Feb 18, 2010 at 11:30 AM, Gustavo Narea < gustavona...@2degreesnetwork.com> wrote: > Hello, > > I'm pleased to announce Djangout, a set of Buildout recipes for > Django. Although that "set" is made of just one item, we find this

CSRF issue...

2010-02-18 Thread Matthew Currier
I am new to Django and loving it. I am using v1.2 locally and have an issue with my first project from scratch: The CSRF token is not being sent with my form post. I have {% csrf_token %} inside the tag and have verified that a csrf cookie does exist for the browser. However, I get the error

ANN: Djangout -- Buildout recipes for Django

2010-02-18 Thread Gustavo Narea
Hello, I'm pleased to announce Djangout, a set of Buildout recipes for Django. Although that "set" is made of just one item, we find this functionality to be a very useful one: http://packages.python.org/djangout/ If you'd like to receive updates about this recipe, you may want to keep an eye on

Re: choices in model field error

2010-02-18 Thread robin nanola
yes its all working fine, when i change may choices like for example Z_CHOICES =(('9','nnn'),('10','na',),) without any non-ascii character the select box were shown with the choices list. On Fri, Feb 19, 2010 at 2:56 AM, Timothy Kinney wrote: > Can you successfully log

Re: choices in model field error

2010-02-18 Thread Timothy Kinney
Can you successfully log in to the admin site using the test server? On Thu, Feb 18, 2010 at 10:18 AM, hooda_28 wrote: > hi im having a problem for about an hour now, i have a model > > class Dummy(models.Model): >sell = models.CharField(max_length=20,

Re: Model for debt, credit and balance

2010-02-18 Thread Tim
There might be a better way, but something like this should work. In your view, build a list... transaction_list = [] balance = 0 for tran in Transaction.objects.order_by('date'): balance = balance + tran.debit balance = balance - tran.credit

Re: Best way to access 'request' in pre_save

2010-02-18 Thread David De La Harpe Golden
On 18/02/10 15:55, Paul Stone wrote: I'm trying to find the best way to update a model using data from the request object (e.g request.user) before it is saved. One use case for this is updating an 'updated_by' field on a model. I've come across http://www.djangosnippets.org/sn/ippets/476 which

Re: Best way to access 'request' in pre_save

2010-02-18 Thread James Bennett
On Thu, Feb 18, 2010 at 10:55 AM, Paul Stone wrote: > I'm trying to find the best way to update a model using data from the > request object (e.g request.user) before it is saved. One use case for > this is updating an 'updated_by' field on a model. Presumably you have a

Re: any suggestions for managing DB schema with visual ERD tool?

2010-02-18 Thread snfctech
Thanks for the link to that option, Dougal. I have typically managed my models textually in the past - and maybe that's still the best way to do things. Especially if you can use things like graph_models to output a visual representation for discussion purposes. I was just trying out a new way

Re: any suggestions for managing DB schema with visual ERD tool?

2010-02-18 Thread Dougal Matthews
On 18 February 2010 00:03, snfctech wrote: > I just built a complicated schema with MySQL workbench and am looking > at Python frameworks to start implementation. > > Does anybody in the Django community do this? What's your practice > for going back and forth between

Admin login with RemoteUserMiddleware?

2010-02-18 Thread Stodge
I have the RemoteUserMiddleware middleware working so users are authenticated on a Django site using Apache's basic authentication. However, the admin cannot log in. I only found one post on these groups with the same problem but no answer. So is this possible? Can an admin login somehow when the

Re: Creating new Thread in a view?

2010-02-18 Thread Preston Holmes
On Feb 17, 9:36 am, justind wrote: > I have an unusual Django application. I was wondering if someone could > offer advice to the best way to handle a requirement. This isn't a > standard application (and might not even seem like a good use of > Django, but that's

Re: any suggestions for managing DB schema with visual ERD tool?

2010-02-18 Thread snfctech
@Daniel: That's the idea! But it's Mac only. :-( @rebus_: Thanks for the links for graph_models. You still have to manage the models textually, though. I was hoping for something that you could manage visually. On Feb 18, 1:15 am, rebus_ wrote: > On 18 February 2010

Re: anybody tried web2py and gone back to Django?

2010-02-18 Thread snfctech
@Vasil: thanks for the enumerated points. On Feb 18, 8:47 am, snfctech wrote: > Thanks for the reply, Wiiboy. > > I agree that web2py is cool and Massimo is a good guy. > > I'm still comparing the two frameworks and don't have a lot of > preferences to list yet, but so

Best way to present proxy model data

2010-02-18 Thread SlafS
Hi there! I am thinking about the best way of presenting some data from a proxy model. I have some model classes let's say: http://bpaste.net/show/3338/ and a view: def proxy_view(request, year, month, day): qs = ExModel.objects.all() # maybe some stuff here with `some_logic` method

Re: anybody tried web2py and gone back to Django?

2010-02-18 Thread snfctech
Thanks for the reply, Wiiboy. I agree that web2py is cool and Massimo is a good guy. I'm still comparing the two frameworks and don't have a lot of preferences to list yet, but so far I prefer the way the online Django tutorial is written to the Overview/tutorial chapter of the web2py book. I

Re: Downloadable CSV file of Survey?

2010-02-18 Thread Marco Rogers
Definitely use python csv and do it yourself. It's really very simple. shaner's links above should help. One thing I would add is make sure you convert all of your model values to unicode because otherwise the csv module will choke on bad characters. unicode(value, 'utf8') :Marco On Feb

choices in model field error

2010-02-18 Thread hooda_28
hi im having a problem for about an hour now, i have a model class Dummy(models.Model): sell = models.CharField(max_length=20, choices=Z_CHOICES) def __unicode__(self): return u'%s' % (self.sell) where Z_CHOICES =('9 , 'ñññ'),('10' , 'ña'),('11' , "aña"),) that is dynamically

Re: anybody tried web2py and gone back to Django?

2010-02-18 Thread Vasil Vangelovski
I've looked at it a couple of months ago. There are some great ideas behind it. Web2Py cons: 1. The first and biggest issue at the time was that there was no sufficient/accessible documentation available for free. The book was only available on scribd for free which is horrible. Now the book is

Re: A model's property in a form?

2010-02-18 Thread Boris Schaeling
On Thu, 18 Feb 2010 16:53:06 +0100, Gonzalo Delgado wrote: El 18/02/10 10:18, Boris Schaeling escribió: This replaces the setter but not the getter. To replace the getter, you'd have to override the modelform's __init__ method and set the corresponding field value

Best way to access 'request' in pre_save

2010-02-18 Thread Paul Stone
I'm trying to find the best way to update a model using data from the request object (e.g request.user) before it is saved. One use case for this is updating an 'updated_by' field on a model. I've come across http://www.djangosnippets.org/snippets/476/ which suggests one way of doing this. What

Re: A model's property in a form?

2010-02-18 Thread Gonzalo Delgado
El 18/02/10 10:18, Boris Schaeling escribió: > > This replaces the setter but not the getter. To replace the getter, you'd have to override the modelform's __init__ method and set the corresponding field value from the instance getter. -- Gonzalo Delgado -- You received

Model for debt, credit and balance

2010-02-18 Thread Marcelo Barbero
I have a model with accounting records, in which the last two columns are "Debt" and "Credit". I would like to do a report that is something like the following: Description DebtCredit Balance Movement 1100.000.00 100.00 Movement 2

Index Error with empty queries

2010-02-18 Thread Chris McComas
I have this in my views, if there lor1 and lor2 are both there it works fine, but if one or two of them are missing then it gives me this error. views.py - http://dpaste.com/161124/ error - http://dpaste.com/161128/ Some applicants have two LORs, some have one LOR, and obviously some don't have

Re: Use django auth system with ruby on rails

2010-02-18 Thread Alex Robbins
You could have a secure url that the RoR apps redirect to if the user isn't authenticated with Rails. That url would have the login_required decorator. If they successfully login on the django side (or are already logged in), then they get redirected with some sort of get variable user id + hash

Form query set not respected in Admin list page

2010-02-18 Thread Jacek Furmankiewicz
If I override a field in an Admin form to limit the selected choices, e.g. class MyForm(forms.ModelForm): entity = forms.ModelChoiceField(queryset=MyEntity.objects.all().filter(some_field ="some_value") class Meta: model = MyEntity I see that my dropdown in the Form is properly

Re: anybody tried web2py and gone back to Django?

2010-02-18 Thread Wiiboy
First of all, I'd like to say that I think Web2py, and its maintainer Massimo, are awesome. =) I tried Web2py for a little while a couple months ago, but the biggest issue was poor documentation -- at the time, there was almost nothing. Now there's a whole book, online, but... Also, it was

Re: Fine-grained object level permissions

2010-02-18 Thread Jacek Furmankiewicz
Ah, very interesting, exactly what I was looking for, thanks for the tip. Jacek -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to

Re: Scope of an app

2010-02-18 Thread Sander
Atamert & Clifford, thank you both for your extensive answers. Atemert: > First of all you need to make sure whether you need an Employer (and a > seperate Manager) model. Perhaps you can do with a UserProfile (see auth > docs). And then there can be a role column to define Employer/Manager/etc

LDAP Authentication and Single Sign on

2010-02-18 Thread Wayne
Hi, I am about to develop an admin interface using Django framework for several web applications . By design, those applications will be decentralized, which means that they may use different databases and reside on different servers and they will talk to each other via web services. We have our

Re: about sending email

2010-02-18 Thread Javier Guerra
On Wed, Feb 17, 2010 at 10:38 AM, Marco Rogers wrote: > When you're ready to go live, you'll need to make sure your production > server has access to a real mail server. i usually just install ssmtp on both development and production servers. -- Javier -- You received

Re: Change display of (None) in admin change lists?

2010-02-18 Thread rebus_
On 18 February 2010 15:12, Derek wrote: > Is there a way to alter the display of fields in the Django Admin change > lists so that they do not show (None) - for text - or None - for numeric. > > I'd prefer to use " " or "-" for display of items instead. > > Thanks > Derek > >

Re: Fine-grained object level permissions

2010-02-18 Thread Shawn Milochik
On Feb 18, 2010, at 9:29 AM, Jacek Furmankiewicz wrote: > Is it possible to intercept the QuerySets that Django generates? Yes, make a custom manager: http://docs.djangoproject.com/en/dev/topics/db/managers/ Brief: When you use 'objects' (as in MyModel.objects), you're using the default

Re: Fine-grained object level permissions

2010-02-18 Thread Jacek Furmankiewicz
Is it possible to intercept the QuerySets that Django generates? Maybe there is some generic QuerySetFactory per each entity that we could use to filter out the disallowed instances? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to

Re: Scope of an app

2010-02-18 Thread Eric Abrahamsen
On Feb 18, 2010, at 9:41 PM, Sander wrote: Thanks! Those guidelines are certeinly helpfull. Hope these helps. If you need more specific answers please expand the following paragraph: My main project should have a couple of entities, like for example an 'Employee', 'Manager', 'Question'.

Re: Scope of an app

2010-02-18 Thread Atamert Ölçgen
On Thursday 18 February 2010 15:41:40 Sander wrote: > let's say the following (pure hypothetical): > - an Manager can read questions at example.com/manager/read > - an Employee can post questions at example.com/employee/add > > Let me try myself: > In this case, following your guidelines, I

Re: Scope of an app

2010-02-18 Thread CLIFFORD ILKAY
On 02/18/2010 08:41 AM, Sander wrote: let's say the following (pure hypothetical): - an Manager can read questions at example.com/manager/read - an Employee can post questions at example.com/employee/add The URL namespaces is only loosely coupled to applications. This is, in fact, a big

Change display of (None) in admin change lists?

2010-02-18 Thread Derek
Is there a way to alter the display of fields in the Django Admin change lists so that they do not show (None) - for text - or None - for numeric. I'd prefer to use " " or "-" for display of items instead. Thanks Derek -- You received this message because you are subscribed to the Google

Re: Scope of an app

2010-02-18 Thread Sander
Thanks! Those guidelines are certeinly helpfull. > Hope these helps. If you need more specific answers please expand the > following paragraph: > > > My main project should have a couple of entities, like for example an > > 'Employee', 'Manager', 'Question'. An employee can ask questions, and >

Re: User permissions to see a view

2010-02-18 Thread rebus_
On 18 February 2010 14:02, Alexey Kostyuk wrote: > Hi ALJ! > > Why can not you add a model 'reports' (in your example) and add the > required permissions? > Also you can add custom permissions[1] to any other models of your app > and use them. > >

Re: Scope of an app

2010-02-18 Thread Richard Shebora
Check out this site also. It will generate a good starting point for your app... I am using it to learn good project/app deisgn. djangogenerator.com Thanks, Richard Shebora On Thu, Feb 18, 2010 at 7:43 AM, Sander wrote: > Hello everybody, > > I'm having a little

File to object

2010-02-18 Thread Imre Guzmics
Hello I make a simple Photostore, application and I like to import the images from a directory. I like to upload files via FTP. So I like to ask your help about this. I like to a make something same, if it posible: class Testmodel(models.Model): ... pict =

Re: User permissions to see a view

2010-02-18 Thread Alexey Kostyuk
Hi ALJ! Why can not you add a model 'reports' (in your example) and add the required permissions? Also you can add custom permissions[1] to any other models of your app and use them. [1]http://docs.djangoproject.com/en/dev/topics/auth/#id2 On Thu, 2010-02-18 at 04:29 -0800, ALJ wrote: > Hi

Re: User permissions to see a view

2010-02-18 Thread ALJ
Hi Rebus, Yeah, I got that, but where do I put the meta permissions? In which model? The user? > #models.py class UserType(models.Model): id = models.CharField(max_length=3, primary_key=True) name = models.CharField(max_length=30)

Re: User permissions to see a view

2010-02-18 Thread rebus_
On 18 February 2010 13:29, ALJ wrote: > Hi Alexey, > > But how do you set a permission for a view? There's no underlying > model to which to add the custom meta permissions. > > ALJ > > On Feb 18, 12:48 pm, Alexey Kostyuk wrote: >> On Thu,

Re: A model's property in a form?

2010-02-18 Thread Boris Schaeling
On Thu, 18 Feb 2010 02:01:16 +0100, Sam Lai wrote: On 18 February 2010 10:49, Boris Schaeling wrote: Is it possible to make a model's properties available in a form which are created as described at

Re: Scope of an app

2010-02-18 Thread Atamert Ölçgen
On Thursday 18 February 2010 14:43:07 Sander wrote: > Hello everybody, > > I'm having a little hard time starting a Django project because I'm > not sure where to place my models in the first place. > > For example, the Django beginner tutorials put all entities of the > 'Poll' application

Re: Multiple user types

2010-02-18 Thread David De La Harpe Golden
On 18/02/10 08:31, Sander wrote: Can you explain yourself a little bit more about the other one to one fields? Well, django has a "OneToOneField" field type, that is like ForeignKey" only assumes the two models are, well, one to one. And thus, the generated reverse relation accessor

Scope of an app

2010-02-18 Thread Sander
Hello everybody, I'm having a little hard time starting a Django project because I'm not sure where to place my models in the first place. For example, the Django beginner tutorials put all entities of the 'Poll' application (Question, Answer) in a new app called Polls. Thats pretty clear, but a

Re: User permissions to see a view

2010-02-18 Thread ALJ
Hi Alexey, But how do you set a permission for a view? There's no underlying model to which to add the custom meta permissions. ALJ On Feb 18, 12:48 pm, Alexey Kostyuk wrote: > On Thu, 2010-02-18 at 02:30 -0800, ALJ wrote: > > First project and struggling a bit. > > > I

issue with signals pre_save

2010-02-18 Thread Ralph
Hi there, I am using Django 1.1 and have an issue with signals pre_save. I am having a model in which i have a foreign key element that I want to set in the pre_save method. I am performing a lookup and depending on the outcome of the lookup I want either to create a new object of the foreign key

Re: User permissions to see a view

2010-02-18 Thread Alexey Kostyuk
On Thu, 2010-02-18 at 02:30 -0800, ALJ wrote: > First project and struggling a bit. > > I have some views that I want to restrict access to, depending on user > type. How do I do that? > > For example, I have a 'reports' view that I only want teachers to > see ... not students. I can't see how

Re: Passenger 57 - a Django query problem

2010-02-18 Thread Emily Rodgers
On Feb 18, 9:25 am, Atamert Ölçgen wrote: > Hi Sithembewena, > > On Thursday 18 February 2010 00:27:10 Sithembewena Lloyd Dube wrote:> Emily > provided an answer according to what she understood from the OP. No > > harm in doing that, at least not worse than no attempt at

Re: Passenger 57 - a Django query problem

2010-02-18 Thread Sithembewena Lloyd Dube
Apologies for my handling of this matter earlier. It was not the Python way :) Bruno, feel welcome here. On Thu, Feb 18, 2010 at 11:25 AM, Atamert Ölçgen wrote: > Hi Sithembewena, > > > On Thursday 18 February 2010 00:27:10 Sithembewena Lloyd Dube wrote: > > Emily provided

User permissions to see a view

2010-02-18 Thread ALJ
First project and struggling a bit. I have some views that I want to restrict access to, depending on user type. How do I do that? For example, I have a 'reports' view that I only want teachers to see ... not students. I can't see how to create a custom permission because there is no underlying

Re: Passenger 57 - a Django query problem

2010-02-18 Thread Atamert Ölçgen
Hi Sithembewena, On Thursday 18 February 2010 00:27:10 Sithembewena Lloyd Dube wrote: > Emily provided an answer according to what she understood from the OP. No > harm in doing that, at least not worse than no attempt at giving a > solution.. > > I think that people who have a problem with

Re: any suggestions for managing DB schema with visual ERD tool?

2010-02-18 Thread rebus_
On 18 February 2010 01:03, snfctech wrote: > I just built a complicated schema with MySQL workbench and am looking > at Python frameworks to start implementation. > > Does anybody in the Django community do this?  What's your practice > for going back and forth between

Re: any suggestions for managing DB schema with visual ERD tool?

2010-02-18 Thread Daniel Hilton
On 18 February 2010 00:03, snfctech wrote: > I just built a complicated schema with MySQL workbench and am looking > at Python frameworks to start implementation. > > Does anybody in the Django community do this?  What's your practice > for going back and forth between

Re: Passenger 57 - a Django query problem

2010-02-18 Thread bruno desthuilliers
On Feb 17, 11:32 pm, Sithembewena Lloyd Dube wrote: > Emily provided an answer according to what she understood from the OP. No > harm in doing that, > at least not worse than no attempt at giving a > solution.. I wouldn't have asked for precisions if I didn't intend to try

Re: Fine-grained object level permissions

2010-02-18 Thread bruno desthuilliers
On Feb 17, 11:53 pm, Jacek Furmankiewicz wrote: > We have a use where we need to limit access to particular *instances* > of objects. > It's not a simple case of add/delete/update permissions. > > Let's say a sales rep has his 5 customer he is responsible. > In the customer

  1   2   >