Search Results

Search found 6941 results on 278 pages for 'drupal views'.

Page 223/278 | < Previous Page | 219 220 221 222 223 224 225 226 227 228 229 230  | Next Page >

  • Edit form not being instanciated

    - by 47
    I have two models like this: class OptionsAndFeatures(models.Model): options = models.TextField(blank=True, null=True) entertainment = models.TextField(blank=True, null=True) seats_trim = models.TextField(blank=True, null=True) convenience = models.TextField(blank=True, null=True) body_exterior = models.TextField(blank=True, null=True) lighting = models.TextField(blank=True, null=True) safety = models.TextField(blank=True, null=True) powertrain = models.TextField(blank=True, null=True) suspension_handling = models.TextField(blank=True, null=True) specs_dimensions = models.TextField(blank=True, null=True) offroad_capability = models.TextField(blank=True, null=True) class Vehicle(models.Model): ... options_and_features = models.ForeignKey(OptionsAndFeatures, blank=True, null=True) I have a model form for the OptionsAndFeaturesclass that I'm using in both the add and edit views. In the add view it works just fine. But the edit view renders the OptionsAndFeatures as blank. The code for the edit view is as follows: def edit_vehicle(request, stock_number=None): vehicle = get_object_or_404(Vehicle, stock_number=stock_number) if request.method == 'POST': # save info else: vehicle_form = VehicleForm(instance=vehicle) photos = PhotosFormSet(instance=vehicle) options = OptionsForm(instance=vehicle) #render_to_reponse What could be the problem here?

    Read the article

  • iPad: How can I implement a scrolling timeline using a static image?

    - by BeachRunnerJoe
    I'm diving into iOS development and I'm building a simple timeline app using a static timeline image that I already have. The timeline image won't fit on the screen. The width of the image is about five times the width of the iPad screen, so I have to allow the user to scroll the image horizontally. Here's a mockup... For each item on the timeline, the user can tap it to receive a description at the bottom of the screen. My questions are... I was planning to use a UIScrollView with a PageControl at the bottom. Can a UIScrollView hold a single view that holds the entire timeline image or do I have to break the the timeline image up into multiple views? Are there any performance issues I need to consider when implementing this with a UIScrolLView, using a static image? Are there other approaches to implementing this scrollable timeline that I should consider other than using a UIScrollView? Thanks so much in advance for your wisdom!

    Read the article

  • How to organize database access code in Android project?

    - by Mladen Jablanovic
    I have created a ContentProvider for my main Sqlite table, pretty much following NotePad example from SDK (although I am not sure whether I will ever be exposing my data to other apps). However, I need to create lots of other, non-trivial queries on that and other tables and views. A good example would be queries to extract some statistics from the base data, averages, totals etc. So what's the best place for this code in an Android project? How it should be related and connected to the Uri-based data access exposed by a Provider? Any good examples out there?

    Read the article

  • HELP!!! session variables survives after logout!!!

    - by Alejandra
    Hi guys! I have a problem, will explain how to reproduce the problem: 1- login into my page (sesion variables set as $_SESSION['logged'] = true and $_SESSION['id'] = 123 2-then inside the main menu I click logout option, code like this function logout() { session_start(); $_SESSION['id'] = null; $_SESSION['logged'] = null; unset($_SESSION); session_destroy(); require_once('Views/SessionExpiredView.php'); } 3- In the session expired view I display a link the login page, there session is null 4- I click back on the browser and click ok to resend information 5- session becomes again $_SESSION['logged'] = true and $_SESSION['id'] = 123 and I'm loggued again and able to see all the information related to the id 123 This is a security issue and I don't know what is happening!!! any suggestion will be deeply appreciated. Alejandra

    Read the article

  • Rails - Rendering a Partial without having to use "_" in front of the filename?

    - by bluedevil2k
    How do I render a partial without having to supply the "_" in front of the file name? Is there a parameter I can call to not use it? This problem popped up using RABL and Backbone - using RABL requires me to have a file in my views like "index.json.rabl". But, when I use embed the JSON right on the page load (as is usual with Backbone), I'm required to call the file "index.json.rabl". These 2 files are the exact same thing, just required to have different names. I'm looking to use just 1 file, "index.json.rabl" and force the render() function to look for that file name, without the "".

    Read the article

  • Methods of sending web-generated config files to servers and restarting services.

    - by JPG
    Hi, We're writing a web-based tool to configure our services provided by multiple servers. This includes interfaces configuration, dhcp configs etc. etc. Having configs in database and views that generate proper output, how to send it/make it available for servers? I'm thinking about sending it through scp and invoking reload command to services through ssh. I'm also thinking about using Func to do all the job, as this is Python tool and will seemingly integrate with python-based (django) config tool. Any other proposals?

    Read the article

  • Selecting a portion of a JSON array and applying variables in javascript or jquery

    - by user1644609
    I am retrieving a JSON file that returns its results like what you see below. The JSON has 365 days worth of data. I would like to create "views" of this JSON using javascript, one which pulls the last 10 days, then 1 month, 6 months, etc. After the getJSON function I am doing this to get a string as JSON, then turn it into an object and will then graph it. So I would like each "view" to be an object for the specified timeframe (using the one JSON). The obj_10days, obj_1month, etc variables would then be plotted. var $ graph = data ; var obj = $ . parseJSON ( $ graph ) ; JSON: [ { "Low": 8.63, "Volume": 14211900, "Date": "2012-10-26", "High": 8.79, "Close": 8.65, "Adj Close": 8.65, "Open": 8.7 }, { "Low": 8.65, "Volume": 12167500, "Date": "2012-10-25", "High": 8.81, "Close": 8.73, "Adj Close": 8.73, "Open": 8.76 }, { "Low": 8.68, "Volume": 20239700, "Date": "2012-10-24", "High": 8.92, "Close": 8.7, "Adj Close": 8.7, "Open": 8.85 }, Any help is appreciated, thank you!

    Read the article

  • Uploading an image file with Paperclip (in RoR) causing error.

    - by mtay
    This should be a simple thing to do, but I'm running into a wall and I'm not sure how to debug this response. In my Image model, I have: class Image < ActiveRecord::Base has_attached_file :image, :styles => { :display => "500x500>", :thumbnail => "95x95>"} Then in my Views, my form contains this: -form_for @image, :html => { :multipart => true } do |image| %tr %td.woc_left =label_tag :image, 'photo to upload', :class => 'required' %td.woc_center =image.file_field :image In my Mysql table, I have a column called "image_file_name" (string). However, when I try to upload an image and submit it, I see 2 errors prohibited this from being saved There were problems with the following fields: Image Paperclip::CommandNotFoundError Image Paperclip::CommandNotFoundError What am I doing wrong? Thank you for your help!

    Read the article

  • What do you name your files when using MVC?

    - by sprugman
    When using the MVC pattern, which I'm not terribly experienced with, I find myself naming things like this: /app/views/widget.php /app/models/widget.php /app/controllers/widget.php That appeals to me because it's easy to find associated classes, and I lean towards shorter names when practical. However, when I'm looking in my IDE, I see three different files called widget.php, which is confusing. I'm tempted to add "_v", "_c", "_m" or something to each name. How do you handle this? FWIW, I'm using CodeIgniter at the moment, and I don't know if there are any special benefits to using a particular convention, or any standard practices. Regardless, I'm intersted in the best-practices from various platforms.

    Read the article

  • TypeError while using django Form in editing an Entry

    - by damon
    I have an Entry model which can belong to a Category.I am providing a CategoryChoicesForm sothat the user can choose from various Categorys (from a dropdown list)when an Entry is created or edited. I am having trouble with the CategoryChoicesForm while editing the Entry.It throws a TypeError.. If somebody can make out what is happening..please advise me how to correct this. int() argument must be a string or a number, not 'QueryDict' /home/Django-1.4/django/db/models/fields/__init__.py in get_prep_value, line 537 ...views.py in edit_entry category_choices_form = CategoryChoicesForm(form_data) ... ...forms.py in __init__ self.fields['categoryoption'].queryset = Category.objects.filter(creator=self.creator) Here is the form class CategoryChoicesForm(forms.Form): categoryoption = forms.ModelChoiceField( queryset = Category.objects.none(), required=False,label='Category') def __init__(self, categorycreator,*args, **kwargs): super(CategoryChoicesForm, self).__init__(*args, **kwargs) self.creator=categorycreator self.fields['categoryoption'].queryset = Category.objects.filter(creator=self.creator) The edit_entry view is as follows @login_required @transaction.commit_on_success def edit_entry(request,id,template_name,page_title): form_data = get_form_data(request) entry = get_object_or_404(Entry,pk=id,author=request.user) ... category_choices_form = CategoryChoicesForm(form_data) ...

    Read the article

  • Activity.findViewById returning null sporadically

    - by adstro
    From the crash logs that I am getting from the Android market, I can see that some of my users are getting Force Closes caused by NullPointerExceptions when my code tries to access views that are in my application. In one example, my activity makes a call to findViewById() in onCreate() after I call setContentView(). I get an NPE when I try to access the view after the call to findViewById() (still in onCreate). What has me really scratching my head is that this does not happen all of the time (in fact most of the time the code acts as I would expect), but enough to have me concerned. I could add code to always check for null and avoid the NPE, but I would like to understand what could be causing the sporadic behavior. Does anyone know what could be causing this?

    Read the article

  • Block call in Ruby on Rails

    - by Mattias
    Hi, I'm trying to clean up my code and get rid of a lot of ugly hashes. In my views I define several actions like this: @actions = { :interest => {'Show interest', link_to(..), :disabled => true}, :follow => {'Follow this case', link_to(..)} ... } As these hashes grow, the maintainability decreases. I want to convert the above format to something like: actions do item :interest, 'Show interest', link_to(..), :disabled => true item :follow, 'Follow', link_to(..) ... end How do I structure my helper methods to allow this? Preferably the 'item'-method should only be available in the 'actions' block and not in the global scope. Thanks!

    Read the article

  • Framework or CMS for php web development?

    - by rocknroll
    Hi all, I am a C++,Unix developer who has never dabbled in web development apart from creating simple HTML pages. I am going to change that and develop a website at a personal level soon. I am going to use php,mysql on a linux machine. In this regard I am browsing through relevant literature. The language isn't a problem but reading about CMS's and frameworks is confusing. And since I am new to web development, the number of CMS's and Frameworks are overwhelming. ? My question is do I need to have knowledge of one or more CMS' and/or Frameworks like Drupal,Joomla,Zend,Wordpress etc. If yes which is the best open source CMS' and/or Framework suggested for a newbie. ?? If the answer to the above question is yes, does the choice changes if one delves into the realms of commercial web development? Note:- I will be developing on a Linux machine, using open source tools. Thanks in advance

    Read the article

  • Related Models in Rails 3

    - by Jack
    Hi, I am just starting my first Rails 3 project and am having some difficulties. I have two related models, projects and clients. I have set up the relationships as has_many and belongs_to. However in my projects views I can only access the client_id of the project. I would like to access the client's name and other parameters. I am sure that previously in rails, I could just use project.client.name, but this is not working. Is there a new feature of Rails 3 that I have missed? Cheers

    Read the article

  • How to extract data from Google Analytics and build a data warehouse (webhouse) from it?

    - by nkaur301
    I have click stream data such as referring URL, top landing pages, top exit pages and metrics such as page views, number of visits, bounces all in Google Analytics. I am required to build a data warehouse from scratch(which I believe is known as web-house) from this data. My questions are:- 1)Is it possible? Every day data increases (some in terms of metrics or measures such as visits and some in terms of new referring sites), how would the process of loading the warehouse go about? 2)What ETL tool would help me to achieve this? Pentaho I believe has a way to pull out data from Google Analytics, has anyone used it? How does that process go? Any references, links would be appreciated besides answers.

    Read the article

  • What scenarios/settings will result in a query on SQL Server (2008) return stale data

    - by s1mm0t
    Most applications rarely need to display 100% accurate data. For example if this stack overflow question displays that there have been 0 views, when there have really been 10, it doesn't really matter. This is one way that the (perceived) performance of applications can be improved, by caching results and therefore sometimes not showing 100% accurate results. There are some cases where the data does need to be 100% accurate though. So if I run the query select * from Foo I want to be sure that the results are not stale. Now depending on how my database is set up, other activity on the database, use of transactions and isolation levels etc this query may or may not be a true reflection of the world. What scenario's and settings can people think of that will result in this query returning stale results or given that another connection is part way through a transaction that has updated this table, how can I guarantee that when the above query returns, the results will be accurate.

    Read the article

  • Possible to exclude a column from `*` ?

    - by Earlz
    Is it possible to exclude a column from a select * from table statement with SQL Server? I have a need for this and this is my only option other than parsing a raw SQL string to get out the required field names (I really don't want to do that). Just to be bold. When the query is made I do not have access to the list of fields needed from the table but I do know which field I do not need. This is part of a complex multi-part query. Surely there must be some way even if it's "hackish" such as using table variables or views

    Read the article

  • Image impending other elements in iphone app view!

    - by wayne
    Hi. If someone could help I have a view in my iphone app with an image, a label and a button. I have positioned the image at the back however when I run the simulator the image is all that is showing. I have done exactly the same thing with other views and they work fine but can't get this one to work. I have checked that the image is "send to back" and other elements are at the front. Still no good. Any advice would be much appreciated. Thanks

    Read the article

  • adding button to the navigation bar

    - by praseed
    hi friends, i have a problem while adding button to the navigation bar.. My application consist of two view controllers added to the viewControllers array of a tabBarController. Inturn this tabBarController is added to the viewControllers array of a navigationController. In one of the views i have a textfield for entering dates . On the tap of this textfield the datepicker will pop up. simultaneously i want to display a done button on the navigation bar. how can i do this... i tried using self.tabBarController.navigationController.navigationItem.rightBarButtonItem = self.doneButton; But this is not working... Pls help me out..

    Read the article

  • Migrating an Access Database into SharePoint 2007.

    - by Mike T
    To my surprise and delight I read that an adminsitrator can import (nearly directly) an Access 2007 database into a sharepoint site. Automagically, the database in transformed into lists and views with some table lookup thrown in for good measure. With Access 2007 installed on the client machine, even the forms and what not can still be reused. To me... this sounds to good to be true. Has anyone actually dones this? With all this good news, where is the bad stuff and pitfalls to this. Depending on the size of the database, wouldn't this some how "gum up the works" in the SharPoint database? Sources: http://madhurahuja.blogspot.com/2007/01/adding-data-to-sharepoint-l-ists-in.html http://social.technet.microsoft.com/Forums/en-US/sharepointadmin/thread/17745835-a861-4984-9f44-7291fdae7d07

    Read the article

  • Access a viewControllers View

    - by iFloh
    Hi, I am trying to get to grips with programmatically configuring views. I have a UIViewController and want to add a UIButton to its view. Well, I created the button: UIButton *newViewButton = [[UIButton alloc] initWithFrame:CGRectMake(baseX + viewPlusX, baseY + viewPlusY, viewWidth, viewHeight)]; [newViewButton setTitle:@"View" forState:UIControlStateNormal]; [newViewButton setTag:(int)key]; [newViewButton addTarget:myViewController action:@selector(viewButton:sender) forControlEvents:UIControlEventTouchUpInside]; but when trying to add it to the view [myViewController addSubview:newViewButton]; I get the error error: expected ':' before":" token any clue what I am doing wrong regards

    Read the article

  • align input text with label in my Search gadget

    - by Patrick
    hi, I would like to align the label of my search widget with the input text (they are slightly not aligned on all browsers). Any css tip ? thanks This is my code: Search <span class="views-widget"> <span id="edit-search-wrapper" class="form-item"> <input type="text" class="form-text" title="Enter the terms you wish to search for." value="" size="15" id="edit-search" name="search" maxlength="128"> </span> </span> </div>

    Read the article

  • How does one access subviews and handle groups of them?

    - by david
    If I want to manipulate a view I get it with [self viewWithTag:5];. Is there a better way to do this? Sometimes I need to manipulate a bunch of view (e.g. move them all out of the way. I do this by adding a UIView (e.g. UIView iHoldViews) and then adding the views, buttons, etc to this view. Then I can move the iHoldViews view and all its subviews move with it. Is there a better way to do this? (I have a feeling there is :) Maybe storing them in a NSArray or NSMutableDictionary ?

    Read the article

  • Rails 3 - Ideal way to set title of pages

    - by akfalcon
    Whats the proper way to set the page title in rails 3. Currently I'm doing the following: app/views/layouts/application.html .... <%= render_title % <%= csrf_meta_tag % .... app/helpers/application_helper.rb ... def render_title return @title if defined?(@title) "Generic Page Title" end ... app/controllers/some_controller.rb ... def show @title = "some custom page title" ... end ... Is there another/better way of doing the above?

    Read the article

  • I am getting duplicates in UITableView, cellForRowAtIndexPath

    - by Martol1ni
    I am getting duplicates of my array, and wrongly displayed cells in this method: Here I am initializing the array, and adding it to the tableView: NSArray *sectionsArray = [NSArray arrayWithObjects: @"Location", @"Front Post", @"Front Fixing", @"Front Footplate", @"Rear Post", @"Read Fixing", @"Rear Footplate", @"Horizontal Bracing", @"Diagonal Bracing", @"Front Beam", @"Front Lock", @"Rear Beam", @"Rear Lock", @"Guard", @"Accessories", @"Comments", @"Off load ref", @"Loc Empty", @"Loc Affected", nil]; [_tableArray setObject:sectionsArray atIndexedSubscript:2]; [_tableView reloadData]; For some weird reason there are always the 4th object that is messed up, and is either duplicated, or do not have the views from IB. Here is the cellForRowAtIndexPath: method: - (UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell; if (indexPath.section == 2) { cell = [tableView dequeueReusableCellWithIdentifier:@"EntryCell"]; cell.tag = indexPath.row; UILabel *label = (UILabel *)[cell viewWithTag:3]; [label setText:[[_tableArray objectAtIndex:2] objectAtIndex:indexPath.row]]; } return cell; } I have logged the string [[_tableArray objectAtIndex:2] objectAtIndex:indexPath.row], and it logs the right string.

    Read the article

< Previous Page | 219 220 221 222 223 224 225 226 227 228 229 230  | Next Page >