Search Results

Search found 7702 results on 309 pages for 'django validation'.

Page 100/309 | < Previous Page | 96 97 98 99 100 101 102 103 104 105 106 107  | Next Page >

  • Is there a way to test my nonce validation fails when it should?

    - by MrsLannister
    I'm using nonce validation in a wordpress plugin. When I submit the form from the admin menu it processes correctly, so I believe the nonce validation is working. What I'm not sure is if the validation will fail when it is supposed to and I don't know what the best way to test this is. I tried putting the url for the php file in directly, but all it does it take me to a wordpress not found page. Is there some recommended way to test this? Here is my code. Again, the test passes when it is supposed to, I just don't know if it fails when it is supposed to. if ( !wp_verify_nonce( $ecbs_post_data['_wpnonce'], 'ecbs-edit-templates' ) ) { wp_die( __( 'You do not have permission to update this page.' ) ); }

    Read the article

  • SharePoint, HTTP Modules, and Page Validation

    - by Damon Armstrong
    Sometimes I really believe that SharePoint actively thwarts my attempts to get it to do what I want.  First you look at something and say, wow, that should work.  Then you realize it doesn’t.  Then you have an epiphany and see a workaround.  And when you almost have that work around working… well then SharePoint says no again.  Then it’s off on another whirl-wind adventure to find a work around for the workaround.  I had one of those issues today, but I think I finally got past the last roadblock. So, I was writing an HTTP module as a workaround for another problem.  Everything looked like it was working great because I had been slowly adding code into the HTTP module bit by bit in a prototyping effort.  Finally I put in the last bit of code in place… and I started to get an error: “The security validation for this page is invalid. Click Back in your Web browser, refresh the page, and try your operation again.” This is not an uncommon error – it normally occurs when you are updating an item on a GET request and you have not marked the web containing the item with AllowUnsafeUpdates.  One issue, however, is that I wasn’t updating anything in my code.  I was, however, getting an SPWeb object so I decided to set the AllowUnsafeUpdates property on it to true for good measure. Once that was in place, I ran it again… “The security validation for this page is invalid. Click Back in your Web browser, refresh the page, and try your operation again.” WTF?!?!  I really expected that setting the AllowUnsafeUpdates property on the SPWeb would fix the issue, but clearly that was not the case.  I have had occasion to disassemble some SharePoint code with .NET Reflector in the past, and one of the things SharePoint abuses a bit more than it should is the HttpContext.  One way to avoid this abuse is to clear out the HttpContext while your code runs and then set it back once you are done.  I tried this next, and everything worked out just like I had expected.  So, if you are building an HTTP Module for SharePoint and some code that you are running ends up giving you a security validation error, remember to try running that code with AllowUnsafeUpdates turned on and try running the code with the HttpContext nulled out (just remember to set it back after your code runs or else you’ll really jack things up).

    Read the article

  • Silverlight TV 18: WCF RIA Services Validation

    Just prior to MIX10, Nikhil Kothari appears on the show to demonstrate some of the key advantages around validation when using WCF RIA Services. He demonstrates how to use a Domain Service to expose your domain model and how to create a custom service method to further filter your data server side. Nikhil also shows how the Domain Services generates validation rules using the database attributes such as required fields or maximum string lengths. Other topics Nikhil covers: Domain service generated...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • Apache cannot find mysql database modules

    - by user809857
    I've created a simple django project and setup a mysql database. My simple project just creates an entry on the database. The project works fine when I use the built in development server provided by django (runserver) and it works well. But when I deployed the project on Apache and mod_Wsgi (Ubuntu server), django could not find 'books', which is in this case my table in the database. The mysql database that I use in runserver and apache are just the same. I also did rebuild the database using sqlall,validate and syncdb of django but still i get the error. What could be wrong with what I'm doing? Thanks

    Read the article

  • Apache cannot find mysql database modules

    - by user809857
    I've created a simple django project and setup a mysql database. My simple project just creates an entry on the database. The project works fine when I use the built in development server provided by django (runserver) and it works well. But when I deployed the project on Apache and mod_Wsgi (Ubuntu server), django could not find 'books', which is in this case my table in the database. The mysql database that I use in runserver and apache are just the same. I also did rebuild the database using sqlall,validate and syncdb of django but still i get the error. What could be wrong with what I'm doing? Thanks

    Read the article

  • Request Validation in ASP.NET 4.0

    - by Ben Bastiaensen
    Up to ASP.NET 3.5 Request Validation is enabled by default. In order to to disable this for a page you needed to set the ValidationRequest property in the page directive to false. This is no longer the default case in ASP.NET 4.0. If you want to use this behaviour you need to add the follwing setting in web.config  <httpRuntime requestValidationMode="2.0" /> Of course you need to check all input in the page for XSS or other malicious input if you set the pages request validation to false.

    Read the article

  • RIA Services and Validation

    Earlier today, my SilverlightTV recording on RIA Services and Validation went online. I used validation as a feature area to focus on this first recording on RIA Services, because I think it illustrates both the RIA Services value proposition and key elements of the vision around the project in a very direct manner. Specifically: Focus on end-to-end solutions for data scenarios. It is not sufficient to just address querying data or submitting some changes, but about providing the infrastructure...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • Form Validation, Dependant Drop Downs, Data Level Security in OWS for DotNetNuke - 5 Videos

    In this tutorial we demonstrate some very advanced techniques for building a car parts application in Open Web Studio. Throughout the tutorial we cover form input, validation, how to use dependant drop down lists, populating checkbox lists and introduce a new concept of data level security. Data level security allows you to control which data a user can access within a module. The videos contain: Video 1 - How to Setup Form Validation Video 2 - Car Parts Application, Assigning Security Roles into a Global Session Variable Video 3 - How to Build the Categories Module with Data Level Security Video 4 - How to Build the SubCategories Module and Use SubQuery Video 5 - How to Build the Car Parts List Module Total Time Length: 44min 19secsDid you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • Completing a Basic ASP.NET 3.5 User Input Validation Project

    You learned the basics and configuration steps of the most common types of validation web controls used in ASP.NET 3.5 in the first two parts of this tutorial series. In this last part you will learn how to integrate all of these validation web controls in a working ASP.NET project. You will also learn not only how to validate user input in the client side but also how to validate the page on the server side.... Microsoft SQL Server? Value Calculator Reduce Costs & Increase Value with Microsoft SQL Server? 2008. Download Today!

    Read the article

  • MySQL efficiency as it relates to the database/table size

    - by mlissner
    I'm building a system using django, Sphinx and MySQL that's very quickly becoming quite large. The database currently has about 2000 rows, and I've written a program that's going to populate it with another 40,000 rows in a couple days. Since the database is live right now, and since I've never had a database with this much information in it, I'm worried about some things: Is adding all these rows going to seriously degrade the efficiency of my django app? Will I need to go back through it and optimize all my database calls so they're doing things more cleverly? Or will this make the database slow all around to the extent that I can't do anything about it at all? If you scoff at my 40k rows, then, my next question is, at what point SHOULD I be concerned? I will likely be adding another couple hundred thousand soon, so I worry, and I fret. How is sphinx going to feel about all this? Is it going to freak out when it realizes it has to index all this data? Or will it be fine? Is this normal for it? If it is, at what point should I be concerned that it's too much data for Sphinx? Thanks for any thoughts.

    Read the article

  • Select those objects whose related objects IDs are *all* in given string

    - by Jannis
    Hi Django people, I want to build a frontend to a recipe database which enables the user to search for a list of recipes which are cookable with the ingredients the user supplies. I have the following models class Ingredient(models.Model): name = models.CharField(max_length=100, unique=True) slug = models.SlugField(max_length=100, unique=True) importancy = models.PositiveSmallIntegerField(default=4) […] class Amount(models.Model): recipe = models.ForeignKey('Recipe') ingredient = models.ForeignKey(Ingredient) […] class Rezept(models.Model): name = models.CharField(max_length=100) slug = models.SlugField() instructions = models.TextField() ingredients = models.ManyToManyField(Ingredient, through=Amount) […] and a rawquery which does exactly what I want: It gets all the recipes whose required ingredients are all contained in the list of strings that the user supplies. If he supplies more than necessary, it's fine too. query = "SELECT *, COUNT(amount.zutat_id) AS selected_count_ingredients, (SELECT COUNT(*) FROM amount WHERE amount.recipe_id = amount.id) AS count_ingredients FROM amount LEFT OUTER JOIN amount ON (recipe.id = recipe.recipe_id) WHERE amount.ingredient_id IN (%s) GROUP BY amount.id HAVING count_ingredient=selected_count_ingredient" % ",".join([str(ingredient.id) for ingredient in ingredients]) rezepte = Rezept.objects.raw(query) Now, what I'm looking for is a way that does not rely on .raw() as I would like to do it purely with Django's queryset methods. Additionally, it would be awesome if you guys knew a way of including the ingredient's importancy in the lookup so that a recipe is still shown as a result even though one of its ingredients (that has an importancy of 0) is not supplied by the user.

    Read the article

  • Dynamically setting the queryset of a ModelMultipleChoiceField to a custom recordset

    - by Daniel Quinn
    I've seen all the howtos about how you can set a ModelMultipleChoiceField to use a custom queryset and I've tried them and they work. However, they all use the same paradigm: the queryset is just a filtered list of the same objects. In my case, I'm trying to get the admin to draw a multiselect form that instead of using usernames as the text portion of the , I'd like to use the name field from my account class. Here's a breakdown of what I've got: # models.py class Account(models.Model): name = models.CharField(max_length=128,help_text="A display name that people understand") user = models.ForeignKey(User, unique=True) # Tied to the User class in settings.py class Organisation(models.Model): administrators = models.ManyToManyField(User) # admin.py from django.forms import ModelMultipleChoiceField from django.contrib.auth.models import User class OrganisationAdminForm(forms.ModelForm): def __init__(self, *args, **kwargs): from ethico.accounts.models import Account self.base_fields["administrators"] = ModelMultipleChoiceField( queryset=User.objects.all(), required=False ) super(OrganisationAdminForm, self).__init__(*args, **kwargs) class Meta: model = Organisation This works, however, I want queryset above to draw a selectbox with the Account.name property and the User.id property. This didn't work: queryset=Account.objects.all().order_by("name").values_list("user","name") It failed with this error: 'tuple' object has no attribute 'pk' I figured that this would be easy, but it's turned into hours of dead-ends. Anyone care to shed some light?

    Read the article

  • Blocking error in celery

    - by dmitry
    I have no idea what's this. Python 2.7 + django-1.5.1 + httpd + rabbitmq + django-celery==3.0.17 Tasks are not executed because of some error. Below is celery's log. Maybe someone has faced it before. [2013-06-24 17:10:03,792: CRITICAL/MainProcess] Can't decode message body: AttributeError("'JoinInfo' object has no attribute '__dict__'",) (type:u'application/x-python-serialize' encoding:u'binary' raw:'\'\\x80\\x02}q\\x01(U\\x07expiresq\\x02NU\\x03utcq\\x03\\x88U\\x04argsq\\x04cdjango.contrib.auth.models\\nUser\\nq\\x05)\\x81q\\x06}q\\x07(U\\x08usernameq\\x08X\\x19\\x00\\x00\\[email protected]\\nfirst_nameq\\tX\\x05\\x00\\x00\\x00BibbyU\\tlast_nameq\\nX\\x08\\x00\\x00\\x00OffshoreU\\r_client_cacheq\\x0bccopy_reg\\n_reconstructor\\nq\\x0ccbongoregistration.models\\nClient\\nq\\rc__builtin__\\nobject\\nq\\x0eN\\x87Rq\\x0f}q\\x10(h\\nX\\x08\\x00\\x00\\x00OffshoreU\\x1bpurchase_confirmation_emailq\\x11X\\x1f\\x00\\x00\\[email protected]\\x1dpurchase_confirmation_email_1q\\x12X!\\x00\\x00\\[email protected]\\x06_stateq\\x13cdjango.db.models.base\\nModelState\\nq\\x14)\\x81q\\x15}q\\x16(U\\x06addingq\\x17\\x89U\\x02dbq\\x18U\\x07defaultq\\x19ubU\\x0buser_ptr_idq\\x1aJ\\xb4\\xa2\\x03\\x00U\\x08is_staffq\\x1b\\x89U\\x08postcodeq\\x1cX\\x08\\x00\\x00\\x00AB11 5BSU\\x0cdegree_limitq\\x1dK\\x06U\\x07messageq\\x1eX\\xd1E\\x00\\x00<table id="container" style="margin: 0px; padding: 0px; width: 100%; background-color: #ffffff;" cellspacing="0" cellpadding="0"... (22911b)'') Traceback (most recent call last): File "/opt/www/MyProject-main/eggs/kombu-2.5.10-py2.7.egg/kombu/messaging.py", line 556, in _receive_callback decoded = None if on_m else message.decode() File "/opt/www/MyProject-main/eggs/kombu-2.5.10-py2.7.egg/kombu/transport/base.py", line 147, in decode self.content_encoding, accept=self.accept) File "/opt/www/MyProject-main/eggs/kombu-2.5.10-py2.7.egg/kombu/serialization.py", line 187, in decode return decode(data) File "/opt/www/MyProject-main/eggs/kombu-2.5.10-py2.7.egg/kombu/serialization.py", line 74, in pickle_loads return load(BytesIO(s)) AttributeError: 'JoinInfo' object has no attribute '__dict__'

    Read the article

  • Firefox handles xxx.submit(), Safari doesn't ... what can be done?

    - by Prairiedogg
    I'm trying to make a pull down menu post a form when the user selects (releases the mouse) on one of the options from the menu. This code works fine in FF but Safari, for some reason, doesn't submit the form. I re-wrote the code using jquery to see if jquery's .submit() implementation handled the browser quirks better. Same result, works in FF doesn't work in safari. The following snippets are from the same page, which has some django template language mixed in. Here's the vanilla js attempt: function formSubmit(lang) { if (lang != '{{ LANGUAGE_CODE }}') { document.getElementById("setlang_form").submit(); } } Here's the jquery attempt: $(document).ready(function() { $('#lang_submit').hide() $('#setlang_form option').mouseup(function () { if ($(this).attr('value') != '{{ LANGUAGE_CODE }}') { $('#setlang_form').submit() } }); }); and here's the form: <form id="setlang_form" method="post" action="{% url django.views.i18n.set_language %}"> <fieldset> <select name="language"> {% for lang in interface_languages %} <option value="{{ lang.code }}" onmouseup="formSubmit('{{ lang.name }}')" {% ifequal lang.code LANGUAGE_CODE %}selected="selected"{% endifequal %}>{{ lang.name }}</option> {% endfor %} </select> </fieldset> </form> My question is, how can I get this working in Safari?

    Read the article

  • How do I disable "eager" validation entirely using jquery validate ?

    - by Kevin J
    Is there a way to disable "eager" validation using the jquery.validate plugin? Either through an option in the script or as a hack? "Eager" validation kicks in once the form has been validated once - after that, invalid fields are validated onfocusout. I want to disable this behavior, and change my forms to only be validated when the submit button is pressed. I don't mind hacking through the validate script itself also, so if that's what the solution requires that's acceptable.

    Read the article

  • What techniques are being used to pass MVC ModelState validation errors back to the client when usin

    - by Jon Erickson
    I'm sort of thinking out loud here, so let me know if I need to clarify... on ajax heavy sites, when using JsonResult to pass information back to the client, what techniques, patterns, best practices are being used to pass ModelState validation errors back to the client? I am using xVal and castle validation on my view models, is there some sort of standard to get jquery validate to display errors coming from ajax responses?

    Read the article

  • The Silverlight 3 Toolkit styles prevent the displaying of SL 3.0 data validation errors.

    - by RayMartinsHair
    Hi, If I apply a style from the SL 3.0 Toolkit to my application the built in SL 3.0 data validation errors are not displayed on the application edit forms. If I removed the code that applies the toolkit style to the application the SL 3.0 data validation errors appear as per normal SL 3.0 behaviour? Has anyone else come across this problem????? Any help is always appreciated. Cheers Adam

    Read the article

  • Jquery AJAX: How to display the Flash error message when validation on the server side fails?

    - by Shripad K
    I am using the Jquery form plugin to submit the form via ajax. I have set up validations on the server side in my models. Now when the validation fails i want to display the same flash[:error] message to the user using ajax. If the validation succeeds I can display the flash[:notice] as it is available after the request is completed. How do i go about displaying flash[:error]?

    Read the article

  • ASP.Net MVC + Live validation - how come the flagged text are all over the place?

    - by melaos
    hi guys, this is an asp.net mvc project and <% using (Html.BeginForm("ProductAdded", "Home")) { % Register Your Product <%= ViewData["MainHeader"]% <p><%=ViewData["IntroText"]%></p> <div style="display: none;"> <div id="regionThreePane"> <table border="0" cellpadding="0" cellspacing="0" frame="void" style="width: 100%"> <tr> <td width='250px'><select name="ProdLBox1" id="ProdLBox1" class="ProdLBox1" size="8"></select></td> <td width='250px'><select name="ProdLBox2" id="ProdLBox2" class="ProdLBox2" size="8"></select></td> <td width='250px'><select name="ProdLBox3" id="ProdLBox3" class="ProdLBox3" size="8"></select></td> </tr> </table> </div> i'm using live validation for my client side validation. var v_fname = new LiveValidation('Customer_FirstName', { validMessage: " " }, { onlyOnSubmit: true }); v_fname.add(Validate.Presence, { failureMessage: enterfirstname}); var v_lname = new LiveValidation('Customer_LastName', { validMessage: " " }); v_lname.add(Validate.Presence, { failureMessage: enterlastname }); var v_email = new LiveValidation('Customer_Email', { validMessage: " " }); v_email.add(Validate.Presence, { failureMessage: enteremail, validMessage: " " }); v_email.add(Validate.Email, { failureMessage: entervalidemail}); and what i notice is that after doing some button call: $(".btnAddProduct").click(function() { //Check first to see if there's anything to be added if (parseFloat($(".tboAddProduct").val()) < 1) { //TO DO: to replace with localized text var selectProductError = "Please select a product first"; $("#validationSummary").text(selectProductError); //alert("Please select a product first"); return false; } $(".PanelProductReg").show(); addProductRow($(".tboAddProductId").val(), $("#tboAddProduct").val()); }); what will happen is that the validation tags will start to appear for the whole page for all the input which are tag for the live validation. instead of just appearing when the controls are being higlighted and onblur. i'm using some ajax calls to get data and a lot of jquery to dynamically do the gui stuff. could any of this be causing some sort of an internal conflict? thanks

    Read the article

  • How dinamically set validation attributes to a Model MVC 2?

    - by Tar
    Lets says I have the following model public class Person { [NameIsValid] public string Name { get; set;} public string LastName { get; set; } } I created a custom attribute NameIsValid for this model. Lets says for ViewA I need the custom attribute validation in the model, but for ViewB I dont need this custom validation attribute, how can I dinamically set or remove the custom attribute from the model when need it? Thanks!

    Read the article

< Previous Page | 96 97 98 99 100 101 102 103 104 105 106 107  | Next Page >