Search Results

Search found 17567 results on 703 pages for 'non admin'.

Page 28/703 | < Previous Page | 24 25 26 27 28 29 30 31 32 33 34 35  | Next Page >

  • How to make a model instance read-only after saving it once?

    - by Ryszard Szopa
    One of the functionalities in a Django project I am writing is sending a newsletter. I have a model, Newsletter and a function, send_newsletter, which I have registered to listen to Newsletter's post_save signal. When the newsletter object is saved via the admin interface, send_newsletter checks if created is True, and if yes it actually sends the mail. However, it doesn't make much sense to edit a newsletter that has already been sent, for the obvious reasons. Is there a way of making the Newsletter object read-only once it has been saved? Edit: I know I can override the save method of the object to raise an error or do nothin if the object existed. However, I don't see the point of doing that. As for the former, I don't know where to catch that error and how to communicate the user the fact that the object wasn't saved. As for the latter, giving the user false feedback (the admin interface saying that the save succeded) doesn't seem like a Good Thing. What I really want is allow the user to use the Admin interface to write the newsletter and send it, and then browse the newsletters that have already been sent. I would like the admin interface to show the data for sent newsletters in an non-editable input box, without the "Save" button. Alternatively I would like the "Save" button to be inactive.

    Read the article

  • How to provide an inline model field with a queryset choices without losing field value for inline r

    - by Judith Boonstra
    The code displayed below is providing the choices I need for the app field, and the choices I need for the attr field when using Admin. I am having a problem with the attr field on the inline form for already saved records. The attr selected for these saved does show in small print above the field, but not within the field itself. # MODELS: Class Vocab(models.Model): entity = models.Charfield, max_length = 40, unique = True) Class App(models.Model): name = models.ForeignKey(Vocab, related_name = 'vocab_appname', unique = True) app = SelfForeignKey('self, verbose_name = 'parent', blank = True, null = True) attr = models.ManyToManyField(Vocab, related_name = 'vocab_appattr', through ='AppAttr' def parqs(self): a method that provides a queryset consisting of available apps from vocab, excluding self and any apps within the current app's dependent line. def attrqs(self): a method that provides a queryset consisting of available attr from vocab excluding those already selected by current app, 2) those already selected by any apps within the current app's parent line, and 3) those selected by any apps within the current app's dependent line. Class AppAttr(models.Model): app = models.ForeignKey(App) attr = models.ForeignKey(Vocab) # FORMS: from models import AppAttr def appattr_form_callback(instance, field, *args, **kwargs) if field.name = 'attr': if instance: return field.formfield(queryset = instance.attrqs(), *kwargs) return field.formfield(*kwargs) # ADMIN: necessary imports class AppAttrInline(admin.TabularInline): model = AppAttr def get_formset(self, request, obj = None, **kwargs): kwargs['formfield_callback'] = curry(appattr_form_callback, obj) return super(AppAttrInline, self).get_formset(request, obj, **kwargs) class AppForm(forms.ModelForm): class Meta: model = App def __init__(self, *args, **kwargs): super(AppForm, self).__init__(*args, **kwargs) if self.instance.id is None: working = App.objects.all() else: thisrec = App.objects.get(id = self.instance.id) working = thisrec.parqs() self.fields['par'].queryset = working class AppAdmin(admin.ModelAdmin): form = AppForm inlines = [AppAttrInline,] fieldsets = .......... necessary register statements

    Read the article

  • What is best way to raise application events for use with admin network monitoring tools

    - by J Cooper
    In a semi-critical .NET service application, what would be a good strategy for raising application events that could be monitored by network administration tools? The events would be for errors, status changes, and possibly other notifications. My company is planning to use some kind of tool down the road to monitor all critical machines and services. As of right now they are using Spice Works to do some monitoring but it is not known if they will keep this down the road. By strategy I mean, perhaps using some sort of protocol ( my network admin has mentioned SNMP), perhaps a service such as windows event log. I have no idea what is available, so I'm leaving the options open. With that in mind, here is a list of preferences I came up with: Somewhat easy to use with .NET. Reliability Should work well with a variety of admin monitoring tools Works with non - windows monitoring tools Works with Spice Works

    Read the article

  • SharePoint 2007 Central Admin w3wp.exe process consumin 99% CPU

    - by Matrich
    Hi, I have been running an intranet using SharePoint 2007 for over a year and all has been working fine. However, after some time, I realized that the intranet portal was slow. Trying to access the Central Admin over another computer not the SharePoint server also became an issue. So I logged onto the real SharePoint Server and it took some ages to login and then was so slow even on the server unlike other times. When I checked the Task Manager, I found out that w3wp.exe was consuming 99% of the CPU speed. When I restarted the Central Admin App Pool, everything came back to normal and all was running well but after a few minutes (15 or so), it again became slow. I have checked the Event Logs and nothing conclusive was there to help me out. Anyone who has had this experience? or has any good resource? Please help. Thanks in advance

    Read the article

  • Admin required for Visual Studio 2008 Setup Project

    - by user54064
    I have a VS 2008 Setup Project that is installing a very simple application in the local user's App Folder. When the Setup Project runs, it is requiring the Admin to login to run it. How can I allow a Standard User to run the installation. There are no Prerequisites. The MSI file is the only file to be run (no Setup.exe). I have signed the msi with a certificate that is installed on the user's machine as Trusted. I just can't get rid of the Admin login requirement.

    Read the article

  • Of Datagridviews, databinding, and non validating cell values.

    - by Yanko Hernández Alvarez
    Lets simplify. Lets say I have this class: class T { public string Name { get; set; } public int Age { get; set; } public int height{ get; set; } ... } and I have a DataGridView's DataSource bound to a BindingList <T>, with N columns, each one bound to each property. I need to: Allow the user to enter non validating ages, heights, etc (for instance "aaa") Color the cells with non validating values (red background) Retain the non validating values displayed until the form is closed (I don't want to lose the values entered until the form is closed, so the user has the option to correct the bad cells anytime he wants BEFORE closing the form) Keep the last correct values entered for each cell with non validating values entered. When the form is closed, ditch the non validating values and keep the last correct values entered. Is there any easy way to do this?

    Read the article

  • Django: Admin with multiple sites & languages

    - by lazerscience
    Hi everybody! I'm supposed to build some Django apps, that allow you to administer multiple sites through one backend. The contrib.sites framework is quite perfect for my purposes. I can run multiple instances of manage.py with different settings for each site; but how should django's admin deal with different settings for different sites, eg. if they have different sets of languages, a different (default) language? So there are some problem s to face if you have to work on objects coming from different sites in one admin... I think settings.ADMIN_FOR is supposed to be quite helpful for cases like this, but theres hardly any documentation about it and I think it's not really used in the actual Django version (?). So any ideas/solutions are welcome and much appreciated! Thanks a lot...

    Read the article

  • Prepopulate drop-box according to another drop-box choice in Django Admin

    - by onorua
    I have models like this: class User(models.Model): Switch = models.ForeignKey(Switch, related_name='SwitchUsers') Port = models.ForeignKey(Port) class Switch(models.Model): Name = models.CharField(max_length=50) class Port(models.Model): PortNum = models.PositiveIntegerField() Switch = models.ForeignKey(Switch, related_name = "Ports") When I'm in Admin interface and choose Switch from Switches available, I would like to have Port prepopulated accordingly with Ports from the related Switch. As far as I understand I need to create some JS script to prepopulate it. Unfortunately I don't have this experience, and I would like to keep things simple as it possible and don't rewrite all Django admin interface. Just add this functionality for one Field. Could you please help me with my problem? Thank you.

    Read the article

  • Overriding the admin Media class

    - by shacker
    Given an admin media class that sets up a rich text editor, like: class TutorialAdmin(admin.ModelAdmin): fields... class Media: js = ['/paths/to/tinymce.js',] I would like the ability to selectively override js depending on a field value in the model it references. I've added a "use_editor" boolean to the Tutorial model. The question is, how can I detect whether the current instance has that bool set? I'd like to end up with something like: class Media: if self.use_editor: js = ['/path/to/tinymce.js',] else: js = '' Ideas? Thanks.

    Read the article

  • Wordpress: Not able to retrieve css for new plugin in admin mode

    - by Steven
    I'm creating a new plugin which will have it's own css file. The css file resides in the root folder of the plugin. In the plugin section of the admin interface, I have added a few text fields fields. But the CSS is not applied. I'm adding the CSS file using this code: // Register styling add_action('admin_init', 'event_styles'); function event_styles() { wp_register_style('event_cal', plugins_url('eventcall.css',__FILE__)); wp_enqueue_style('event_cal'); } The following code gives me the CSS path: echo plugins_url('eventcall.css',__FILE__); and outputs http://mysite.com/wp-content/plugins/wp-eventcal/eventcall.css If I try to enter this URL directly in the browser, it only shows me the front page. And if I look in the source code using Firebug, where the link to the CSS should be, I only find the entire HTML code for the front page. Am I using wrong code to use backend in admin interface? In my HOST file, I have added ``

    Read the article

  • What's the correct way to hide/prevent access to wp-admin

    - by Jaypee
    I'm dealing with this matter since a while, I have read a ton of articles and stuff out there but I couldn't find a place that shows the RIGHT way, standard, correct, whatever you like to call it, to prevent access to my wp-admin or wp-login.php On all Wordpress sites I see (the well made ones) you will never see anything if you type thesite.com/wp-admin As I could see, one way to do this is by restricting the access to that folder by creating an .htaccess file and restrict by IP the access to the folder. Seems to be the "cleanest" way to do. What I'm not sure about it is that I have a dynamic address provided by my ISP, so on a certain time my IP will change, that will force me to also change the .htaccess to my new address, I don't see that practical. I can set a range also, but by doing that I will also authorize access to all people within that range of IPs (other clients of my ISP for example). I'm then struggling to find the best/standard way to do this. Anyone can help me? Thanks

    Read the article

  • Django-admin.py not being recognized suddenly

    - by Jen Camara
    I tried starting a new Django project yesterday but when I did "django-admin.py startproject projectname" I got an error stating: "django-admin.py is not recognized as an internal or external command." The strange thing is, when I first installed Django, I made a few projects and everything worked fine. But now after going back a few months later it has suddenly stopped working. I've tried looking around for an answer and all I could find is that this typically has to do with the system path settings, however, I know that I have the proper paths set up so I don't understand what's happening. Does anybody have any idea what's going on?

    Read the article

  • Using jQuery in WordPress plugin admin page?

    - by Volmar
    I have a strange problem that probably have a really simple explanation that i've just havn't found. I'm making a WordPress plugin and i want to use jQuery in my settings-page for the plugin. My JS functions look like this: jQuery(document).ready(function() { alert('load test'); //ADMIN FUNCTION $('#mrc_imp_img').click(function(){ alert("test"); }); //FRONT END FUNCTION $("ul.mrc li").hover(function() { $(this).find('p').fadeIn(); } , function() { $(this).find('p').fadeOut(); }); }); The "load test"-alert is being loaded when the document is ready so jquery is properly loaded. The front end function is being used on pages and that's working fine to. the problem is the admin function, it's not working at all. is there a speial way i have to write a .click()-function to get it to work on my settings-page for the wordpress plugin?

    Read the article

  • Best way to implement symfony admin components

    - by Chris T
    I am coding a backend in symfony using the sfThemePlugin (part of sympal). The dashboard should allow for new "admin plugins" to be added fairly easily. What I'd like is to have a config.yml config like this: sf_easy_admin_plugin: enabled_admin_dashboard_plugins: [Twitter, QuickBlogPost, QuickConfig] and when these are set it includes the correct components into the template. I'd like to have each one be in it's own plugin (sfTwitterEasyAdminModule, sfQuickBlogPostEasyAdminModule) or have them all bundled in one (sfEasyAdminModules). Is there anyway to accomplish this? As far I know symfonys include_component() only let's you include components from the current module and not from other plugins. Each "component" or admin plugin should render an icon for the dashboard and a html form that will be hidden until the user clicks the icon.

    Read the article

  • Flask Admin didn't show all fields

    - by twoface88
    I have model like this: class User(db.Model): __tablename__ = 'users' __table_args__ = {'mysql_engine' : 'InnoDB', 'mysql_charset' : 'utf8'} id = db.Column(db.Integer, primary_key=True) username = db.Column(db.String(80), unique=True) email = db.Column(db.String(120), unique=True) _password = db.Column('password', db.String(80)) def __init__(self, username = None, email = None, password = None): self.username = username self.email = email self._set_password(password) def _set_password(self, password): self._password = generate_password_hash(password) def _get_password(self): return self._password def check_password(self, password): return check_password_hash(self._password, password) password = db.synonym("_password", descriptor=property(_get_password, _set_password)) def __repr__(self): return '<User %r>' % self.username I have ModelView: class UserAdmin(sqlamodel.ModelView): searchable_columns = ('username', 'email') excluded_list_columns = ['password'] list_columns = ('username', 'email') form_columns = ('username', 'email', 'password') But no matter what i do, flask admin didn't show password field when i'm editing user info. Is there any way ? Even just to edit hash code. UPDATE: https://github.com/mrjoes/flask-admin/issues/78

    Read the article

  • non-blocking socket client connection

    - by Igor
    ALL, I am looking for a simple example of non-blocking socket connection that will run on Windows. I tried to Google, but all samples are either for *nix (POSIX) or blocking sockets on Windows. Looking thru msdn I see that it is easy to make a socket non-blocking and issue a connect(), but then you need some preparation in order to put the socket back. So, all in all I need something on a non-blocking socket that will connect and then put it back to be blocking. The read and write operation should be performed on the blocking socket. The reason for a non-blocking socket is that I need a connection timeout and there is no other way than non-blocking socket. Or is there? Thank you.

    Read the article

  • Deleting inline model in Django admin

    - by Overclocked
    I am trying to use Django admin to remove an inline model. I get an error saying [u'Select a valid choice. That choice is not one of the available choices.'] I check the location where the exception is raised. It seems like the inline model was removed, then a form validation happened on the parent model with the deleted inline model still as value of the form. That caused the failure. In my admin model, I had a save_formset method defined, that called formset.save(commit=False). Is the commit=False not telling Django to not delete the related models? Thanks.

    Read the article

  • Find and sort by number of ocurrences of tag with Active Admin and act_as_taggable_on

    - by nunopolonia
    I'm using act_as_taggable_on and Active Admin on a Rails project. In that project there are Posts and each Post has Tags. I want to show a list of Tags in Active Admin and the number of ocurrences of each one. The way I found to do this was: index do column :name column :ocurrences do |tag| ocurrences = Post.tag_counts.find(tag.id).count end default_actions end Which will search the Tag List every time for every Post, which performance wise looks really bad. I would also like to be able to sort the tags by ocurrence. Any idea of how I can do it?

    Read the article

  • Editing PHP using PHP (admin center)

    - by Alec Smart
    Hello, Am developing an admin center where I can edit configuration files (written in PHP). I do NOT want to store these values in a mySQL table (for various reasons). So say my config.php has contents like: <?php $option1 = 1; $option2 = 2; $option4 = 5; $option7 = array('test','a','b',c'); ?> Now say in one of the admin pages I will only be changing a few values like option2 or option4 etc. Any ideas on what would be the best way to go about this. I know one option is to read the PHP file completely and write parts of it using REGEX. Any way to make this more efficent? I don't want the config.php file to break because of some error on the user's end. Any ideas on how to ensure that it works?

    Read the article

  • Web-based (intranet / non-hosted) timesheet / project tracking tools

    - by warren
    I realize some similar questions have been asked along these lines before, but from reading-through them today, it appears they don't match my use case. I am looking for a web-based, non-hosted time and project tracking tool. I've downloaded Collabtive so far, but am looking for other suggestions, too. My list of requirements: runs on standard LAMP stack non-hosted (ie, there is an option to download and run it on a local server) not a desktop/single-user application easy-to-use - my audience is a mix of technical and non-technical folks easy to maintain - when time for upgrading comes, I'd really like to not have to rebuild the app (a la ./configure ; make ; make install) needs to support multiple users free-form project additions: we don't have a central project management authority (users should be able to add whatever they're working on, not merely from a drop-down) Does anyone here have experience with such tools? It doesn't have to be free.. but free is always nice :)

    Read the article

  • Web-based (intranet / non-hosted) timesheet / project tracking tools

    - by warren
    I realize some similar questions have been asked along these lines before, but from reading-through them today, it appears they don't match my use case. I am looking for a web-based, non-hosted time and project tracking tool. I've downloaded Collabtive and Achievo so far, but am looking for other suggestions, too. My list of requirements: runs on standard LAMP stack non-hosted (ie, there is an option to download and run it on a local server) not a desktop/single-user application easy-to-use - my audience is a mix of technical and non-technical folks easy to maintain - when time for upgrading comes, I'd really like to not have to rebuild the app (a la ./configure ; make ; make install) needs to support multiple users free-form project additions: we don't have a central project management authority (users should be able to add whatever they're working on, not merely from a drop-down) Does anyone here have experience with such tools? It doesn't have to be free.. but free is always nice :)

    Read the article

  • ESXi with non-headless VM

    - by Mike
    I'm going to receive a Xeon Server/Workstation soon and I was thinking about installing ESXi to host some server applications that I want (ex: SVN server, Web server, media server, etc). Most of these will be headless VM's. My question is: on top of all these headless VM's, is it possible for ESXi to have another VM that would be non-headless (so that it will output video through the VGA/DVI port)? Or are all VM's within ESXi only accessible through remote connections? I'll be using this non-headless VM like a regular workstation: browsing, development, media, gaming maybe. The other alternative I was thinking about is to install a very lightweight operating system and have the headless VM's running in Virtualbox. If it is possible to have have a non-headless VM, what would be the performance compared to a regular workstation? Noticeable or not when gaming?

    Read the article

  • non-mapped virtual memory & total number of connections

    - by tszming
    We have two MongoDB data nodes (replica set) - Primary & Secondary. I noticed that the non-mapped virtual memory is relatively high and wondering if they are hurting our MongoDB performance (The server usually peaked at around 6-7K queries per sec). In MMS, it was stated: "The most common case of usage of a high amount of memory for non-mapped is that there are very many connections to the database." So we checked the memory usage with db.serverStatus().mem in our Secondary: { "bits" : 64, "resident" : 6846, "virtual" : 416797, "supported" : true, "mapped" : 205549, "mappedWithJournal" : 411098, "note" : "virtual minus mapped is large. could indicate a memory leak" } Note: We are using 2.0.4 and now the default stack size should be 1MB per connection. The current number of connections is around 1.1K, but the non-mapped virtual memory (virtual-mappedWithJournal) is around 5699 MB. The trend is quite stable so I can't say there is a leak here, but where is the memory gone? Any idea?

    Read the article

< Previous Page | 24 25 26 27 28 29 30 31 32 33 34 35  | Next Page >