Search Results

Search found 7445 results on 298 pages for 'admin rights'.

Page 6/298 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • Django Admin Running Same Query Thousands of Times for Model

    - by Tom
    Running into an odd . . . loop when trying to view a model in the Django admin. I have three related models (code trimmed for brevity, hopefully I didn't trim something I shouldn't have): class Association(models.Model): somecompany_entity_id = models.CharField(max_length=10, db_index=True) name = models.CharField(max_length=200) def __unicode__(self): return self.name class ResidentialUnit(models.Model): building = models.CharField(max_length=10) app_number = models.CharField(max_length=10) unit_number = models.CharField(max_length=10) unit_description = models.CharField(max_length=100, blank=True) association = models.ForeignKey(Association) created = models.DateTimeField(auto_now_add=True) updated = models.DateTimeField(auto_now=True) def __unicode__(self): return '%s: %s, Unit %s' % (self.association, self.building, self.unit_number) class Resident(models.Model): unit = models.ForeignKey(ResidentialUnit) type = models.CharField(max_length=20, blank=True, default='') lookup_key = models.CharField(max_length=200) jenark_id = models.CharField(max_length=20, blank=True) user = models.ForeignKey(User) is_association_admin = models.BooleanField(default=False, db_index=True) show_in_contact_list = models.BooleanField(default=False, db_index=True) created = models.DateTimeField(auto_now_add=True) updated = models.DateTimeField(auto_now=True) _phones = {} home_phone = None work_phone = None cell_phone = None app_number = None account_cache_key = None def __unicode__(self): return '%s' % self.user.get_full_name() It's the last model that's causing the problem. Trying to look at a Resident in the admin takes 10-20 seconds. If I take 'self.association' out of the __unicode__ method for ResidentialUnit, a resident page renders pretty quickly. Looking at it in the debug toolbar, without the association name in ResidentialUnit (which is a foreign key on Resident), the page runs 14 queries. With the association name put back in, it runs a far more impressive 4,872 queries. The strangest part is the extra queries all seem to be looking up the association name. They all come from the same line, the __unicode__ method for ResidentialUnit. Each one is the exact same thing, e.g., SELECT `residents_association`.`id`, `residents_association`.`jenark_entity_id`, `residents_association`.`name` FROM `residents_association` WHERE `residents_association`.`id` = 1096 ORDER BY `residents_association`.`name` ASC I assume I've managed to create a circular reference, but if it were truly circular, it would just die, not run 4000x and then return. Having trouble finding a good Google or StackOverflow result for this.

    Read the article

  • How do large companies handle software updates for users without administrative rights?

    - by CT
    I just started working for a small-medium size company doing IT support. Maybe 150 or less users. Right now every user has administrative rights to their own machine. This allows them to install updates or whatever else they would like to. I'm tired of getting on user's machines that are bloated with crap they put on themselves. So my first thought would be to take away administrative rights to their computer. This would also have other advantages such as preventing a lot of drive-by malware on the web etc. The problem arises that users are unable to install updates. (Even though I find most ignore these anyway) How do large companies handle software updates on all client machines? EDIT: Windows environment. Most servers are Windows Server 2003 Enterprise. Clients are all Windows. Win XP, Vista, and 7.

    Read the article

  • How to add manytomany field to flatpage admin

    - by valya
    Hello! I have a site with Flatpages, and now I need to be able to add galleries (Gallery model) to the page. This is going to be ManyToManyField, so there is no need to change the flatpages table. But I still can't define ManyToManyField in proxy class. I can define ManyToManyField in Gallery model, but it isn't comfortable for the client. How can I change FlatPage Admin to add a ManyToManyField from Galleries model?

    Read the article

  • Symfony - admin - FormFilter - is empty - i18n

    - by Mailo
    Hi, we are in admin generator in filters in field. What is the most clearest way to translate is empty label under form fields? I've solve it by own setWidgets and setWidgets in BaseFormFilterDoctrine witch extend the parent methods by translating that is empty( empty_label ). setWidgets - translate all *empty_label*s in form filter( for base filter class ) setWidget - translate *empty_label* for one filter field( for the extending filter class ) It works, but i think it's nasty. I am looking for something more clean

    Read the article

  • Django Admin Form for Many to many relationship

    - by Anand
    I have a many to many relationship between 2 tables Users an Domains. I have defined this relationship in the Domains class. So in the admin interface I see the Users when I am viewing Domains. But I do not see Domains when I am viewing Users. How can I achieve this.

    Read the article

  • django admin - adding fields on the fly

    - by Thomas
    Basically I am writing a simple shopping cart. Each item can have multiple prices. (i.e. shirts where each size is priced differently). I would like to have a single price field in my admin panel, where when the first price is entered, an additional price field pops up. However I am kind of at a loss as to how to do this. What would be the best way to do this?

    Read the article

  • Django model: Reference foreign key table in __unicode__ function for admin

    - by pa
    Example models: class Parent(models.Model): name = models.CharField() def __unicode__(self): return self.name class Child(models.Model): parent = models.ForeignKey(Parent) def __unicode__(self): return self.parent.name # Would reference name above I'm wanting the Child.unicode to refer to Parent.name, mostly for the admin section so I don't end up with "Child object" or similar, I'd prefer to display it more like "Child of ". Is this possible? Most of what I've tried hasn't worked unfortunately.

    Read the article

  • How to display total record count against models in django admin

    - by Rog
    Is there a neat way to make the record/object count for a model appear on the main model list in the admin module? I have found techniques for showing counts of related objects within sets in the list_display page (and I can see the total in the pagination section at the bottom of the same), but haven't come across a neat way to show the record count at the model list level.

    Read the article

  • Django: How to set default language in admin on login

    - by lazerscience
    I'm saving an user's default language in his user profile and on login I want to set the admin's default language to it. One possibility I was thinking of is using a middleware, but I think if I do it on process_request I will not see an user object there since this is processed AFTER the middleware, so I could only set it after the next request! Any solutions are highly appreciated!

    Read the article

  • Django: name of many to many items in the admin interface

    - by Adam
    I have a many to many field, which I'm displaying in the django admin panel. When I add multiple items, they all come up as "ASGGroup object" in the display selector. Instead, I want them to come up as whatever the ASGGroup.name field is set to. How do I do this? My models looks like: class Thing(Model): read_groups = ManyToManyField('ASGGroup', related_name="thing_read", blank=True) class ASGGroup(Model): name = CharField(max_length=63, null=True) But what I'm seeing the m2m widget display is:

    Read the article

  • Accessing updated M2M fields in overriden save() in django's admin

    - by Jonathan
    I'd like to use the user updated values of a ManyToManyField in a model's overriden save() method when I save an instance in admin. It turns out that by design, django does not update the M2M field before calling save(), but only after the save() is complete as part of the form save... How can I access the new values of this field in the override save() ?

    Read the article

  • wierd FileField url in admin site

    - by panchicore
    My model class TheFile(models.Model): document = models.FileField(upload_to="archivos") The wierd HTML admin link: <a hacking_google_maps_and_google_earth.pdf="" archivos="" media="" localhost:8000="" http:="" href="" target="_blank">archivos/Hacking_Google_Maps_And_Google_Earth.pdf</a> If I firebug-edit the href="" it works :S

    Read the article

  • weird FileField url in admin site

    - by panchicore
    My model class TheFile(models.Model): document = models.FileField(upload_to="archivos") The weird HTML admin link: <a hacking_google_maps_and_google_earth.pdf="" archivos="" media="" localhost:8000="" http:="" href="" target="_blank">archivos/Hacking_Google_Maps_And_Google_Earth.pdf</a> If I firebug-edit the href="" it works :S

    Read the article

  • displaying list of registered user in django-admin

    - by theactiveactor
    My Book model has an author attribute which today is simply a CharField. The value for author should be one of the registered users of my Django site. When creating a new Book object in Django admin, I would like author to be displayed as a combo box showing all registered users. How would I go about achieving this?

    Read the article

  • how to customize django admin for clickable list_editable

    - by FurtiveFelon
    Hi all, Currently, i have a class MyAdmin(admin.ModelAdmin), and i have a field in there called name, which belongs to both list_editable and list_display. The current behavior is such that all fields that is in list_editable displays a form field. However, i would like to change that only when people click on the field would it turn into a editable form field. Can anyone point me in the right direction on how to do that (which template to edit etc.). Thank you very much! Jason

    Read the article

  • Need "starting point" hints about adding "tabbed" interface to Django admin

    - by Edwin
    Hi, I'm new to the web development world - that means I'm new to javaScript/CSS. Now I'm building a web system with Python Django. I'm wondering would you like to give me some hints as the starting point for adding "tabbed" interface to Django admin? For example, there are 3 detail table for a master table, and I want to use 3 different tabs for editing that 3 detail tables in the 'edit' page for the master table. Thank you in advance!

    Read the article

  • SelectDateWidget in Django Admin?

    - by Maria
    Can i change default AdminDateWidget to SelectDateWidget in my models? How can i do this? I try: class RespondentAdmin(admin.ModelAdmin): formfield_overrides = { models.DateField: {'widget': SelectDateWidget}, } but it doesn't work

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >