Search Results

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

Page 59/278 | < Previous Page | 55 56 57 58 59 60 61 62 63 64 65 66  | Next Page >

  • Django template-printing variables

    - by Hulk
    In django views def add(request): dict{} co_data = optarr dict.update({'co_data' : co_data}) logging.debug(co_data) return render_to_response('scheme/create.html',context_instance=RequestContext(request,{'dict': dict})) And data has the following string 1##2##3##4## And in the template when i say {{co_data}} it doesnt display the values.Please point out whats wrong in the code. Thanks..

    Read the article

  • Accessing django choice field

    - by Hulk
    there is a module as header , from test.models import SEL_VALUES class rubrics_header(models.Model): sel_values = models.IntegerField(choices=SEL_VALUES) So when SEL_VALUES is imported from test.modules.What is the code that has to go in views to get the choices in sel_values . And the test.modules has the following, class SEL_VALUES: vaue = 0 value2 = 1 class Entries(forms.Form) : models.IntegerField(choices=SEL_VALUES) SEL_VALUES = ((ACCESS.value,'NAME'),(ACCESS.value2,'DESIGNATION'))

    Read the article

  • Django foreign key error

    - by Hulk
    In models the code is as, class header(models.Model): title = models.CharField(max_length = 255) created_by = models.CharField(max_length = 255) def __unicode__(self): return self.id() class criteria(models.Model): details = models.CharField(max_length = 255) headerid = models.ForeignKey(header) def __unicode__(self): return self.id() In views, p_l=header.objects.filter(id=rid) for rows in row_data: row_query =criteria(details=rows,headerid=p_l) row_query.save() In row_query =criteria(details=rows,headerid=p_l) there is an error saying 'long' object is not callable in models.py in __unicode__, What is wrong in the code Thanks..

    Read the article

  • Django debug error

    - by Hulk
    I have the following in my model: class info(models.Model): add = models.CharField(max_length=255) name = models.CharField(max_length=255) An in the views when i say info_l = info.objects.filter(id=1) logging.debug(info_l.name) i get an error saying name doesnt exist at debug statement. 'QuerySet' object has no attribute 'name' 1.How can this be resolved. 2.Also how to query for only one field instead of selecting all like select name from info.

    Read the article

  • querying for timestamp field in django

    - by Hulk
    In my views i have the date in the following format s_date=20090106 and e_date=20100106 The model is defined as class Activity(models.Model): timestamp = models.DateTimeField(auto_now_add=True) how to query for the timestamp filed with the above info. Activity.objects.filter(timestamp>=s_date and timestamp<=e_date) Thanks.....

    Read the article

  • Android - Nesting ViewFlippers

    - by user286285
    Hi, I want to nest several viewflippers. is this possible? I have not been successful thus far. My first tier flips as required but when I flip to the first nested viewflipper its contents appear blank and I can't "flip" it my views are V1 V2 V3 - H1 , H2, H3 One I flip to V3 vertically ... H1 does not appear. where as H is my Horizontal flipper group. Neil

    Read the article

  • app-engine-patch and "object_detail" view didn't work

    - by Hugh
    Hi(Sorry for my ugly english) When I calling the flowing: http://192.168.62.90:8000/blog/entry/?agphdXR1bW4xOTEychALEgpibG9nX2VudHJ5GCYM will use this: urlpatterns = patterns('', (r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}), (r'^$', list_detail.object_list, entry_info), (r'^entry/(?P<object_id>.*)$', list_detail.object_detail, {'queryset': Entry.all(), 'template_name': 'sample_test_page.html'}), ) and the error is: Generic view must be called with either an object_id or a slug/slug_field. I want to know why this didn't work for me.

    Read the article

  • How to load view-Templates from default when not available in module? Zend Framework

    - by Oliver
    Hi my problem with Zend Framework... unfortunately not solved after 3 hours of searching: I have a modular Zend Application, which is working fine if i have my module and error templates in the called module. If i delete error/error.phtml out of views/scripts/ a Fatal Error is showing up that there is no directory. To cut a long story short: How can i define that Zend falls back to default module in this situation? Many thanks in advance.

    Read the article

  • RoR - Associations into practise - forms (View)

    - by NicoJuicy
    I'm learning Ruby on Rails. I'm using some associations (has_many :through, ...) But i'm having some problems with it when i'm combining my views. How exactly do i combine these nested forms? Can i do this with partial forms and where do i have to write extra code for this? I have seen examples only use the "view" and others also edit the controller.... An example would be very nice :-)

    Read the article

  • Function pointers in javascript using django

    - by Hulk
    Is this a valid function pointer code below, In views , def change(request): dict={} function_ptr="create()" dict.update({'function_ptr' : function_ptr}) return render_to_response('mpjt/create.html',context_instance=RequestContext(request,{'dict': dict})) In create.html $(document).ready(function() { var a = '{{dict.function_ptr}}' func_ptr(a); function create() { alert('got respponse'); } }); Thanks..

    Read the article

  • ASP.NET MVC Generic Partial

    - by gnome
    Is is possible to have a partial view inherit more than one model? I have three models (Contacts, Clients, Vendors) that all have address information (Address). In the interest of being DRY I pulled the address info into it's own model, Addresses. I created a partial create / update view of addresses and what to render this in other other three model's create / update views.

    Read the article

  • All PHP sites stopped working on IIS7, internal server error 500

    - by TimothyP
    I installed multiple drupal 7 sites using the Web Platform Installer on Windows Server 2008. Until know they worked without any problems, but recently internal server error 500 started to show up (once every so many requests), now it happens for all requests to any of the php sites. There's not much detail to go on, and nothing changed between the time when it was working and now (well nothing I know of anyway) The log file is flooded with messages such as [09-Aug-2011 09:08:04] PHP Fatal error: Allowed memory size of 262144 bytes exhausted (tried to allocate 261904 bytes) in Unknown on line 0 [09-Aug-2011 09:08:16] PHP Fatal error: Allowed memory size of 262144 bytes exhausted (tried to allocate 261904 bytes) in Unknown on line 0 [09-Aug-2011 09:08:16] PHP Fatal error: Allowed memory size of 262144 bytes exhausted (tried to allocate 261904 bytes) in Unknown on line 0 [09-Aug-2011 09:08:20] PHP Fatal error: Allowed memory size of 262144 bytes exhausted (tried to allocate 261904 bytes) in Unknown on line 0 [09-Aug-2011 09:08:22] PHP Fatal error: Allowed memory size of 262144 bytes exhausted (tried to allocate 261904 bytes) in Unknown on line 0 [09-Aug-2011 09:08:51] PHP Fatal error: Allowed memory size of 262144 bytes exhausted (tried to allocate 261904 bytes) in Unknown on line 0 [09-Aug-2011 09:09:56] PHP Fatal error: Allowed memory size of 262144 bytes exhausted (tried to allocate 261904 bytes) in Unknown on line 0 [09-Aug-2011 09:09:57] PHP Fatal error: Allowed memory size of 262144 bytes exhausted (tried to allocate 261904 bytes) in Unknown on line 0 [09-Aug-2011 09:12:13] PHP Fatal error: Allowed memory size of 262144 bytes exhausted (tried to allocate 261904 bytes) in Unknown on line 0 [09-Aug-2011 09:15:09] PHP Fatal error: Allowed memory size of 262144 bytes exhausted (tried to allocate 261904 bytes) in Unknown on line 0 [09-Aug-2011 09:15:09] PHP Fatal error: Allowed memory size of 262144 bytes exhausted (tried to allocate 261904 bytes) in Unknown on line 0 [09-Aug-2011 09:21:28] PHP Fatal error: Allowed memory size of 262144 bytes exhausted (tried to allocate 261904 bytes) in Unknown on line 0 [09-Aug-2011 09:21:28] PHP Fatal error: Allowed memory size of 262144 bytes exhausted (tried to allocate 261904 bytes) in Unknown on line 0 I have tried increasing the memory limit in php.ini as such: memory_limit = 512MB But that doesn't seem to solve the problem either. This is in the global php configuration in IIS When I looked at the sites one by one, I noticed that PHP seemed to have been disabled. PHP is not enabled. Register new PHP version to enable PHP via FastCGI So I tried to register the php version again C:\Program Files\PHP\v5.3\php-cgi.exe But when I try to apply the changes I get There was an error while performing this operation Details: Operation is not valid due to the current state of the object There doesn't seem to be any other information than that. I have no idea why all of a sudden php isn't available for the sites anymore. PS: I have rebooted IIS, the server, etc... This server is hosted on amazon S3, so I gave the server some more power Update These seem to be two different issues I used memory_limit=128MB instead of memory_limit=128M Notice the "M" instead of "MB" A memory_limit of 128M was not enough, had to increase it to 512M The first issue caused internal server errors for every request. Increasing to 512MB seemed to have solved the problem for a little while, but after a while the server errors return. Note that the PHP manager inside of IIS still shows there is no PHP available for the sites (the global config does see it as available) So the problem remains unsolved

    Read the article

  • Amazon EC2 Instance - m1.medium Ubuntu 12.04 - Started to crash three days ago

    - by Joy
    The environment: Amazon EC2 Instance - m1.medium Ubuntu 12.04 Apache 2.2.22 - Running a Drupal Site Using MySQL DB Server RAM info: ~$ free -gt total used free shared buffers cached Mem: 3 1 2 0 0 0 -/+ buffers/cache: 0 2 Swap: 0 0 0 Total: 3 1 2 Hard drive info: Filesystem Size Used Avail Use% Mounted on /dev/xvda1 7.9G 4.7G 2.9G 62% / udev 1.9G 8.0K 1.9G 1% /dev tmpfs 751M 180K 750M 1% /run none 5.0M 0 5.0M 0% /run/lock none 1.9G 0 1.9G 0% /run/shm /dev/xvdb 394G 199M 374G 1% /mnt The problem About two days ago the site started failing becaue the MySQL server was shut down by Apache with the following message: kernel: [2963685.664359] [31716] 106 31716 226946 22748 0 0 0 mysqld kernel: [2963685.664730] Out of memory: Kill process 31716 (mysqld) score 23 or sacrifice child kernel: [2963685.664764] Killed process 31716 (mysqld) total-vm:907784kB, anon-rss:90992kB, file-rss:0kB kernel: [2963686.153608] init: mysql main process (31716) killed by KILL signal kernel: [2963686.169294] init: mysql main process ended, respawning That states that the VM was occupying 0.9GB, but my Ram has 2GB free, so 1GB was still left free. I understand that in Linux applications can allocate more memory than physically available. I don't know if this is the problme, it's the first time that it has started to happen. Obviously, the MySQL server tries to restart, but there's no memory for it apparently and it won't restart. Here is its error log: Plugin 'FEDERATED' is disabled. The InnoDB memory heap is disabled Mutexes and rw_locks use GCC atomic builtins Compressed tables use zlib 1.2.3.4 Initializing buffer pool, size = 128.0M InnoDB: mmap(137363456 bytes) failed; errno 12 Completed initialization of buffer pool Fatal error: cannot allocate memory for the buffer pool Plugin 'InnoDB' init function returned error. Plugin 'InnoDB' registration as a STORAGE ENGINE failed. Unknown/unsupported storage engine: InnoDB [ERROR] Aborting [Note] /usr/sbin/mysqld: Shutdown complete I simply restarted the Mysql service. About two hours later it happened again. I restarted it. Then it happened again 9 hours later. So then I thought of the MaxClients parameter of apache.conf, so I went to check it out. It was set at 150. I decided to drop it down to 60. As so: <IfModule mpm_prefork_module> ... MaxClients 60 </IfModule> <IfModule mpm_worker_module> ... MaxClients 60 </IfModule> <IfModule mpm_event_module> ... MaxClients 60 </IfModule> Once I did that, I had the apache2 service restart and it all went smoothly for 3/4 of a day. Since at night the MySQL service shut down once again, but this time it wasn't killed by the Apache2 service. Instead it called the OOM-Killer with the following message: kernel: [3104680.005312] mysqld invoked oom-killer: gfp_mask=0x201da, order=0, oom_adj=0, oom_score_adj=0 kernel: [3104680.005351] [<ffffffff81119795>] oom_kill_process+0x85/0xb0 kernel: [3104680.548860] init: mysql main process (30821) killed by KILL signal Now I'm out of ideas. Some articles state that the ideal thing to do is change the kernel behaviour with the following (include it to the file /etc/sysctl.conf ) vm.overcommit_memory = 2 vm.overcommit_ratio = 80 So no overcommits will take place. I'm wondering if this is the way to go? Keep in mind I'm no server administrator, I have basic knowldege. Thanks a bunch in advance.

    Read the article

  • How to build MVC Views that work with polymorphic domain model design?

    - by Johann de Swardt
    This is more of a "how would you do it" type of question. The application I'm working on is an ASP.NET MVC4 app using Razor syntax. I've got a nice domain model which has a few polymorphic classes, awesome to work with in the code, but I have a few questions regarding the MVC front-end. Views are easy to build for normal classes, but when it comes to the polymorphic ones I'm stuck on deciding how to implement them. The one (ugly) option is to build a page which handles the base type (eg. IContract) and has a bunch of if statements to check if we passed in a IServiceContract or ISupplyContract instance. Not pretty and very nasty to maintain. The other option is to build a view for each of these IContract child classes, breaking DRY principles completely. Don't like doing this for obvious reasons. Another option (also not great) is to split the view into chunks with partials and build partial views for each of the child types that are loaded into the main view for the base type, then deciding to show or hide the partial in a single if statement in the partial. Also messy. I've also been thinking about building a master page with sections for the fields that only occur in subclasses and to build views for each subclass referencing the master page. This looks like the least problematic solution? It will allow for fairly simple maintenance and it doesn't involve code duplication. What are your thoughts? Am I missing something obvious that will make our lives easier? Suggestions?

    Read the article

  • Using a CMS with an external database

    - by George Reith
    I am looking at building an external site with a CMS, probably Drupal or ExpressionEngine. The problem is that our company already has a membership database that is designed to work with our existing enterprise software. Migrating data from the database manually is not an option as modifications and new data must be accessible in real-time. Because the design of the external database will differ from the CMS's own I have decided the best way forward is to use two databases and force the CMS to use the external to read user information (cannot write to) and a local for everything else the CMS needs to do (read + write). Is this feasible with these Drupal or ExpressionEngine? Ideally I need to be able to use hooks as I do not wan't to modify core CMS files. Sifting through the docs I am not able to find what I would hook into for ether CMS. (Note: I know it is possible, but I want to know if it's feasible). Finally if there is a better way of handling this situation please also chime in. Perhaps there is something at the database level to reference a field or table in an external database? I'm clutching at straws someone can point me in the right direction I'm sure.

    Read the article

  • Nginx - Treats PHP as binary

    - by Think Floyd
    We are running Nginx+FastCgi as the backend for our Drupal site. Everything seems to work like fine, except for this one url. http:///sites/all/modules/tinymce/tinymce/jscripts/tiny_mce/plugins/smimage/index.php (We use TinyMCE module in Drupal, and the url above is invoked when user tries to upload an image) When we were using Apache, everything was working fine. However, nginx treats that above url Binary and tries to Download it. (We've verified that the file pointed out by the url is a valid PHP file) Any idea what could be wrong here? I think it's something to do with the NGINX configuration, but not entirely sure what that is. Any help is greatly appreciated. Config: Here's the snippet from the nginx configuration file: root /var/www/; index index.php; if (!-e $request_filename) { rewrite ^/(.*)$ /index.php?q=$1 last; } error_page 404 index.php; location ~* \.(engine|inc|info|install|module|profile|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template)$ { deny all; } location ~* ^.+\.(jpg|jpeg|gif|png|ico)$ { access_log off; expires 7d; } location ~* ^.+\.(css|js)$ { access_log off; expires 7d; } location ~ .php$ { include /etc/nginx/fcgi.conf; fastcgi_pass 127.0.0.1:8888; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; } location ~ /\.ht { deny all; }

    Read the article

  • android listview set dynamically background color of views

    - by Sephy
    Hi everybody, I know that there have quite a lot of answers to similar questions but I couldn't find any solution to my question, so new topic : I'm creating a listview, with one basic view per row, my try is to change the background color of the view by .setbackgroundcolor, but nothing's doing the trick... I define an array of color at the beginning of my resources and i'm trying to display it, I also tried to put the array in the class, write the color like #00FF00, int, and I wanted to try 0x...... but as my colors are in an array, I can't do 0x+myColorsArray[i] because Eclipse tells me that it's not a proper hex color... I'm getting a bit desperate... thanks for any help

    Read the article

  • How to display ppt file in Android views using Docx4j

    - by Ganesh
    I am working on Android and using docx4j to view the docx,pptx and xlsx files into my application. I am unable to view the ppt files . I am getting compile time error at SvgExporter class. which is not there in docx4j library. Can any one help me out to get the SvgExporter class library and build my application and get the Svghtml to load on webview for ppt files. my code is as follows. String inputfilepath = System.getProperty("user.dir") + "/sample-docs/pptx/pptx-basic.xml"; // Where to save images SvgExporter.setImageDirPath(System.getProperty("user.dir") + "/sample-docs/pptx/"); PresentationMLPackage presentationMLPackage = (PresentationMLPackage)PresentationMLPackage.load(new java.io.File(inputfilepath)); // TODO - render slides in document order! Iterator partIterator = presentationMLPackage.getParts().getParts().entrySet().iterator(); while (partIterator.hasNext()) { Map.Entry pairs = (Map.Entry)partIterator.next(); Part p = (Part)pairs.getValue(); if (p instanceof SlidePart) { System.out.println( SvgExporter.svg(presentationMLPackage, (SlidePart)p) ); } } // NB: file suffix must end with .xhtml in order to see the SVG in a browser }

    Read the article

  • Segmented Control to change views

    - by Goods
    I have created an up/down arrow segmented control button on the right side of the navigation bar in my detail view. In a table based application, how can I use these up/down arrows to move through cells in the parent table? The apple "NavBar" sample code has an example of this but the controls are not functional. The iBird program has this functionality as well and it is very nice. Download the "iBird 15" program for free. Any thoughts? Thanks!

    Read the article

  • Appcelerator Titanium - auto height table views break with shortish text

    - by ceejayoz
    I posted this on the Appcelerator Titanium dev Q&A site, but maybe someone here has had this issue... KitchenSink 1.1 illustrates this issue. In table_view_api_auto_height.js, changing row: addRow(0,'This is some long text. This is some long text. This is some long text. This is some long text. This is some long text. This is some long text. This is some long text. This is some long text. This is some long text. This is some long text. This is some long text. This is some long text. This is some long text. This is some long text. This is some long text. This is some long text. This is some long text. This is some long text.'); to something like: addRow(0,'This is some long text. This is some long text.'); results in incorrect left padding on the row. See screenshot:

    Read the article

  • UISplitView show different views in the detail pane

    - by Mark
    How can I change the view in the Details pane of the UISplitView so that its a completely different view? Im having a fair amount of trouble understanding how its all wired up and where things should go at the moment, could someone please enlighten me? What I would love to be able to do is to show a specific view based on what the user has selected in the UITableView on the left pane (this view could be an image, or a more complex view of a news article, etc... many different options) then when the user turns the iPad into portrait view, that view that was in the details pane changes to be its equivalent portrait view version. Does this make sense? How on earth would I do that? Just to brainstorm, here is what I was thinking: Create a Split View project Create 2 NIBs for each view: (with accompanying view controllers???) * PortraitNewsStory * LandscapeNewsStory * PortraitImageBrowser * LandscapeImageBrowser * etc... Create a UISplitView control using XCode Capture when a user rotates the iPad (should this be done in the RootViewController.m ?) Change the view of the DetailViewController how should I do this? profit??? Thanks Mark

    Read the article

< Previous Page | 55 56 57 58 59 60 61 62 63 64 65 66  | Next Page >